/*
 * DFK-GLF guest screens.
 * Buttons use darker brand variants so white text meets WCAG AA:
 * #6EAD3B on white is 2.73:1; #238FE8 on white is 3.41:1.
 * --dfk-muted is darker than the suggested #64748B (4.44:1 on #F5F8F3).
 */

:root {
    --dfk-green: #6EAD3B;
    --dfk-green-dark: #315C2D;
    --dfk-green-action: #3C6B27;
    --dfk-green-action-hover: #315C2D;
    --dfk-blue: #238FE8;
    --dfk-blue-dark: #0F5FA3;
    --dfk-blue-action: #1568B0;
    --dfk-blue-action-hover: #0F5FA3;
    --dfk-background: #F5F8F3;
    --dfk-surface: #FFFFFF;
    --dfk-text: #172B22;
    --dfk-muted: #5A6878;
    --dfk-border: #D7E0D6;
    --dfk-danger: #B42318;
    --dfk-danger-bg: #FEF3F2;
    --dfk-radius: 20px;
    --dfk-radius-control: 12px;
    --dfk-shadow: 0 16px 40px rgba(23, 43, 34, 0.08);
    --dfk-shadow-hover: 0 22px 48px rgba(23, 43, 34, 0.14);
    --dfk-font: "Inter", "Segoe UI", system-ui, sans-serif;
    --accent: var(--dfk-green);
    --accent-action: var(--dfk-green-action);
    --accent-action-hover: var(--dfk-green-action-hover);
    --accent-soft: rgba(110, 173, 59, 0.14);
    --focus: var(--dfk-green-dark);
    --panel-a: #347248;
    --panel-b: #1C4632;
    --panel-c: #12281C;
    --panel-muted: #E7F2E4;
}

.theme-blue {
    --accent: var(--dfk-blue);
    --accent-action: var(--dfk-blue-action);
    --accent-action-hover: var(--dfk-blue-action-hover);
    --accent-soft: rgba(35, 143, 232, 0.14);
    --focus: var(--dfk-blue-dark);
    --panel-a: #1A6AAD;
    --panel-b: #124E86;
    --panel-c: #0C335C;
    --panel-muted: #E5F0FB;
    --dfk-background: #F4F8FC;
    --dfk-border: #D5E1EE;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body.guest {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--dfk-text);
    background: var(--dfk-background);
    font-family: var(--dfk-font);
    font-size: 16px;
    line-height: 1.5;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--accent-action);
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: 0;
    transform: translateY(-120%);
    z-index: 5;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    background: var(--dfk-surface);
    color: var(--dfk-text);
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--dfk-shadow);
}

.skip-link:focus {
    transform: translateY(1rem);
}

.logo {
    display: block;
    width: 168px;
    height: auto;
}

.logo--lg {
    width: 196px;
}

.logo-plate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 0.9rem;
    border-radius: 14px;
    background: var(--dfk-surface);
    box-shadow: 0 10px 24px rgba(8, 24, 16, 0.16);
}

.logo-plate .logo {
    width: 158px;
}

.guest :focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}

/* Welcome */

.welcome {
    position: relative;
    isolation: isolate;
    overflow: clip;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(ellipse 70% 45% at 0% -10%, rgba(110, 173, 59, 0.18), transparent 60%),
        radial-gradient(ellipse 55% 40% at 100% 0%, rgba(110, 173, 59, 0.12), transparent 55%),
        var(--dfk-background);
}

.welcome__orb {
    position: absolute;
    z-index: 0;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(2px);
}

.welcome__orb--a {
    width: 280px;
    height: 280px;
    top: -80px;
    right: -60px;
    background: rgba(110, 173, 59, 0.16);
}

.welcome__orb--b {
    width: 220px;
    height: 220px;
    left: -70px;
    bottom: 8%;
    background: rgba(49, 92, 45, 0.08);
}

.welcome__ring {
    position: absolute;
    z-index: 0;
    right: 8%;
    bottom: 12%;
    width: min(280px, 40vw);
    height: auto;
    pointer-events: none;
    opacity: 0.45;
}

