/* ================================================================
   E2H TalentOS — Premium Login Page
   Design System: Indigo + Blue + Dark Navy + Glassmorphism
   ================================================================ */

/* ── Design Tokens ─────────────────────────────────────────────── */
:root {
    --bg:              #070C1B;
    --bg-left:         #080E20;
    --bg-card:         rgba(10, 16, 34, 0.92);
    --bg-input:        rgba(255, 255, 255, 0.045);
    --bg-input-focus:  rgba(255, 255, 255, 0.07);

    --primary:         #3B82F6;
    --primary-d:       #2563EB;
    --primary-glow:    rgba(59, 130, 246, 0.28);
    --indigo:          #AC2484;
    --indigo-glow:     rgba(172,36,132, 0.22);
    --amber:           #c552a0;
    --amber-dim:       rgba(245, 166, 35, 0.15);

    --border:          rgba(255, 255, 255, 0.07);
    --border-card:     rgba(255, 255, 255, 0.055);
    --border-input:    rgba(255, 255, 255, 0.10);

    --text:            #F1F5F9;
    --text-sub:        rgba(241, 245, 249, 0.55);
    --text-muted:      rgba(241, 245, 249, 0.35);

    --error:           #EF4444;
    --error-bg:        rgba(239, 68,  68,  0.08);
    --error-border:    rgba(239, 68,  68,  0.25);
    --success:         #10B981;
    --success-bg:      rgba(16,  185, 129, 0.07);
    --success-border:  rgba(16,  185, 129, 0.28);

    --radius-card:     20px;
    --radius-input:    11px;
    --radius-btn:      11px;
    --transition:      0.22s ease;
}

/* ── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Page: Ambient Background ──────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    position: relative;
    isolation: isolate;
}

/* Fixed ambient glow orbs — pure CSS, no JS */
.login-page::before {
    content: '';
    position: fixed;
    top: -20%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59,130,246,.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}
.login-page::after {
    content: '';
    position: fixed;
    bottom: -15%;
    right: -8%;
    width: 50vw;
    height: 50vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(172,36,132,.09) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ── Split Layout ──────────────────────────────────────────────── */
.login-left,
.login-right {
    position: relative;
    z-index: 1;
}

/* ── LEFT PANEL ────────────────────────────────────────────────── */
.login-left {
    flex: 1;
    background:
        radial-gradient(ellipse 80% 60% at 20% 20%, rgba(59,130,246,.14) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(172,36,132,.11) 0%, transparent 55%),
        var(--bg-left);
    border-right: 1px solid var(--border-card);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 44px 48px;
    overflow: hidden;
    isolation: isolate;
}

/* Grid mesh overlay on left panel */
.login-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 46px 46px;
    z-index: -1;
    pointer-events: none;
}

/* ── Brand Mark ────────────────────────────────────────────────── */
.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    text-decoration: none;
    width: fit-content;
}
.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(197,82,160,.25), rgba(197,82,160,.1));
    border: 1px solid rgba(197,82,160,.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 900;
    color: var(--amber);
    letter-spacing: -.01em;
    box-shadow: 0 0 24px rgba(197,82,160,.15), inset 0 1px 0 rgba(255,255,255,.08);
    flex-shrink: 0;
}
.brand-text-name {
    font-size: .95rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: .01em;
    line-height: 1;
}
.brand-text-sub {
    font-size: .68rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: .04em;
    margin-top: 3px;
    text-transform: uppercase;
}

/* ── Left Hero ─────────────────────────────────────────────────── */
.left-hero {
    margin-top: auto;
    margin-bottom: auto;
    padding: 32px 0;
}

.left-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(59,130,246,.1);
    border: 1px solid rgba(59,130,246,.25);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #93c5fd;
    margin-bottom: 18px;
}
.kicker-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #60a5fa;
    box-shadow: 0 0 8px #60a5fa;
    animation: dot-pulse 2.4s ease infinite;
}
@keyframes dot-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .25; }
}

