/* ========================================
   SmartHire247 — Auth Page Styles (CORRECTED)
   ======================================== */

/* ── Page shell: header → card → footer column ─────────────── */
.auth-body {
    min-height: 100vh;
    background: var(--grad-hero);
    display: flex;
    flex-direction: column;
    /* FIXED: Changed from unset to proper flex alignment */
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Fix: landing-nav is position:fixed in components.css.
   Override to sticky so it stays in the flex column flow
   and the auth card renders below it instead of beneath the nav. */
.auth-body .landing-nav {
    position: sticky !important;
    top: 0;
    z-index: 200;
}

/* Header / footer placeholders must not shrink in the flex column */
#header-placeholder,
#footer-placeholder {
    flex-shrink: 0;
}

/* Flex grow area that centers the card between header and footer */
.auth-page-content {
    flex: 1;
    display: flex;
    align-items: center;        /* FIXED: Proper centering */
    justify-content: center;      /* FIXED: Proper centering */
    padding: 2rem 1rem;
}

/* Background orbs - OPTIMIZED for performance */
.auth-body::before,
.auth-body::after {
    content: '';
    position: absolute;          /* FIXED: Changed from fixed to absolute */
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.18;
    pointer-events: none;
    will-change: transform;      /* ADDED: Performance optimization */
}

.auth-body::before {
    width: min(500px, 50vw);     /* FIXED: Responsive sizing */
    height: min(500px, 50vw);
    /* EXACT COLOR: hsl(270, 78%, 60%) - Purple */
    background: radial-gradient(circle, hsl(270, 78%, 60%), transparent);
    top: -100px;
    left: -100px;
}

.auth-body::after {
    width: min(400px, 40vw);     /* FIXED: Responsive sizing */
    height: min(400px, 40vw);
    /* EXACT COLOR: hsl(180, 70%, 50%) - Cyan */
    background: radial-gradient(circle, hsl(180, 70%, 50%), transparent);
    bottom: -80px;
    right: -80px;
}

/* ── Main Auth Container ─────────────── */
.auth-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* FIXED: Added reasonable max-width constraint */
    max-width: 1000px;
    width: 100%;
    height: auto;
    /* FIXED: Consistent border radius for both panels */
    border-radius: var(--r-xl);
    overflow: hidden;
    /* ADDED: Subtle shadow for depth */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--clr-border);
    background: var(--clr-bg-2);
}

/* ── Left panel ─────────────── */
.auth-left {
    background: var(--grad-primary);
    padding: var(--sp-3xl) var(--sp-xl);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    /* FIXED: Added border radius for left side */
    border-radius: var(--r-xl) 0 0 var(--r-xl);
}

.auth-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='400' height='400' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='200' cy='200' r='180' fill='none' stroke='rgba(255,255,255,0.08)' stroke-width='60'/%3E%3Ccircle cx='200' cy='200' r='100' fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='40'/%3E%3C/svg%3E") center/cover no-repeat;
}

.auth-left-brand {
    position: relative;
    z-index: 1;
}

.auth-left-logo {
    width: 54px;
    height: 54px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: var(--sp-md);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.auth-left-brand h2 {
    color: #fff;
    /* ADDED: Fluid typography */
    font-size: clamp(1.4rem, 2vw, 1.6rem);
    margin: 0 0 6px;
}

.auth-left-brand p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.88rem;
}

.auth-left-features {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.auth-left-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.87rem;
    font-weight: 500;
}

