/* ============================================
   AUTH PAGES - LOGIN, SIGNUP, FORGOT PASSWORD
   Custom styles that extend navion.css
   ============================================ */

/* ===== AUTH SECTION LAYOUT ===== */
.auth-section {
    padding: calc(80px + var(--space-3xl)) 0 var(--space-3xl);
    min-height: calc(100vh - 200px);
    background-color: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.auth-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(249, 115, 22, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4xl);
    max-width: 1200px;
    margin: 0 auto;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* ===== AUTH INFO (Left Side) ===== */
.auth-info {
    padding: var(--space-xl);
}

.auth-info-content {
    max-width: 500px;
}

.auth-info h1 {
    font-size: var(--font-size-5xl);
    line-height: 1.1;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.auth-subtitle {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
    line-height: var(--line-height-relaxed);
}

.auth-benefits {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.auth-benefit {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.auth-benefit-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2) 0%, rgba(249, 115, 22, 0.2) 100%);
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    flex-shrink: 0;
    border: 1px solid rgba(124, 58, 237, 0.3);
}

.auth-benefit-check {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.4);
}

.auth-benefit h4 {
    font-size: var(--font-size-base);
    color: var(--text-primary);
    margin: 0 0 var(--space-xs);
    font-weight: var(--font-weight-semibold);
}

.auth-benefit p {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 0;
}

/* ===== TESTIMONIAL QUOTE ===== */
.testimonial-quote {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, rgba(249, 115, 22, 0.05) 100%);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: var(--border-radius-xl);
    padding: var(--space-xl);
    margin-top: var(--space-2xl);
    position: relative;
}

.testimonial-quote::before {
    content: '"';
    position: absolute;
    top: -20px;
    left: 20px;
    font-size: 5rem;
    color: var(--primary-color);
    opacity: 0.3;
    font-family: Georgia, serif;
    line-height: 1;
}

.testimonial-quote p {
    color: var(--text-primary);
    font-style: italic;
    margin: 0 0 var(--space-md);
    line-height: 1.6;
}

.testimonial-quote .testimonial-author {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: 0;
}

.author-avatar-sm {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-sm);
    flex-shrink: 0;
}

.testimonial-author strong {
    display: block;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

.testimonial-author span {
    display: block;
    color: var(--text-muted);
    font-size: var(--font-size-xs);
}

/* ===== AUTH FORM WRAPPER (Right Side) ===== */
.auth-form-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ═══════════════════════════════════════════════════════════════
   AUTH FORM CONTAINER - FIXED: Gradient border matches shape
   ═══════════════════════════════════════════════════════════════ */
.auth-form-container {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius-xl);
    padding: var(--space-3xl);
    width: 100%;
    max-width: 480px;
    box-shadow: 0 0 40px rgba(124, 58, 237, 0.15);
    position: relative;
}

/* FIXED: Full gradient border that matches container shape */
.auth-form-container::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px; /* Border thickness */
    background: linear-gradient(135deg, 
        var(--primary-color) 0%, 
        var(--secondary-color) 50%, 
        var(--primary-color) 100%
    );
    border-radius: var(--border-radius-xl);
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Ensure content is above the border */
.auth-form-container > * {
    position: relative;
    z-index: 1;
}

/* ===== SINGLE CONTAINER (For Forgot Password) ===== */
.auth-section-single .auth-single-container {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
}

.auth-section-single .auth-form-container {
    max-width: 100%;
}

/* ===== AUTH FORM HEADER ===== */
.auth-form-header {
    margin-bottom: var(--space-2xl);
}

.auth-form-header.text-center {
    text-align: center;
}

.auth-form-header h2 {
    font-size: var(--font-size-3xl);
    color: var(--text-primary);
    margin: 0 0 var(--space-sm);
}

.auth-form-header p {
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    margin: 0;
}

.reset-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    margin: 0 auto var(--space-lg);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.4);
}

/* ===== AUTH FORM ===== */
.auth-form .form-group {
    margin-bottom: var(--space-lg);
}

