/* Shared modern authentication experience for job seekers, employers, and staff. */
:root {
    --auth-canvas: #071c14;
    --auth-canvas-deep: #04130d;
    --auth-surface: #102b20;
    --auth-surface-soft: #15372a;
    --auth-field: #0c241a;
    --auth-ink: #f2f8f4;
    --auth-muted: #b7cabf;
    --auth-line: #315343;
    --auth-accent: #52ca8a;
    --auth-accent-soft: rgba(82, 202, 138, 0.14);
    --auth-action: #159159;
    --auth-action-hover: #21a968;
    --auth-action-text: #ffffff;
    --auth-error: #ffaaa5;
    --auth-error-bg: rgba(190, 48, 40, 0.16);
    --auth-error-line: rgba(255, 117, 111, 0.38);
    --auth-info: #c5d9ff;
    --auth-info-bg: rgba(70, 104, 170, 0.17);
    --auth-info-line: rgba(137, 171, 238, 0.36);
    --auth-success: #91e5b6;
    --auth-success-bg: rgba(21, 145, 89, 0.15);
    --auth-success-line: rgba(82, 202, 138, 0.34);
    --auth-shadow: 0 34px 90px rgba(0, 0, 0, 0.34);
    --auth-focus: 0 0 0 4px rgba(82, 202, 138, 0.22);
}

html[data-theme='light'] {
    --auth-canvas: #f1f7f3;
    --auth-canvas-deep: #e4efe8;
    --auth-surface: #ffffff;
    --auth-surface-soft: #edf6f0;
    --auth-field: #f8fbf9;
    --auth-ink: #14231b;
    --auth-muted: #586a60;
    --auth-line: #cfdfd5;
    --auth-accent: #087443;
    --auth-accent-soft: #e8f6ed;
    --auth-action: #087443;
    --auth-action-hover: #056136;
    --auth-action-text: #ffffff;
    --auth-error: #a52621;
    --auth-error-bg: #fff1f0;
    --auth-error-line: #efc4c1;
    --auth-info: #284f94;
    --auth-info-bg: #f0f5ff;
    --auth-info-line: #cad8f2;
    --auth-success: #08663c;
    --auth-success-bg: #ebf8f0;
    --auth-success-line: #b9dfc9;
    --auth-shadow: 0 34px 90px rgba(20, 52, 34, 0.15);
    --auth-focus: 0 0 0 4px rgba(8, 116, 67, 0.18);
}

body.auth-page--employer {
    --role-accent: #f0c94d;
    --role-accent-soft: rgba(240, 201, 77, 0.15);
    --showcase-start: #102c21;
    --showcase-end: #3f3a16;
}

body.auth-page--jobseeker {
    --role-accent: #71daa0;
    --role-accent-soft: rgba(82, 202, 138, 0.15);
    --showcase-start: #064529;
    --showcase-end: #0b6b40;
}

body.auth-page--admin {
    --role-accent: #f0c94d;
    --role-accent-soft: rgba(240, 201, 77, 0.14);
    --showcase-start: #111e18;
    --showcase-end: #3d3518;
}

html[data-theme='light'] body.auth-page--employer,
html[data-theme='light'] body.auth-page--admin {
    --role-accent: #8a6200;
    --role-accent-soft: #fff5d2;
}

html[data-theme='light'] body.auth-page--jobseeker {
    --role-accent: #087443;
    --role-accent-soft: #e8f6ed;
}

html { min-width: 320px; background: var(--auth-canvas); }

body.auth-page {
    --peso-h1-color: var(--auth-ink);
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    color: var(--auth-ink);
    background:
        radial-gradient(circle at 9% 10%, rgba(82, 202, 138, 0.12), transparent 28rem),
        radial-gradient(circle at 91% 88%, rgba(240, 201, 77, 0.09), transparent 27rem),
        linear-gradient(145deg, var(--auth-canvas-deep), var(--auth-canvas)) !important;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

html[data-theme='light'] body.auth-page {
    background:
        radial-gradient(circle at 8% 10%, rgba(8, 116, 67, 0.11), transparent 29rem),
        radial-gradient(circle at 92% 88%, rgba(214, 165, 20, 0.10), transparent 26rem),
        linear-gradient(145deg, var(--auth-canvas-deep), var(--auth-canvas)) !important;
}

body.auth-page::before,
body.auth-page::after { content: none; }

body.auth-page :is(a, button, input):focus-visible {
    outline: 2px solid var(--auth-accent) !important;
    outline-offset: 3px !important;
    box-shadow: var(--auth-focus);
}

.auth-skip-link {
    position: fixed;
    top: 12px;
    left: 50%;
    z-index: 1300;
    padding: 10px 16px;
    color: #ffffff;
    background: #056136;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
    transform: translate(-50%, -160%);
    transition: transform 160ms ease;
}

.auth-skip-link:focus { transform: translate(-50%, 0); }

.auth-background,
.auth-background span {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.auth-background { overflow: hidden; }

.auth-background::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.12;
    background-image:
        linear-gradient(var(--auth-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--auth-line) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 78%, transparent);
}

.auth-background span:first-child {
    width: 34rem;
    height: 34rem;
    top: -22rem;
    left: -15rem;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(82, 202, 138, 0.24), transparent 68%);
}