.auth-left-icon {
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.auth-left-stats {
    display: flex;
    gap: var(--sp-lg);
    position: relative;
    z-index: 1;
}

.auth-left-stat {
    text-align: center;
}

.auth-left-stat-val {
    /* ADDED: Fluid typography */
    font-size: clamp(1.3rem, 2vw, 1.5rem);
    font-weight: 900;
    color: #fff;
    line-height: 1;
}

.auth-left-stat-lbl {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Brand header inside right panel ─────────────── */
.auth-brand-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.auth-brand-header .auth-brand-logo {
    width: 46px;
    height: 46px;
    background: var(--grad-primary);
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 900;
    color: #fff;
    flex-shrink: 0;
    /* EXACT COLOR: Purple shadow */
    box-shadow: 0 4px 16px hsla(270, 78%, 50%, 0.35);
}

.auth-brand-name {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-brand-tag {
    font-size: 0.75rem;
    color: var(--clr-text-muted);
    margin: 2px 0 0;
}

/* ── Stats bar ─────────────── */
.auth-stats-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: var(--clr-bg-3);
    border-radius: var(--r-md);
    padding: 12px 0;
    margin-bottom: 16px;
}

.auth-stat-item {
    flex: 1;
    text-align: center;
}

.auth-stat-num {
    display: block;
    font-size: 1.2rem;
    font-weight: 900;
    /* EXACT COLOR: Light purple */
    color: var(--clr-primary-lt);
    line-height: 1;
}

.auth-stat-lbl {
    display: block;
    font-size: 0.65rem;
    color: var(--clr-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 3px;
}

.auth-stat-sep {
    width: 1px;
    height: 32px;
    background: var(--clr-border);
    flex-shrink: 0;
}

/* ── Feature pills ─────────────── */
.auth-feature-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.auth-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    /* EXACT COLORS: Purple tint */
    background: hsla(270, 78%, 60%, 0.08);
    border: 1px solid hsla(270, 78%, 60%, 0.18);
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--clr-text-muted);
    white-space: nowrap;
}

/* ── Right panel ─────────────── */
.auth-right {
    background: var(--clr-bg-2);
    padding: var(--sp-2xl) var(--sp-xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
    /* FIXED: Removed problematic max-height */
    max-height: none;
    /* FIXED: Consistent border radius for right side */
    border-radius: 0 var(--r-xl) var(--r-xl) 0;
}

.auth-tabs {
    display: flex;
    gap: 4px;
    background: var(--clr-bg-3);
    border-radius: var(--r-md);
    padding: 4px;
    margin-bottom: var(--sp-xl);
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    border-radius: var(--r-sm);
    font-family: var(--font-primary);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--clr-text-muted);
    cursor: pointer;
    transition: all var(--t-fast);
    /* ADDED: Minimum touch target size */
    min-height: 44px;
}

.auth-tab:hover {
    color: var(--clr-text);
}

.auth-tab.active {
    background: var(--clr-bg-2);
    color: var(--clr-text);
    box-shadow: 0 2px 8px hsla(0, 0%, 0%, 0.2);
}

/* ADDED: Focus-visible styles for accessibility */
.auth-tab:focus-visible {
    outline: 2px solid var(--clr-primary);
    outline-offset: 2px;
}

.auth-form-title {
    /* ADDED: Fluid typography */
    font-size: clamp(1.4rem, 3vw, 1.6rem);
    font-weight: 800;
    margin-bottom: 4px;
}

.auth-form-sub {
    color: var(--clr-text-muted);
    font-size: 0.88rem;
    margin-bottom: var(--sp-xl);
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-md);
}

.role-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-sm);
    margin-bottom: var(--sp-sm);
}

.role-option {
    display: none;
}

.role-label {
    border: 1px solid var(--clr-border);
    border-radius: var(--r-md);
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all var(--t-fast);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--clr-text-muted);
    /* ADDED: Minimum touch target & flex centering */
    min-height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ADDED: Focus-visible for role labels */
.role-label:focus-visible {
    outline: 2px solid var(--clr-primary);
    outline-offset: 2px;
}

.role-icon {
    font-size: 1.4rem;
    display: block;
    margin-bottom: 4px;
}

.role-option:checked + .role-label {
    /* EXACT COLORS: Purple selection */
    border-color: var(--clr-primary);
    background: hsla(270, 78%, 60%, 0.1);
    color: var(--clr-primary-lt);
    box-shadow: 0 0 0 3px hsla(270, 78%, 60%, 0.12);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
    font-size: 0.78rem;
    color: var(--clr-text-dim);
    margin: var(--sp-lg) 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--clr-border);
}