.label-with-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.forgot-link {
    font-size: var(--font-size-sm);
    color: var(--primary-light);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.forgot-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* ===== INPUT WITH ICON ===== */
.input-with-icon {
    position: relative;
}

.input-with-icon .input-icon {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}

.input-with-icon input,
.input-with-icon select {
    padding-left: calc(var(--space-md) + 30px);
}

.password-toggle {
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
}

.password-toggle:hover {
    color: var(--primary-light);
}

/* ===== PASSWORD STRENGTH INDICATOR ===== */
.password-strength {
    margin-top: var(--space-sm);
}

.strength-bar {
    height: 4px;
    background-color: var(--bg-tertiary);
    border-radius: var(--border-radius-full);
    overflow: hidden;
    margin-bottom: var(--space-xs);
}

.strength-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 50%, #10b981 100%);
    border-radius: var(--border-radius-full);
    transition: width 0.3s ease;
}

.strength-text {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.strength-text.weak { color: #ef4444; }
.strength-text.medium { color: #f59e0b; }
.strength-text.strong { color: #10b981; }

/* ═══════════════════════════════════════════════════════════════
   CHECKBOX - GUARANTEED FIX WITH HIGHER SPECIFICITY
   ═══════════════════════════════════════════════════════════════ */

/* Reset form-group behavior for checkbox groups */
.auth-form .form-group:has(> .checkbox-label) {
    display: block;
}

/* Main checkbox label container */
.auth-form .checkbox-label,
.auth-form label.checkbox-label {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    line-height: 1.5;
    width: 100%;
    user-select: none;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

/* Multi-line checkbox (Terms of Service style) */
.auth-form .checkbox-label.multi-line,
.auth-form label.checkbox-label.multi-line {
    align-items: flex-start !important;
}

.auth-form .checkbox-label.multi-line .checkbox-custom {
    margin-top: 2px;
}

/* Hide native checkbox */
.auth-form .checkbox-label input[type="checkbox"] {
    display: none !important;
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Custom checkbox styling */
.auth-form .checkbox-label .checkbox-custom {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
    min-height: 20px !important;
    max-height: 20px !important;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background-color: var(--bg-tertiary);
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    transition: all var(--transition-fast);
    position: relative;
    vertical-align: middle;
    box-sizing: border-box;
}

/* Checkbox when checked */
.auth-form .checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
    border-color: var(--primary-color) !important;
}

/* Checkmark */
.auth-form .checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '' !important;
    position: absolute !important;
    left: 5px !important;
    top: 1px !important;
    width: 6px !important;
    height: 12px !important;
    border: solid white !important;
    border-width: 0 2px 2px 0 !important;
    transform: rotate(45deg) !important;
}

/* Text next to checkbox */
.auth-form .checkbox-label > span:not(.checkbox-custom) {
    display: inline-block !important;
    flex: 1 !important;
    line-height: 1.5 !important;
    word-wrap: break-word;
    color: var(--text-primary);
    font-weight: var(--font-weight-medium);
    margin: 0 !important;
    padding: 0 !important;
}

/* Links inside checkbox label */
.auth-form .checkbox-label a {
    color: var(--primary-light) !important;
    text-decoration: none !important;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.auth-form .checkbox-label a:hover {
    text-decoration: underline !important;
    color: var(--secondary-color) !important;
}

/* Extra spacing between elements */
.auth-form .form-group + .btn-primary,
.auth-form .btn-primary + .auth-switch {
    margin-top: var(--space-xl);
}

.auth-form .btn-primary.btn-large.btn-full {
    margin-top: var(--space-lg);
    margin-bottom: var(--space-lg);
}

/* Signup form: better spacing for Continue button and Sign in link */
.form-step .btn-primary + .auth-switch {
    margin-top: 24px !important;
    padding-top: var(--space-md);
}

/* ═══════════════════════════════════════════════════════════════
   FORM SPACING FIXES
   ═══════════════════════════════════════════════════════════════ */

/* Add more space between button and "already have account" text */
.auth-form .btn-primary + .auth-switch,
.auth-form .btn-primary + p.auth-switch {
    margin-top: var(--space-xl); /* More breathing room */
}

/* Signup form specific: space before terms checkbox */
.form-step .form-group:has(.checkbox-label) {
    margin-top: var(--space-lg);
    margin-bottom: var(--space-xl);
}

/* Extra space after "Continue" button in signup step 1 */
.form-step .btn-primary.btn-full {
    margin-bottom: var(--space-md);
}

/* FIXED: Text wraps properly next to checkbox */
.checkbox-label > span:not(.checkbox-custom) {
    flex: 1;
    display: inline;
    line-height: 1.6;
    word-wrap: break-word;
}

.checkbox-label a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    cursor: pointer;
}

.checkbox-label a:hover {
    text-decoration: underline;
    color: var(--secondary-color);
}

/* ===== AUTH DIVIDER ===== */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: var(--space-lg) 0;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border-color);
}

.auth-divider span {
    padding: 0 var(--space-md);
    background-color: var(--bg-secondary);
}

/* ===== AUTH SWITCH ===== */
.auth-switch {
    text-align: center;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin: 0;
}

.auth-switch a {
    color: var(--primary-light);
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.auth-switch a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* ===== TRUST INDICATORS ===== */
.trust-indicators {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
}

.trust-item-small {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--text-muted);
    font-size: var(--font-size-xs);
}

.trust-item-small svg {
    color: var(--primary-light);
    flex-shrink: 0;
}

/* ===== SIGNUP PROGRESS ===== */
.signup-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-2xl);
    gap: var(--space-sm);
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    opacity: 0.5;
    transition: opacity var(--transition-base);
}

