/* =========================================
   JOIN-US.CSS (Updated with Auth Redirects)
   ========================================= */

.auth-container { 
    display: flex; 
    height: 100vh; /* Changed from min-height to fixed height */
    width: 100%; 
    overflow: hidden; /* Prevents the whole page from scrolling */
}

/* --- VISUAL SIDE --- */
.auth-visual {
    flex: 0 0 35%;
    height: 100%;
    position: relative;
    background-image: url('https://images.unsplash.com/photo-1511632765486-a01980e01a18?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: white;
}

.auth-visual::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(11, 17, 32, 0.9) 0%, rgba(37, 99, 235, 0.4) 100%);
}

.visual-content { position: relative; z-index: 2; max-width: 450px; }
.auth-logo { display: flex; align-items: center; gap: 8px; color: white; text-decoration: none; font-weight: 800; font-size: 24px; margin-bottom: 40px; }
.auth-logo i { color: #60A5FA; }
.visual-content h1 { font-size: 42px; margin-bottom: 20px; letter-spacing: -0.02em; }
.visual-content p { color: #CBD5E1; font-size: 17px; line-height: 1.6; }

/* --- FORM SIDE --- */
.auth-form-side {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    padding: 60px 40px;
    background: var(--bg-surface);
}

/* New style for the group headers to make them look clean */
.form-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 24px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}
.form-section-title:first-child {
    margin-top: 0;
}

.form-wrapper { width: 100%; max-width: 600px; }
.form-header { margin-bottom: 32px; }

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 8px;
}

.form-header h2 { font-size: 28px; color: var(--text-main); margin-bottom: 0; }

.already-registered {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
}

.already-registered a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 700;
}

.form-header p { color: var(--text-muted); font-size: 15px; }

/* Form Grid */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.full-width { grid-column: span 2; }

textarea {
    width: 100%; padding: 14px;
    border: none; outline: none;
    font-family: inherit; resize: none;
    background: transparent;
}

.input-group label { display: block; font-size: 13px; font-weight: 700; color: var(--text-main); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.02em; }

.input-field {
    display: flex; align-items: center;
    background: white; border: 1px solid var(--border-light);
    border-radius: 12px; padding: 0 16px;
    transition: all 0.2s ease;
}

.input-field:focus-within { border-color: var(--accent-primary); box-shadow: 0 0 0 4px var(--accent-glow); }
.input-field i { width: 18px; color: var(--text-muted); }
.input-field input, .input-field select { width: 100%; padding: 14px; border: none; outline: none; font-family: inherit; font-size: 15px; background: transparent; }

/* Chips */
.chip-container { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 5px; }
.chip input { display: none; }
.chip span {
    display: inline-block; padding: 6px 14px;
    background: white; border: 1px solid var(--border-light);
    border-radius: 20px; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: 0.2s;
}

.chip input:checked + span { background: var(--accent-primary); color: white; border-color: var(--accent-primary); }

.auth-btn { width: 100%; justify-content: center; padding: 18px; margin-top: 30px; font-size: 16px; }

/* Mobile Redirect Hint */
.mobile-login-hint {
    display: none; /* Hidden on desktop */
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
}

.mobile-login-hint a { color: var(--accent-primary); text-decoration: none; font-weight: 700; }

/* Password Toggle */
.input-password-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    flex-shrink: 0;
}

.input-password-toggle:hover {
    color: var(--text-main);
}

/* Auth Alerts */
.auth-alert {
    display: none;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 24px;
    animation: alertSlideIn 0.25s ease-out forwards;
}

@keyframes alertSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-alert.visible {
    display: flex;
}

.auth-alert-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
}
.auth-alert-error i {
    color: #DC2626;
    flex-shrink: 0;
    margin-top: 2px;
}

.auth-alert-success {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    color: #166534;
}
.auth-alert-success i {
    color: #16A34A;
    flex-shrink: 0;
    margin-top: 2px;
}

[data-theme="dark"] .auth-alert-error {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
    color: #FCA5A5;
}

[data-theme="dark"] .auth-alert-success {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.35);
    color: #86EFAC;
}

[data-theme="dark"] .input-field {
    background: var(--surface);
    border-color: var(--border);
}

[data-theme="dark"] .chip span {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-main);
}

/* =========================================
   LIVE INPUT FEEDBACK & VALIDATION
   ========================================= */
.field-live-feedback {
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
    min-height: 18px;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.field-live-feedback.is-valid {
    color: #16A34A;
}

.field-live-feedback.is-invalid {
    color: #DC2626;
}

.field-live-feedback.is-neutral {
    color: var(--text-muted);
}

[data-theme="dark"] .field-live-feedback.is-valid {
    color: #4ADE80;
}

[data-theme="dark"] .field-live-feedback.is-invalid {
    color: #F87171;
}

.input-field.is-valid {
    border-color: #22C55E !important;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.2);
}

.input-field.is-invalid {
    border-color: #EF4444 !important;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2);
}

/* Label hints */
.label-hint {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-left: 4px;
}

/* Occupation Requirement Status Badge */
.occupation-requirement-badge {
    grid-column: span 2;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 4px;
    margin-bottom: 2px;
    transition: all 0.25s ease;
    background: rgba(100, 116, 139, 0.08);
    border: 1px dashed var(--border);
    color: var(--text-muted);
}

.occupation-requirement-badge i {
    flex-shrink: 0;
}

.occupation-requirement-badge.is-satisfied {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #15803D;
}

[data-theme="dark"] .occupation-requirement-badge.is-satisfied {
    color: #86EFAC;
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.4);
}

/* Password Strength Meter */
.password-strength-container {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.strength-bars {
    display: flex;
    gap: 5px;
    height: 4px;
    width: 100%;
}

.strength-bar {
    flex: 1;
    height: 100%;
    background: var(--border);
    border-radius: 2px;
    transition: background-color 0.25s ease;
}

.strength-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.strength-text span {
    font-weight: 700;
}

/* Strength levels */
.password-strength-container.strength-weak #strength-bar-1 {
    background: #EF4444;
}
.password-strength-container.strength-weak .strength-text span {
    color: #DC2626;
}

.password-strength-container.strength-medium #strength-bar-1,
.password-strength-container.strength-medium #strength-bar-2 {
    background: #F59E0B;
}
.password-strength-container.strength-medium .strength-text span {
    color: #D97706;
}

.password-strength-container.strength-strong #strength-bar-1,
.password-strength-container.strength-strong #strength-bar-2,
.password-strength-container.strength-strong #strength-bar-3 {
    background: #10B981;
}
.password-strength-container.strength-strong .strength-text span {
    color: #059669;
}

[data-theme="dark"] .password-strength-container.strength-weak .strength-text span { color: #F87171; }
[data-theme="dark"] .password-strength-container.strength-medium .strength-text span { color: #FBBF24; }
[data-theme="dark"] .password-strength-container.strength-strong .strength-text span { color: #34D399; }

/* Smooth invalid field highlight animation */
.input-field.field-error-pulse {
    animation: errorPulse 0.45s ease-in-out;
}

@keyframes errorPulse {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

@media (max-width: 1024px) {
    .auth-visual { display: none; }
    .form-grid { grid-template-columns: 1fr; }
    .full-width { grid-column: span 1; }
    .occupation-requirement-badge { grid-column: span 1; }
    .header-top { flex-direction: column; align-items: flex-start; }
    .already-registered { display: none; } /* Hide top link on mobile */
    .mobile-login-hint { display: block; } /* Show bottom link on mobile */
}