/* ================================================================
    SPOON REDESIGN - AUTHENTICATION STYLESHEET
    Version: 1.1 (Floating Label Update)
   ================================================================ */

/* ====================
   1. IMPORT DESIGN SYSTEM
   ==================== */
@import url('menu.css');


/* ====================
   2. AUTH PAGE LAYOUT
   (No changes here)
   ==================== */
.app-container.auth-container {
    display: flex;
    flex-direction: column;
}

/**
 * AUTH HEADER
 * Minimal header for authentication pages (login, signup, OTP)
 * Matches cart-header pattern for consistency
 */
.auth-header {
    padding: var(--spacing-sm) var(--spacing-md);
    flex-shrink: 0;
    height: 52px;
    display: flex;
    align-items: center;
}

/**
 * AUTH BACK BUTTON
 * Consistent with cart-header back button styling
 * Touch-friendly 44x44px tap area
 */
.auth-header__back-btn {
    font-size: 18px;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.auth-header__back-btn:hover {
    background-color: var(--background-light);
}

.auth-header__back-btn:active {
    transform: scale(0.92);
}

.auth-main {
    padding: 0 var(--spacing-lg);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding-top: var(--spacing-md);
}

.auth-title-block {
    margin: var(--spacing-lg) 0 var(--spacing-xl);
}

.auth-title {
    font-size: clamp(24px, 5vw, 28px);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.auth-subtitle {
    font-size: clamp(14px, 3vw, 15px);
    color: #888;
    font-weight: 400;
    line-height: 1.5;
}


/* ====================
   3. FORM & INPUT STYLES
   ==================== */
.auth-form {
    margin-top: auto;
    padding-bottom: var(--spacing-xl);
}

/* --- General Input Group --- */
.input-group {
    position: relative;
    margin-bottom: var(--spacing-lg);
}

.input-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    display: block;
}

.auth-input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-medium);
    padding: 14px;
    font-size: 16px;
    font-family: var(--font-family-main);
    outline: none;
    transition: all 0.2s ease;
}

.auth-input:focus {
    border-color: var(--brand-primary);
}

/**
 * ERROR STATE FOR INPUTS
 * 
 * PURPOSE: Provide visual feedback when input validation fails
 * 
 * FEATURES:
 * - Red border to indicate error
 * - Light red background
 * - Clean, modern appearance
 * - Smooth transition
 * 
 * USAGE:
 * JavaScript adds/removes 'error' class based on validation
 */