.left-headline {
    font-size: clamp(1.75rem, 2.8vw, 2.4rem);
    font-weight: 900;
    line-height: 1.07;
    color: var(--text);
    letter-spacing: -.035em;
    margin-bottom: 14px;
}
.left-headline em {
    font-style: normal;
    background: linear-gradient(135deg, #60a5fa, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.left-sub {
    color: var(--text-sub);
    font-size: .83rem;
    line-height: 1.7;
    max-width: 380px;
    margin-bottom: 32px;
}

/* ── Feature Pills ─────────────────────────────────────────────── */
.feat-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.feat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.05);
    transition: background var(--transition), border-color var(--transition);
}
.feat-item:hover {
    background: rgba(59,130,246,.06);
    border-color: rgba(59,130,246,.18);
}
.feat-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    flex-shrink: 0;
}
.feat-icon.blue   { background: rgba(59,130,246,.15);  color: #60a5fa; }
.feat-icon.indigo { background: rgba(172,36,132,.15);  color: #a5b4fc; }
.feat-icon.teal   { background: rgba(20,184,166,.12);  color: #2dd4bf; }

.feat-text-main  { font-size: .8rem;  font-weight: 600; color: var(--text);     line-height: 1.3; }
.feat-text-sub   { font-size: .72rem; color: var(--text-muted); margin-top: 1px; }

/* ── Left Footer Stats ─────────────────────────────────────────── */
.left-stats {
    display: flex;
    gap: 20px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.stat-item { flex: 1; }
.stat-val {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.02em;
}
.stat-lbl {
    font-size: .68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 600;
    margin-top: 2px;
}

/* ── RIGHT PANEL ───────────────────────────────────────────────── */
.login-right {
    width: min(100%, 420px);
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-left: 1px solid var(--border-card);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 44px;
}

/* Card slide-up + fade-in on load */
.login-card-inner {
    animation: card-enter .55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes card-enter {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Form Header ───────────────────────────────────────────────── */
.form-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 11px;
    border-radius: 999px;
    background: rgba(59,130,246,.1);
    border: 1px solid rgba(59,130,246,.22);
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #93c5fd;
    margin-bottom: 14px;
}
.eyebrow-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #60a5fa;
}

.form-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.03em;
    line-height: 1.15;
    margin-bottom: 6px;
}
.form-subtitle {
    font-size: .8rem;
    color: var(--text-sub);
    margin-bottom: 28px;
    line-height: 1.55;
}

/* ── Session Status (server messages) ─────────────────────────── */
.server-status {
    padding: 10px 14px;
    border-radius: 9px;
    background: rgba(16,185,129,.08);
    border: 1px solid rgba(16,185,129,.25);
    color: #6ee7b7;
    font-size: .78rem;
    font-weight: 600;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.server-error {
    padding: 10px 14px;
    border-radius: 9px;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: #fca5a5;
    font-size: .78rem;
    font-weight: 600;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Floating Label Fields ─────────────────────────────────────── */
.fl-field {
    margin-bottom: 18px;
    position: relative;
}

.fl-input-wrap {
    position: relative;
}

/* Left icon inside input */
.fl-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    pointer-events: none;
    transition: color var(--transition);
    font-size: 15px;
}
.fl-input-wrap:focus-within .fl-icon {
    color: var(--primary);
}

/* The input */
.fl-input {
    width: 100%;
    background: var(--bg-input);
    border: 1.5px solid var(--border-input);
    border-radius: var(--radius-input);
    padding: 13px 14px 7px 40px;
    font-size: .86rem;
    color: var(--text);
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.fl-input::placeholder { color: transparent; }
.fl-input:focus {
    border-color: var(--primary);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
/* Password input needs right padding for toggle btn */
.fl-input.has-toggle { padding-right: 54px; }

/* Floating label */
.fl-label {
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    font-size: .83rem;
    font-weight: 500;
    color: var(--text-muted);
    pointer-events: none;
    transition: top .18s ease, left .18s ease, font-size .18s ease, color .18s ease, transform .18s ease;
    background: transparent;
    padding: 0 3px;
    white-space: nowrap;
}
/* Floated state — when focused OR has value */
.fl-input:focus         ~ .fl-label,
.fl-input.has-value     ~ .fl-label,
.fl-input:not(:placeholder-shown) ~ .fl-label {
    top: 9px;
    transform: translateY(0);
    font-size: .65rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: .03em;
    left: 40px;
}

/* ── Validation State: Valid ─────────────────────────────────── */
.fl-input.is-valid {
    border-color: var(--success) !important;
    box-shadow: 0 0 0 3px var(--success-bg) !important;
}
.fl-input.is-valid ~ .fl-label { color: var(--success) !important; }
.fl-input-wrap:focus-within .fl-input.is-valid ~ .fl-label { color: var(--success) !important; }

/* ── Validation State: Invalid ────────────────────────────────── */
.fl-input.is-invalid {
    border-color: var(--error) !important;
    box-shadow: 0 0 0 3px var(--error-bg) !important;
}
.fl-input.is-invalid ~ .fl-label { color: var(--error) !important; }

/* ── Error Message ─────────────────────────────────────────────── */
.fl-err-msg {
    display: none;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    padding: 7px 11px;
    border-radius: 8px;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    font-size: .74rem;
    color: #fca5a5;
    font-weight: 500;
    animation: msg-fade-in .18s ease;
}
.fl-err-msg.visible { display: flex; }
.fl-err-msg i { font-size: .78rem; flex-shrink: 0; color: var(--error); }

@keyframes msg-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Server-side error (from Laravel @error) */
.server-field-error {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    padding: 7px 11px;
    border-radius: 8px;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    font-size: .74rem;
    color: #fca5a5;
    font-weight: 500;
}

/* ── CapsLock Warning ─────────────────────────────────────────── */
.caps-warn {
    display: none;
    align-items: center;
    gap: 7px;
    margin-top: 7px;
    padding: 7px 11px;
    border-radius: 8px;
    background: rgba(251,191,36,.07);
    border: 1px solid rgba(251,191,36,.22);
    font-size: .74rem;
    color: #fbbf24;
    font-weight: 600;
}
.caps-warn.visible { display: flex; }

/* ── Password Toggle ───────────────────────────────────────────── */
.pw-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: color var(--transition), background var(--transition);
    display: flex;
    align-items: center;
    font-size: 15px;
    line-height: 1;
}
.pw-toggle:hover { color: var(--primary); background: var(--primary-glow); }

/* ── Remember + Forgot Row ─────────────────────────────────────── */
.form-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    margin-top: -4px;
}

.remember-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.remember-cb {
    width: 15px;
    height: 15px;
    border-radius: 4px;
    border: 1.5px solid var(--border-input);
    background: var(--bg-input);
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}
.remember-label {
    font-size: .78rem;
    color: var(--text-sub);
    cursor: pointer;
    user-select: none;
}

.forgot-link {
    font-size: .78rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition), opacity var(--transition);
    opacity: .85;
}
.forgot-link:hover { opacity: 1; color: #60a5fa; text-decoration: underline; }

/* ── Submit Button ─────────────────────────────────────────────── */
.btn-login {
    width: 100%;
    padding: 13px 20px;
    border: none;
    border-radius: var(--radius-btn);
    background: linear-gradient(135deg, var(--primary-d), var(--indigo));
    color: #fff;
    font-size: .92rem;
    font-weight: 700;
    letter-spacing: .01em;
    font-family: inherit;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    box-shadow: 0 4px 22px var(--primary-glow), 0 1px 0 rgba(255,255,255,.08) inset;
    transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
    margin-bottom: 22px;
}
.btn-login::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.12), transparent 55%);
    pointer-events: none;
}
.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(59,130,246,.45), 0 1px 0 rgba(255,255,255,.08) inset;
}
.btn-login:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 3px 14px var(--primary-glow);
}
.btn-login:disabled {
    opacity: .65;
    cursor: not-allowed;
    transform: none;
}