.auth-footer {
    text-align: center;
    margin-top: var(--sp-lg);
    font-size: 0.85rem;
    color: var(--clr-text-muted);
}

/* ── Form Inputs ─────────────── */
.input-icon-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--clr-text-dim);
    font-size: 0.9rem;
    pointer-events: none;
}

.input-icon-wrap .form-control {
    padding-left: 38px;
    /* ADDED: Better input styling */
    width: 100%;
    min-height: 44px;  /* ADDED: Touch target size */
    border: 1px solid var(--clr-border);
    border-radius: var(--r-md);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

/* ADDED: Focus styles for inputs - purple glow */
.input-icon-wrap .form-control:focus {
    outline: none;
    border-color: var(--clr-primary);
    box-shadow: 0 0 0 3px hsla(270, 78%, 60%, 0.15);
}

.input-toggle-pw {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--clr-text-dim);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px;
    /* ADDED: Minimum touch target */
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-toggle-pw:hover {
    color: var(--clr-text);
}

/* ADDED: Focus-visible for toggle button */
.input-toggle-pw:focus-visible {
    outline: 2px solid var(--clr-primary);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

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

/* ── Tablet breakpoint (768px - 1023px) ─────────────── */
@media (max-width: 1023px) and (min-width: 769px) {
    .auth-split {
        max-width: 720px;
    }
    
    .auth-left {
        padding: var(--sp-2xl) var(--sp-lg);
    }
    
    .auth-right {
        padding: var(--sp-xl) var(--sp-lg);
    }
    
    .auth-left-logo {
        width: 48px;
        height: 48px;
    }
}

/* ── Mobile breakpoint (up to 768px) ─────────────── */
@media (max-width: 768px) {
    .auth-page-content {
        padding: 1rem;
        align-items: flex-start;  /* Better mobile scrolling */
    }
    
    .auth-split {
        grid-template-columns: 1fr;
        max-width: 420px;         /* FIXED: Phone-friendly width */
        border-radius: var(--r-xl);
    }
    
    .auth-left {
        display: none;
    }
    
    .auth-right {
        border-radius: var(--r-xl);  /* Full rounding when solo */
        padding: var(--sp-xl) var(--sp-lg);
        max-height: none;         /* FIXED: Remove constrained height */
    }
    
    /* Show mobile-only elements */
    .auth-brand-header,
    .auth-stats-bar,
    .auth-feature-pills {
        display: flex;
    }
    
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
    
    .role-selector {
        grid-template-columns: 1fr;  /* Stack roles on small screens */
    }
    
    .role-label {
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        padding: 12px 16px;
    }
    
    .role-icon {
        margin-bottom: 0;
    }
}

/* ── Small mobile (up to 520px) ─────────────── */
@media (max-width: 520px) {
    .auth-page-content {
        padding: 0.5rem;
    }
    
    .auth-right {
        padding: var(--sp-lg) var(--sp-md);
    }
    
    .auth-tabs {
        flex-direction: column;
        gap: 2px;
    }
    
    .auth-tab {
        width: 100%;
    }
    
    .auth-feature-pills {
        justify-content: center;
    }
    
    .auth-pill {
        font-size: 0.7rem;
        padding: 4px 10px;
    }
}

/* ── Desktop (769px and up) ─────────────── */
@media (min-width: 769px) {
    .auth-brand-header,
    .auth-stats-bar,
    .auth-feature-pills,
    .auth-right .auth-divider:first-of-type {
        display: none;
    }
}

/* ========================================
   ACCESSIBILITY ENHANCEMENTS
   ======================================== */

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .auth-tab,
    .role-label,
    .input-icon-wrap .form-control,
    .input-toggle-pw {
        transition: none;
    }
    
    .auth-body::before,
    .auth-body::after {
        display: none;  /* Remove animated/gradient backgrounds */
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .auth-split {
        border: 2px solid currentColor;
    }
    
    .role-label {
        border-width: 2px;
    }
    
    .input-icon-wrap .form-control {
        border-width: 2px;
    }
}