.auth-input.error {
    border-color: var(--error-red, #c0392b);
    background-color: rgba(192, 57, 43, 0.05);
}

.auth-input.error:focus {
    border-color: var(--error-red, #c0392b);
}

/**
 * SUCCESS STATE FOR INPUTS
 * 
 * PURPOSE: Provide positive visual feedback when input is valid
 * 
 * FEATURES:
 * - Green border to indicate success
 * - Light green background
 * - Clean, modern appearance
 * - Encourages correct input
 * 
 * USAGE:
 * JavaScript adds 'success' class when validation passes
 */
.auth-input.success {
    border-color: var(--success-green, #27ae60);
    background-color: rgba(39, 174, 96, 0.05);
}

.auth-input.success:focus {
    border-color: var(--success-green, #27ae60);
}

.input-error-message {
    color: var(--error-red, #c0392b);
    font-size: 12px;
    font-weight: 500;
    margin-top: var(--spacing-sm);
    min-height: 1em;
}

.input-helper-text {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: var(--spacing-sm);
}

/* Read-only input styling */
.auth-input[readonly] {
    background-color: var(--background-light, #f5f5f5);
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* --- Phone Input Specific --- */
.phone-input-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-medium);
    overflow: hidden;
    /* Important for label positioning */
    transition: all 0.2s ease;
    margin-bottom: var(--spacing-lg);
    position: relative;
    /* ✅ UPDATED: Added for label context */
}

.phone-input-group:focus-within {
    border-color: var(--brand-primary);
}

.country-code {
    padding: 14px var(--spacing-md);
    background-color: var(--background-light);
    border-right: 1px solid var(--border-color);
    font-weight: 500;
    color: var(--text-secondary);
    z-index: 2;
    /* Keep it above floating label background */
}

/* Phone Input */
.phone-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px;
    font-size: 16px;
    background-color: transparent;
}

.phone-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}


/* --- OTP Input & Resend Timer --- */
/**
 * OTP INPUT CONTAINER
 * Modern, clean layout with proper spacing
 */
.otp-input-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: var(--spacing-xl) 0;
}

/**
 * OTP INPUT FIELDS
 * Premium design with subtle borders and smooth transitions
 */
.otp-input {
    width: 56px;
    height: 64px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    background-color: #f5f5f5;
    border: 1px solid transparent;
    border-radius: 12px;
    outline: none;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.otp-input:focus {
    background-color: var(--background-white);
    border-color: var(--brand-primary);
    box-shadow: 0 2px 8px rgba(235, 23, 0, 0.12);
    transform: scale(1.02);
}

/**
 * RESEND TIMER CONTAINER
 * Clean, centered layout with subtle styling
 */
.resend-timer-container {
    text-align: center;
    color: #888;
    font-size: 14px;
    margin-top: var(--spacing-xl);
    line-height: 1.6;
}

/**
 * RESEND LINK
 * Brand-colored link with clear disabled state
 */
.resend-link {
    color: var(--brand-primary);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-left: 4px;
}

.resend-link:hover:not(.disabled) {
    text-decoration: underline;
}

.resend-link.disabled {
    color: #aaa;
    cursor: not-allowed;
    text-decoration: none;
}

#otp-timer {
    color: #999;
    font-weight: 500;
    margin-left: 4px;
}


/* ====================
   4. BUTTONS (No changes here)
   ==================== */
.btn--full-width {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: -0.2px;
}

.btn--primary {
    background-color: var(--brand-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(235, 23, 0, 0.15);
}

.btn--primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(235, 23, 0, 0.25);
}

.btn--primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn--primary:disabled {
    background-color: #e8e8e8;
    color: #aaa;
    cursor: not-allowed;
    box-shadow: none;
}


/* --- Email Input Specific --- */
.email-input-group {
    display: flex;
    align-items: center;
    background-color: #f5f5f5;
    border: 1px solid transparent;
    border-radius: 999px;
    overflow: hidden;
    transition: all 0.2s ease;
    margin-bottom: var(--spacing-sm);
    position: relative;
    height: 48px;
}

.email-input-group:focus-within {
    background-color: var(--background-white);
    border-color: #e8e8e8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.email-input-group.error {
    border-color: var(--error-red, #c0392b);
    background-color: rgba(192, 57, 43, 0.04);
}

.email-input-group.success {
    border-color: var(--success-green, #27ae60);
    background-color: rgba(39, 174, 96, 0.04);
}

.email-icon {
    padding-left: 18px;
    padding-right: 10px;
    color: #aaa;
    font-size: 15px;
    transition: color 0.2s ease;
}

.email-input-group:focus-within .email-icon {
    color: var(--brand-primary);
}

.email-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0 18px 0 0;
    font-size: 15px;
    background-color: transparent;
    color: var(--text-primary);
    font-weight: 400;
    height: 100%;
}

.email-input::placeholder {
    color: #aaa;
    opacity: 1;
    font-weight: 400;
}

.input-hint {
    font-size: 13px;
    color: #999;
    margin-bottom: var(--spacing-xl);
    min-height: 18px;
    font-weight: 400;
}

.input-hint.error {
    color: var(--error-red, #c0392b);
    font-weight: 500;
}

.input-hint.success {
    color: var(--success-green, #27ae60);
    font-weight: 500;
}

/* Loading state for button */
.btn--primary.loading {
    position: relative;
    color: transparent;
}

.btn--primary.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

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