/* Ripple effect */
.btn-login .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.22);
    transform: scale(0);
    animation: ripple-expand .5s linear;
    pointer-events: none;
}
@keyframes ripple-expand {
    to { transform: scale(4); opacity: 0; }
}

/* Button spinner */
.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .65s linear infinite;
    flex-shrink: 0;
    display: none;
}
.btn-login.loading .btn-spinner { display: inline-block; }
.btn-login.loading .btn-text-arrow { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Divider ───────────────────────────────────────────────────── */
.form-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 18px;
}
.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Security Note ─────────────────────────────────────────────── */
.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: .72rem;
    color: var(--text-muted);
    text-align: center;
}
.security-note i { font-size: .8rem; color: var(--success); }

/* ── Form Footer ───────────────────────────────────────────────── */
.form-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: .7rem;
    color: var(--text-muted);
    line-height: 1.7;
}
.form-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: opacity var(--transition);
    opacity: .85;
}
.form-footer a:hover { opacity: 1; }

/* ── Shake Animation (invalid submit) ──────────────────────────── */
.shake {
    animation: shake .42s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes shake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-5px); }
    40%, 60% { transform: translateX(5px); }
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .login-page { flex-direction: column; }

    .login-left {
        padding: 32px 28px;
        border-right: none;
        border-bottom: 1px solid var(--border-card);
        flex: none;
    }
    .left-hero { padding: 20px 0 0; }
    .left-stats { display: none; }
    .left-headline { font-size: 1.7rem; }

    .login-right {
        width: 100%;
        padding: 40px 28px 44px;
        border-left: none;
    }
    .login-card-inner { max-width: 420px; margin: 0 auto; }
}

@media (max-width: 520px) {
    .login-left  { padding: 24px 20px; }
    .login-right { padding: 32px 20px 40px; }
    .feat-list   { display: none; }
    .left-sub    { display: none; }
    .left-hero   { padding-top: 12px; }
    .form-meta-row { flex-direction: column; align-items: flex-start; gap: 10px; }
}