.welcome__header,
.welcome__main,
.welcome__footer {
    position: relative;
    z-index: 1;
    width: min(1120px, calc(100% - 2rem));
    margin-inline: auto;
}

.welcome__header {
    display: flex;
    align-items: center;
    padding: 1.5rem 0 0.5rem;
}

.welcome__main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.5rem 0 2rem;
}

.eyebrow {
    margin: 0 0 0.75rem;
    color: var(--dfk-green-dark);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.theme-blue .eyebrow {
    color: var(--dfk-blue-dark);
}

.welcome h1,
.auth__brand h1,
.auth__form h2 {
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.welcome h1 {
    max-width: 16ch;
    font-size: clamp(2rem, 4.6vw, 3.35rem);
}

.welcome__lead {
    max-width: 38rem;
    margin: 0.9rem 0 0;
    color: var(--dfk-muted);
    font-size: clamp(1.02rem, 1.6vw, 1.2rem);
}

.welcome__cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-top: 2rem;
}

.access-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 100%;
    padding: 1.5rem;
    border: 1px solid rgba(23, 43, 34, 0.08);
    border-radius: var(--dfk-radius);
    background: var(--dfk-surface);
    box-shadow: var(--dfk-shadow);
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.access-card:hover,
.access-card:focus-within {
    transform: translateY(-4px);
    box-shadow: var(--dfk-shadow-hover);
}

.access-card--green {
    border-top: 4px solid var(--dfk-green);
}

.access-card--blue {
    border-top: 4px solid var(--dfk-blue);
}

.access-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 1.1rem;
    border-radius: 14px;
}

.access-card--green .access-card__icon {
    color: var(--dfk-green-action);
    background: rgba(110, 173, 59, 0.14);
}

.access-card--blue .access-card__icon {
    color: var(--dfk-blue-action);
    background: rgba(35, 143, 232, 0.14);
}

.access-card h2 {
    margin: 0;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.access-card p {
    flex: 1;
    margin: 0.55rem 0 1.25rem;
    color: var(--dfk-muted);
}

.welcome__contact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    margin-top: 1.75rem;
    color: var(--dfk-muted);
    font-size: 0.92rem;
}

.welcome__contact p {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
}

.welcome__contact svg {
    flex: 0 0 auto;
    color: var(--dfk-green-dark);
}

.welcome__contact a {
    color: inherit;
    text-underline-offset: 2px;
}

.welcome__footer {
    padding: 0 0 1.5rem;
    color: var(--dfk-muted);
    font-size: 0.82rem;
}

.welcome__footer p {
    margin: 0;
}

/* Auth split */

.auth {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    min-height: 100vh;
    min-height: 100dvh;
}

.auth__brand {
    position: relative;
    isolation: isolate;
    overflow: clip;
    display: flex;
    align-items: center;
    padding: clamp(1.75rem, 4vw, 4.5rem);
    color: #fff;
    background: linear-gradient(165deg, var(--panel-a) 0%, var(--panel-b) 48%, var(--panel-c) 100%);
}

.auth__art {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.auth__mesh {
    width: 100%;
    height: 100%;
    opacity: 0.55;
}

.auth__brand-inner {
    position: relative;
    z-index: 1;
    max-width: 30rem;
}

.auth__brand .eyebrow {
    color: var(--panel-muted);
}

.auth__brand h1 {
    margin-top: 1.75rem;
    font-size: clamp(1.85rem, 3vw, 2.75rem);
}

.auth__brand .lead {
    margin: 0.9rem 0 0;
    max-width: 34ch;
    color: var(--panel-muted);
    font-size: 1.05rem;
}

.auth__main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 3rem);
    background-color: #F7F8F6;
    background-image: radial-gradient(rgba(23, 43, 34, 0.045) 1px, transparent 1px);
    background-size: 18px 18px;
}

.theme-blue .auth__main {
    background-color: #F5F8FB;
}

.auth__form {
    width: min(100%, 420px);
}

.auth__form h2 {
    font-size: clamp(1.6rem, 2vw, 1.9rem);
}

.auth__form .lead {
    margin: 0.45rem 0 1.5rem;
    color: var(--dfk-muted);
}

