/**
 * Clarity Space Authentication Styles
 * SMS OTP and Telegram Login UI components
 */

/* ============================================================================
   AUTH FORM CONTAINER
   ============================================================================ */

.auth-form {
    max-width: 400px;
    margin: 0 auto;
    padding: 32px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.auth-title {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    text-align: center;
}

.auth-subtitle {
    margin: 0 0 24px;
    font-size: 14px;
    color: #6b7280;
    text-align: center;
}

/* ============================================================================
   AUTH INPUTS
   ============================================================================ */

.auth-step {
    animation: fadeIn 0.2s ease;
}

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

.auth-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.auth-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    color: #111827;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.auth-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.auth-input:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

.auth-input::placeholder {
    color: #9ca3af;
}

.auth-code-input {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 8px;
    text-align: center;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
}

.auth-help {
    margin: 8px 0 16px;
    font-size: 12px;
    color: #9ca3af;
}

/* ============================================================================
   AUTH BUTTONS
   ============================================================================ */

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    min-height: 48px;
}

.auth-btn-primary {
    background: #4f46e5;
    color: white;
}

.auth-btn-primary:hover:not(:disabled) {
    background: #4338ca;
}

.auth-btn-primary:disabled {
    background: #a5b4fc;
    cursor: not-allowed;
}

.auth-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.15s;
}

.auth-back-btn:hover {
    color: #374151;
}

.auth-back-btn svg {
    width: 16px;
    height: 16px;
}

/* ============================================================================
   CODE VERIFICATION
   ============================================================================ */

.auth-sent-to {
    margin: 0 0 20px;
    padding: 12px 16px;
    font-size: 14px;
    color: #374151;
    background: #f3f4f6;
    border-radius: 8px;
    text-align: center;
}

.auth-sent-to strong {
    color: #111827;
}

.auth-resend {
    margin-top: 16px;
    text-align: center;
}

.auth-resend-btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #4f46e5;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.15s;
}

.auth-resend-btn:hover {
    color: #4338ca;
    text-decoration: underline;
}

.auth-resend-countdown {
    font-size: 14px;
    color: #9ca3af;
}

/* ============================================================================
   ERROR STATE
   ============================================================================ */

.auth-error {
    margin-bottom: 16px;
    padding: 12px 16px;
    font-size: 14px;
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
}

/* ============================================================================
   DIVIDER
   ============================================================================ */

.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.auth-divider span {
    padding: 0 16px;
    font-size: 14px;
    color: #9ca3af;
    text-transform: uppercase;
}

/* ============================================================================
   TELEGRAM LOGIN
   ============================================================================ */

.auth-telegram {
    text-align: center;
}

#telegram-login-widget {
    display: flex;
    justify-content: center;
    min-height: 48px;
}

.auth-telegram-help {
    margin: 12px 0 0;
    font-size: 12px;
    color: #9ca3af;
}

/* ============================================================================
   LOGIN PAGE LAYOUT
   ============================================================================ */

.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 64px);
    padding: 32px 16px;
    background: linear-gradient(135deg, #f5f3ff 0%, #eff6ff 100%);
}

.login-logo {
    margin-bottom: 32px;
    text-align: center;
}

.login-logo h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    color: #4f46e5;
}

.login-logo p {
    margin: 8px 0 0;
    font-size: 16px;
    color: #6b7280;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 480px) {
    .auth-form {
        padding: 24px 20px;
        margin: 0 16px;
        border-radius: 16px;
    }

    .auth-title {
        font-size: 24px;
    }

    .auth-code-input {
        font-size: 20px;
        letter-spacing: 6px;
    }

    .login-page {
        padding: 24px 0;
    }
}
