/* Auth page styles - Sign up / Log in flow */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #000000;
    --primary-hover: #1a1a1a;
    --accent: #5b5ddb;
    --accent-light: #7577e8;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --background: #ffffff;
    --surface: #f9fafb;
    --border: #e5e7eb;
    --border-focus: #5b5ddb;
    --success: #059669;
    --error: #dc2626;
    --driver-accent: #047857;
    --rider-accent: #5b5ddb;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Screen reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus states */
:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Auth Container */
.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Auth Header */
.auth-header {
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: var(--background);
}

.logo-link {
    text-decoration: none;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #764ba2 0%, #667eea 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--text-primary);
}

/* Auth Main */
.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

/* Auth Steps */
.auth-step {
    display: none;
}

.auth-step.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* User Type Badge */
.user-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.user-type-badge.rider {
    color: var(--rider-accent);
}

.user-type-badge.driver {
    color: var(--driver-accent);
}

.user-type-badge svg {
    width: 18px;
    height: 18px;
}

/* Auth Title */
.auth-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.auth-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-input {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: var(--background);
    color: var(--text-primary);
    transition: all 0.2s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(91, 93, 219, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input.input-error {
    border-color: var(--error);
    background-color: rgba(220, 38, 38, 0.02);
}

.form-input.input-error:focus {
    border-color: var(--error);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.form-input.input-success {
    border-color: var(--success);
    background-color: rgba(5, 150, 105, 0.02);
}

/* Large Email Input */
.email-input-large {
    font-size: 1.125rem;
    padding: 1.25rem 1.5rem;
}

/* OTP Input Container */
.otp-input-container {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin: 2rem 0;
}

.otp-input {
    width: 56px;
    height: 64px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'SF Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--background);
    color: var(--text-primary);
    transition: all 0.2s ease;
    outline: none;
}

.otp-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(91, 93, 219, 0.1);
}

.otp-input.filled {
    border-color: var(--accent);
    background: rgba(91, 93, 219, 0.05);
}

.otp-input.error {
    border-color: var(--error);
    animation: shake 0.4s ease-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    50% { transform: translateX(8px); }
    75% { transform: translateX(-8px); }
}

/* Email Display */
.email-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--surface);
    border-radius: 100px;
    margin-bottom: 1.5rem;
}

.email-display svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.email-display span {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.submit-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.submit-btn.loading .btn-text {
    opacity: 0;
}

.btn-spinner {
    position: absolute;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Secondary Button */
.secondary-btn {
    width: 100%;
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
    background: var(--surface);
}

/* Link Button */
.link-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.link-btn:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

.link-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Error Message */
.error-message {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.3s ease-out;
}

.error-message svg {
    width: 20px;
    height: 20px;
    color: var(--error);
    flex-shrink: 0;
    margin-top: 1px;
}

.error-message p {
    font-size: 0.875rem;
    color: var(--error);
    font-weight: 500;
    line-height: 1.5;
}

/* Info Box */
.info-box {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(91, 93, 219, 0.08);
    border: 1px solid rgba(91, 93, 219, 0.2);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.info-box svg {
    width: 20px;
    height: 20px;
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 1px;
}

.info-box p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Resend Section */
.resend-section {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.resend-section p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.countdown {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

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

.auth-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Success State */
.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: rgba(5, 150, 105, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.4s ease-out;
}

.success-icon svg {
    width: 40px;
    height: 40px;
    color: var(--success);
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Progress Indicator */
.auth-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.progress-step {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    transition: all 0.3s ease;
}

.progress-step.active {
    width: 24px;
    border-radius: 4px;
    background: var(--accent);
}

.progress-step.completed {
    background: var(--success);
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

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

.divider span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Social Login Container */
.social-login-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Social Button Base */
.social-btn {
    width: 100%;
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.social-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.social-btn.loading {
    pointer-events: none;
}

.social-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Google Button */
.google-btn {
    background: var(--background);
    color: var(--text-primary);
    border: 1.5px solid var(--border);
}

.google-btn:hover:not(:disabled) {
    background: var(--surface);
    border-color: var(--text-muted);
}

/* Apple Button */
.apple-btn {
    background: var(--primary);
    color: white;
    border: 1.5px solid var(--primary);
}

.apple-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.apple-btn .social-icon {
    color: white;
}

/* Responsive */
@media (max-width: 640px) {
    .auth-header {
        padding: 1rem;
    }

    .auth-main {
        padding: 1.5rem;
    }

    .auth-title {
        font-size: 1.75rem;
    }

    .otp-input-container {
        gap: 0.5rem;
    }

    .otp-input {
        width: 48px;
        height: 56px;
        font-size: 1.25rem;
    }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f9fafb;
        --text-secondary: #9ca3af;
        --text-muted: #6b7280;
        --background: #111827;
        --surface: #1f2937;
        --border: #374151;
    }

    .auth-header {
        background: var(--background);
        border-color: var(--border);
    }

    .form-input {
        background: var(--surface);
    }

    .otp-input {
        background: var(--surface);
    }

    .submit-btn {
        background: white;
        color: #111827;
    }

    .submit-btn:hover:not(:disabled) {
        background: #f3f4f6;
    }

    /* Social buttons in dark mode */
    .google-btn {
        background: var(--surface);
        border-color: var(--border);
    }

    .google-btn:hover:not(:disabled) {
        background: #374151;
    }

    .apple-btn {
        background: white;
        color: #111827;
        border-color: white;
    }

    .apple-btn:hover:not(:disabled) {
        background: #f3f4f6;
        border-color: #f3f4f6;
    }

    .apple-btn .social-icon {
        color: #111827;
    }
}