.field {
    margin-bottom: 1rem;
}

.field label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.92rem;
    font-weight: 600;
}

.field input {
    width: 100%;
    height: 48px;
    padding: 0 0.95rem;
    border: 1px solid var(--dfk-border);
    border-radius: var(--dfk-radius-control);
    background: var(--dfk-surface);
    color: var(--dfk-text);
    font: inherit;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}

.field input:focus {
    border-color: var(--focus);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.field.is-invalid input {
    border-color: var(--dfk-danger);
    background: var(--dfk-danger-bg);
}

.field.is-invalid input:focus {
    box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.15);
}

.field-error {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    margin: 0.4rem 0 0;
    color: var(--dfk-danger);
    font-size: 0.875rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.field-error svg {
    flex: 0 0 auto;
    margin-top: 0.15rem;
}

.form-status {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0 0 1.15rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid #B7D7A8;
    border-radius: 12px;
    background: #E7F6E4;
    color: #14532D;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.45;
}

.form-status svg {
    flex: 0 0 auto;
    margin-top: 0.12rem;
}

.auth__options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    flex-wrap: wrap;
    margin: 0.35rem 0 1.15rem;
}

.remember {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 44px;
    color: var(--dfk-text);
    font-size: 0.95rem;
    cursor: pointer;
}

.remember input {
    width: 1.15rem;
    height: 1.15rem;
    margin: 0;
    accent-color: var(--accent-action);
}

.auth__forgot {
    color: var(--accent-action);
    font-size: 0.95rem;
    font-weight: 600;
    text-underline-offset: 3px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.75rem 1.15rem;
    border: 0;
    border-radius: var(--dfk-radius-control);
    background: var(--accent-action);
    color: #fff;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 200ms ease, box-shadow 200ms ease;
}

.btn:hover {
    background: var(--accent-action-hover);
}

.btn--block,
.access-card .btn {
    width: 100%;
}

.btn--green {
    --accent-action: var(--dfk-green-action);
    --accent-action-hover: var(--dfk-green-action-hover);
    --focus: var(--dfk-green-dark);
}

.btn--blue {
    --accent-action: var(--dfk-blue-action);
    --accent-action-hover: var(--dfk-blue-action-hover);
    --focus: var(--dfk-blue-dark);
}

.auth__back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    margin-top: 1.15rem;
    min-height: 44px;
    color: var(--dfk-muted);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
}

.auth__back:hover {
    color: var(--dfk-text);
}

@media (max-width: 960px) {
    .auth {
        grid-template-columns: 1fr;
    }

    .auth__mesh {
        display: none;
    }

    .auth__brand {
        align-items: flex-start;
        padding: 1.35rem 1.25rem 1.25rem;
    }

    .auth__brand h1 {
        margin-top: 1rem;
        font-size: 1.45rem;
    }

    .auth__brand .lead {
        margin-top: 0.4rem;
        font-size: 0.98rem;
    }

    .auth__main {
        align-items: flex-start;
        padding: 1.5rem 1.25rem 6.5rem;
    }
}

@media (max-width: 720px) {
    .welcome__cards {
        grid-template-columns: 1fr;
    }

    .welcome__header,
    .welcome__main,
    .welcome__footer {
        width: min(1120px, calc(100% - 1.5rem));
    }

    .welcome__footer {
        padding-bottom: 6rem;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .guest-enter {
        animation: guest-enter 400ms ease-out;
    }

    .field-error {
        animation: guest-enter 200ms ease-out;
    }

    .welcome__orb--a,
    .auth__mesh {
        animation: guest-drift 24s ease-in-out infinite;
    }
}

@media (prefers-reduced-motion: reduce) {
    .guest-enter,
    .field-error,
    .welcome__orb,
    .auth__mesh,
    .access-card,
    .btn,
    .field input {
        animation: none !important;
        transition: none !important;
    }
}

@keyframes guest-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes guest-drift {
    0%,
    100% {
        transform: translate3d(0, 0, 0);
    }

    50% {
        transform: translate3d(0, -10px, 0);
    }
}