.auth-background span:last-child {
    width: 32rem;
    height: 32rem;
    inset: auto -14rem -21rem auto;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(240, 201, 77, 0.18), transparent 68%);
}

.auth-toolbar {
    position: relative;
    z-index: 10;
    width: min(calc(100% - 40px), 1380px);
    min-height: 78px;
    margin-inline: auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
}

.auth-back-link,
.auth-theme-toggle {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--auth-ink);
    background: color-mix(in srgb, var(--auth-surface) 88%, transparent);
    border: 1px solid var(--auth-line);
    border-radius: 999px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    font-size: 0.82rem;
    font-weight: 750;
    text-decoration: none;
    transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.auth-back-link { width: max-content; padding: 0 18px; }
.auth-back-link i { color: var(--auth-accent); transition: transform 180ms ease; }

.auth-back-link:hover,
.auth-theme-toggle:hover {
    color: var(--auth-ink);
    background: var(--auth-surface-soft);
    border-color: var(--auth-accent);
    transform: translateY(-2px);
}

.auth-back-link:hover i { transform: translateX(-3px); }

.auth-toolbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.auth-toolbar-brand img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    background: #ffffff;
    border: 2px solid var(--role-accent);
    border-radius: 999px;
}

.auth-toolbar-brand > span { display: grid; gap: 1px; }
.auth-toolbar-brand strong { color: var(--auth-ink); font-size: 0.84rem; line-height: 1.2; }

.auth-toolbar-brand small {
    color: var(--auth-muted);
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.075em;
    text-transform: uppercase;
}

.auth-theme-toggle {
    position: static;
    justify-self: end;
    width: auto;
    height: 46px;
    padding: 0 17px;
    cursor: pointer;
}

.auth-theme-toggle i { width: 17px; color: var(--role-accent); text-align: center; }

.auth-shell {
    position: relative;
    z-index: 2;
    flex: 1;
    width: min(calc(100% - 40px), 1180px);
    min-width: 0;
    min-height: 650px;
    margin: 18px auto 32px;
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(420px, 0.96fr);
    overflow: hidden;
    background: var(--auth-surface);
    border: 1px solid var(--auth-line);
    border-radius: 32px;
    box-shadow: var(--auth-shadow);
}

html body.peso-product-ui.auth-page main.auth-shell {
    width: min(calc(100% - 40px), 1180px) !important;
    max-width: 1180px !important;
    margin: 18px auto 32px !important;
    padding: 0 !important;
}

.auth-showcase {
    position: relative;
    min-width: 0;
    padding: clamp(38px, 5vw, 66px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    color: #ffffff;
    background:
        radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--role-accent) 26%, transparent), transparent 19rem),
        linear-gradient(145deg, var(--showcase-start), var(--showcase-end));
    isolation: isolate;
}

.auth-showcase::after {
    content: '';
    position: absolute;
    right: -110px;
    bottom: -120px;
    z-index: -1;
    width: 310px;
    height: 310px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 999px;
    box-shadow: 0 0 0 42px rgba(255, 255, 255, 0.035), 0 0 0 84px rgba(255, 255, 255, 0.025);
}

.auth-showcase-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.auth-logo-frame {
    width: 88px;
    height: 88px;
    display: grid;
    place-items: center;
    padding: 4px;
    background: linear-gradient(145deg, var(--role-accent), rgba(255, 255, 255, 0.82));
    border-radius: 999px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
}

.auth-logo-frame img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    background: #ffffff;
    border: 3px solid var(--showcase-start);
    border-radius: 999px;
}

.auth-role-badge {
    max-width: 220px;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.19);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    backdrop-filter: blur(12px);
}

.auth-role-badge i { color: var(--role-accent); }
.auth-showcase-copy { margin-top: clamp(44px, 7vh, 74px); }