.progress-step.active,
.progress-step.completed {
    opacity: 1;
}

.progress-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-weight-bold);
    color: var(--text-muted);
    transition: all var(--transition-base);
}

.progress-step.active .progress-circle {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-color: var(--primary-color);
    color: var(--white);
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.5);
}

.progress-step.completed .progress-circle {
    background-color: #10b981;
    border-color: #10b981;
    color: var(--white);
}

.progress-step span {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
}

.progress-line {
    width: 60px;
    height: 2px;
    background-color: var(--border-color);
    transition: background-color var(--transition-base);
}

.progress-line.active {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

/* ===== FORM STEP TRANSITIONS ===== */
.form-step {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.form-step.active {
    display: block;
}

/* ===== FORM ACTIONS ===== */
.form-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.form-actions .btn {
    flex: 1;
}

/* ===== SUCCESS MESSAGE ===== */
.success-message {
    text-align: center;
    padding: var(--space-xl) 0;
}

.success-message .success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    margin: 0 auto var(--space-xl);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.4);
}

.success-message h3 {
    font-size: var(--font-size-2xl);
    color: var(--text-primary);
    margin: 0 0 var(--space-md);
}

.success-message p {
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
    line-height: var(--line-height-relaxed);
}

.success-actions {
    display: flex;
    justify-content: center;
    margin-top: var(--space-xl);
}

/* ===== RESET SUCCESS ===== */
.reset-success {
    text-align: center;
    padding: var(--space-xl);
    background-color: var(--bg-tertiary);
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.success-icon-small {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    margin: 0 auto var(--space-md);
}

.reset-success h3 {
    color: var(--text-primary);
    margin: 0 0 var(--space-sm);
}

.reset-success p {
    color: var(--text-secondary);
    margin: 0 0 var(--space-sm);
}

.reset-success .small {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.reset-success a {
    color: var(--primary-light);
    text-decoration: underline;
}

/* ===== ERROR STATES ===== */
.form-group.error input,
.form-group.error select {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.error-message {
    color: #ef4444;
    font-size: var(--font-size-xs);
    margin-top: var(--space-xs);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .auth-container {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
        max-width: 500px;
    }
    
    .auth-info {
        text-align: center;
        padding: 0;
    }
    
    .auth-benefit {
        text-align: left;
    }
    
    .auth-info h1 {
        font-size: var(--font-size-4xl);
    }
    
    .testimonial-quote {
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 640px) {
    .auth-section {
        padding-top: calc(80px + var(--space-2xl));
    }
    
    .auth-form-container {
        padding: var(--space-xl);
    }
    
    .auth-info h1 {
        font-size: var(--font-size-3xl);
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    .signup-progress {
        gap: var(--space-xs);
    }
    
    .progress-line {
        width: 30px;
    }
    
    .progress-step span {
        display: none;
    }
    
    .trust-indicators {
        flex-direction: column;
        gap: var(--space-sm);
        align-items: center;
    }
}