* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #22c55e;
    --primary-light: #dcfce7;
    --primary-dark: #16a34a;
    --landlord: #3b82f6;
    --security: #ef4444;
    --guest: #8b5cf6;
    --background: #ffffff;
    --surface: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --radius: 20px;
    --radius-sm: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    padding: 0;
}

.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.login-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 40px 24px 30px;
    text-align: center;
}

.logo {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.5rem;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-header p {
    opacity: 0.9;
    font-size: 1rem;
}

.login-content {
    flex: 1;
    padding: 32px 20px;
    background: var(--background);
}

.user-type-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.user-type-option {
    position: relative;
}

.user-type-option input {
    position: absolute;
    opacity: 0;
}

.user-type-label {
    display: flex;
    align-items: center;
    padding: 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--surface);
}

.user-type-label:hover {
    border-color: var(--primary);
}

.user-type-option input:checked + .user-type-label {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.user-type-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-right: 16px;
    flex-shrink: 0;
}

.landlord .user-type-icon {
    background: var(--landlord);
    color: white;
}

.security .user-type-icon {
    background: var(--security);
    color: white;
}

.guest .user-type-icon {
    background: var(--guest);
    color: white;
}

.user-type-info {
    flex: 1;
}

.user-type-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.user-type-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--surface);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.password-input {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
}

.password-toggle:hover {
    background: var(--border);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
}

.remember-me input {
    width: 18px;
    height: 18px;
    border-radius: 4px;
}

.remember-me label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.forgot-password {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.login-btn {
    width: 100%;
    padding: 18px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.login-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.divider {
    display: flex;
    align-items: center;
    margin: 32px 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.divider span {
    padding: 0 16px;
}

.alternative-login {
    text-align: center;
}

.alt-login-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.qr-login-btn {
    width: 100%;
    padding: 16px 24px;
    background: white;
    color: var(--text-primary);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.qr-login-btn-active {
    width: 100%;
    padding: 16px 24px;
    background: #8b5cf6;
    color: white;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.qr-login-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.demo-section {
    margin-top: 32px;
    padding: 20px;
    background: var(--primary-light);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
}

.demo-title {
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.demo-account {
    padding: 12px;
    background: white;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
}

.demo-account:hover {
    border-color: var(--primary);
    transform: translateX(4px);
}

.demo-account:last-child {
    margin-bottom: 0;
}

.demo-type {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.demo-credentials {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

.footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.footer-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.footer-link:hover {
    text-decoration: underline;
}

/* Loading animation */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.loading {
    animation: pulse 1s ease-in-out infinite;
}

/* Success state */
.success {
    background: #10b981 !important;
}

/* Responsive adjustments for larger screens */
@media (min-width: 768px) {
    body {
        background: var(--surface);
        padding: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .login-container {
        max-width: 400px;
        min-height: auto;
        border-radius: var(--radius);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        overflow: hidden;
    }

    .login-header {
        border-radius: var(--radius) var(--radius) 0 0;
    }
}

@media (min-width: 1024px) {
    .login-container {
        max-width: 440px;
    }
}