.auth-eyebrow,
.auth-kicker {
    margin: 0 0 10px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.auth-eyebrow { color: var(--role-accent); }
.auth-kicker { color: var(--auth-accent); }

html body.peso-product-ui.auth-page .auth-showcase h1 {
    max-width: 600px;
    margin: 0;
    color: #ffffff !important;
    font-size: clamp(2.65rem, 4.3vw, 4.45rem) !important;
    font-weight: 800 !important;
    letter-spacing: -0.055em !important;
    line-height: 1 !important;
    text-shadow: none;
    text-wrap: balance;
}

.auth-showcase-copy > p:last-child {
    max-width: 540px;
    margin: 22px 0 0;
    color: rgba(241, 249, 244, 0.78);
    font-size: 0.98rem;
    line-height: 1.7;
}

.auth-benefits {
    margin: 34px 0 0;
    padding: 0;
    display: grid;
    gap: 12px;
    list-style: none;
}

.auth-benefits li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.82rem;
    font-weight: 650;
}

.auth-benefits i {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--role-accent);
    background: rgba(255, 255, 255, 0.10);
    border-radius: 999px;
    font-size: 0.58rem;
}

.auth-trust-note {
    margin-top: auto;
    padding-top: 38px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.69rem;
    font-weight: 650;
}

.auth-trust-note i { color: var(--role-accent); }

.auth-form-panel {
    min-width: 0;
    padding: clamp(34px, 4.5vw, 60px);
    display: flex;
    align-items: center;
    background: var(--auth-surface);
}

.auth-form-wrap { width: 100%; max-width: 430px; margin-inline: auto; }

.auth-form-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 20px;
    display: grid;
    place-items: center;
    color: var(--role-accent);
    background: var(--role-accent-soft);
    border: 1px solid var(--auth-line);
    border-radius: 15px;
    font-size: 1rem;
}

