/* ========================================
   Authentication Page Styles
   ======================================== */

:root {
    --color-primary: #0B63FF;
    --color-primary-dark: #0952d9;
    --color-surface: #FFFFFF;
    --color-background: #F8F9FA;
    --color-border: #E5E7EB;
    --color-text: #1F2937;
    --color-text-secondary: #6B7280;
    --color-danger: #EF4444;
    --color-success: #28A745;
    --radius-base: 8px;
    --radius-lg: 12px;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 440px;
}

.auth-box {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

/* Logo */
.logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.logo p {
    font-size: 14px;
    color: var(--color-text-secondary);
}

/* Auth Steps */
.auth-step h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}

.step-description {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 24px;
}

.step-description strong {
    color: var(--color-text);
}

.auth-step.hidden {
    display: none;
}

/* Back Button */
.back-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: var(--radius-base);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-bottom: 16px;
    transition: all 0.2s;
}

.back-btn:hover {
    background: var(--color-background);
}

/* Form */
.auth-form {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-base);
    font-size: 15px;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(11, 99, 255, 0.1);
}

.form-input::placeholder {
    color: #9CA3AF;
}

.password-hint {
    display: block;
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-base);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-dark);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-oauth {
    width: 100%;
    background: white;
    color: var(--color-text);
    border: 2px solid var(--color-border);
    margin-bottom: 12px;
}

.btn-oauth:hover {
    background: var(--color-background);
    border-color: var(--color-text);
}

.btn-oauth img,
.btn-oauth svg {
    width: 20px;
    height: 20px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 14px;
    cursor: pointer;
    padding: 8px;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-link:disabled {
    color: var(--color-text-secondary);
    cursor: not-allowed;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--color-border);
}

.divider span {
    padding: 0 16px;
    color: var(--color-text-secondary);
    font-size: 14px;
}

/* OTP Inputs */
.otp-inputs {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
}

.otp-input {
    width: 50px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-base);
    transition: all 0.2s;
}

.otp-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(11, 99, 255, 0.1);
}

/* Resend Container */
.resend-container {
    text-align: center;
    margin-top: 16px;
}

.resend-attempts {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-top: 8px;
}

/* Password Strength */
.password-strength {
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    margin-bottom: 16px;
    overflow: hidden;
}

.password-strength::after {
    content: '';
    display: block;
    height: 100%;
    width: 0%;
    transition: all 0.3s;
}

.password-strength.weak::after {
    width: 33%;
    background: var(--color-danger);
}

.password-strength.medium::after {
    width: 66%;
    background: #F59E0B;
}

.password-strength.strong::after {
    width: 100%;
    background: var(--color-success);
}

/* Terms */
.terms-text {
    font-size: 12px;
    color: var(--color-text-secondary);
    text-align: center;
    margin-top: 16px;
}

.terms-text a {
    color: var(--color-primary);
    text-decoration: none;
}

.terms-text a:hover {
    text-decoration: underline;
}

/* Footer */
.auth-footer {
    text-align: center;
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-top: 24px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 480px) {
    .auth-box {
        padding: 24px;
    }

    .otp-input {
        width: 42px;
        height: 48px;
        font-size: 20px;
    }

    .otp-inputs {
        gap: 8px;
    }
}