.auth-form-heading h2 {
    margin: 0;
    color: var(--auth-ink);
    font-size: clamp(1.7rem, 3vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.1;
    text-wrap: balance;
}

.auth-form-heading > p:last-child {
    margin: 10px 0 0;
    color: var(--auth-muted);
    font-size: 0.86rem;
    line-height: 1.55;
}

.auth-message {
    margin-top: 22px;
    padding: 13px 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid;
    border-radius: 13px;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.5;
}

.auth-message > i { flex: 0 0 auto; margin-top: 3px; }
.auth-message a { color: inherit; font-weight: 800; }
.auth-message--error { color: var(--auth-error); background: var(--auth-error-bg); border-color: var(--auth-error-line); }
.auth-message--info { color: var(--auth-info); background: var(--auth-info-bg); border-color: var(--auth-info-line); }
.auth-message--success { color: var(--auth-success); background: var(--auth-success-bg); border-color: var(--auth-success-line); }

.auth-form { margin-top: 28px; display: grid; gap: 20px; }
.auth-field { min-width: 0; }

.auth-field label {
    display: block;
    margin-bottom: 8px;
    color: var(--auth-ink);
    font-size: 0.75rem;
    font-weight: 750;
}

.auth-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.auth-label-row a {
    margin-bottom: 8px;
    color: var(--auth-accent);
    font-size: 0.7rem;
    font-weight: 750;
    text-decoration: none;
}

.auth-label-row a:hover { color: var(--auth-action-hover); text-decoration: underline; }

.auth-input-wrap {
    min-width: 0;
    min-height: 52px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    color: var(--auth-muted);
    background: var(--auth-field);
    border: 1px solid var(--auth-line);
    border-radius: 14px;
    transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.auth-input-wrap:focus-within {
    color: var(--auth-accent);
    background: var(--auth-surface);
    border-color: var(--auth-accent);
    box-shadow: var(--auth-focus);
}

.auth-input-wrap > i { justify-self: center; font-size: 0.86rem; }

.auth-input-wrap input {
    width: 100%;
    min-width: 0;
    height: 50px;
    padding: 0 12px 0 0;
    color: var(--auth-ink);
    background: transparent;
    border: 0;
    outline: 0 !important;
    box-shadow: none !important;
    font-size: 0.86rem;
}

.auth-input-wrap input::placeholder { color: color-mix(in srgb, var(--auth-muted) 72%, transparent); }
.auth-input-wrap.is-invalid { border-color: var(--auth-error); }

.auth-password-toggle {
    width: 44px;
    height: 44px;
    margin-right: 3px;
    display: grid;
    place-items: center;
    color: var(--auth-muted);
    background: transparent;
    border: 0;
    border-radius: 11px;
    cursor: pointer;
}

.auth-password-toggle:hover { color: var(--auth-accent); background: var(--auth-accent-soft); }

.auth-submit {
    width: 100%;
    min-height: 52px;
    margin-top: 4px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--auth-action-text);
    background: linear-gradient(145deg, var(--auth-action), var(--auth-action-hover));
    border: 1px solid var(--auth-action);
    border-radius: 14px;
    box-shadow: 0 12px 26px color-mix(in srgb, var(--auth-action) 28%, transparent);
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.auth-submit:hover {
    color: var(--auth-action-text);
    filter: brightness(1.04);
    box-shadow: 0 16px 32px color-mix(in srgb, var(--auth-action) 34%, transparent);
    transform: translateY(-2px);
}

.auth-submit i { transition: transform 180ms ease; }
.auth-submit:hover i { transform: translateX(4px); }

.auth-secondary-action {
    margin-top: 25px;
    padding-top: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    color: var(--auth-muted);
    border-top: 1px solid var(--auth-line);
    font-size: 0.75rem;
}

.auth-secondary-action a {
    color: var(--auth-accent);
    font-weight: 800;
    text-decoration: none;
}

.auth-secondary-action a:hover { color: var(--auth-action-hover); text-decoration: underline; }

.auth-security-note {
    margin-top: 24px;
    padding: 13px 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--auth-muted);
    background: var(--auth-surface-soft);
    border: 1px solid var(--auth-line);
    border-radius: 13px;
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1.5;
}

.auth-security-note i { margin-top: 3px; color: var(--role-accent); }

.auth-footer {
    position: relative;
    z-index: 2;
    width: min(calc(100% - 40px), 1380px);
    min-height: 56px;
    margin-inline: auto;
    padding: 14px 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    color: var(--auth-muted);
    font-size: 0.68rem;
    font-weight: 650;
}

.auth-footer a { color: var(--auth-accent); font-weight: 750; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

@media (max-width: 920px) {
    .auth-shell {
        max-width: 720px;
        grid-template-columns: minmax(0, 1fr);
    }

    html body.peso-product-ui.auth-page main.auth-shell { max-width: 720px !important; }

    .auth-showcase { padding: 42px; }
    .auth-showcase-copy { margin-top: 38px; }
    .auth-benefits { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
    .auth-benefits li { align-items: flex-start; }
    .auth-trust-note { margin-top: 30px; padding-top: 0; }
    .auth-form-panel { padding: 48px 42px; }
}

@media (max-width: 680px) {
    .auth-toolbar {
        width: min(calc(100% - 28px), 1380px);
        min-height: 74px;
        grid-template-columns: 1fr auto;
    }

    .auth-toolbar-brand { display: none; }

    .auth-shell {
        width: min(calc(100% - 28px), 720px);
        min-height: 0;
        margin: 10px auto 24px;
        border-radius: 24px;
    }

    html body.peso-product-ui.auth-page main.auth-shell {
        width: min(calc(100% - 28px), 720px) !important;
        margin: 10px auto 24px !important;
        padding: 0 !important;
    }

    .auth-form-panel { order: 1; }
    .auth-showcase { order: 2; padding: 34px 28px; }
    .auth-logo-frame { width: 72px; height: 72px; }
    .auth-logo-frame img { width: 64px; height: 64px; }
    .auth-role-badge { font-size: 0.6rem; }
    .auth-showcase-copy { margin-top: 34px; }

    html body.peso-product-ui.auth-page .auth-showcase h1 {
        font-size: clamp(2.25rem, 11vw, 3.2rem) !important;
    }

    .auth-benefits { grid-template-columns: minmax(0, 1fr); }
    .auth-form-panel { padding: 38px 28px; }
    .auth-footer {
        width: min(calc(100% - 28px), 1380px);
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .auth-back-link,
    .auth-theme-toggle { min-height: 44px; padding: 0 14px; }

    .auth-theme-toggle { width: 44px; justify-content: center; }

    .auth-theme-toggle span {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    .auth-showcase-brand { align-items: flex-start; }
    .auth-role-badge { max-width: 160px; white-space: normal; line-height: 1.3; }
    .auth-showcase-copy > p:last-child { font-size: 0.9rem; }
    .auth-form-panel { padding: 34px 22px; }
    .auth-form-heading h2 { font-size: 1.75rem; }
    .auth-label-row { align-items: flex-start; }
    .auth-input-wrap { grid-template-columns: 40px minmax(0, 1fr) auto; }
    .auth-secondary-action { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-back-link,
    .auth-theme-toggle,
    .auth-submit,
    .auth-submit i,
    .auth-password-toggle,
    .auth-input-wrap { transition: none !important; }
}

@media (forced-colors: active) {
    .auth-shell,
    .auth-input-wrap,
    .auth-back-link,
    .auth-theme-toggle,
    .auth-message,
    .auth-security-note { border: 1px solid CanvasText; }
}
