

:root {
    --paper: #F6F4EF;
    --paper2: #EFECE4;
    --card: #FFFFFF;
    --ink: #1B1E1C;
    --ink2: #57605B;
    --line: #E2DED4;
    --line2: #D2CDBF;
    --green: #0E5E52;
    --green2: #0B4A41;
    --green-soft: #E3EEEB;
    --green-line: #BAD3CD;
    --amber: #B45309;
    --amber-soft: #FCF1E3;
    --amber-line: #EBD3AE;
    --blue: #1D4ED8;
    --blue-soft: #E7EDFC;
    --red: #B91C1C;
    --red-soft: #FBEAEA;
    --red-line: #F0C7C7;
    --radius: 14px;
    --radius-s: 9px;
    --shadow: 0 1px 2px rgba(27,30,28,.05), 0 8px 24px -12px rgba(27,30,28,.14);
    --mono: 'Spline Sans Mono', ui-monospace, monospace;
    --sans: 'Familjen Grotesk', sans-serif;
    --disp: 'Fraunces', serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

html {
    font-size: 15px
}

body {
    font-family: var(--sans);
    background: var(--paper);
    color: var(--ink);
    min-height: 100vh;
    background-image: radial-gradient(rgba(27,30,28,.045) 1px, transparent 1px);
    background-size: 22px 22px;
}

button {
    font-family: inherit;
    cursor: pointer
}

input, select, textarea {
    font-family: inherit;
    font-size: .95rem;
    color: var(--ink)
}

::placeholder {
    color: #9AA29D
}


/* ---------- LOGIN ---------- */

body:has(.login-shell) {
    background-image: none;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 420px) 1fr;
}

@media (max-width: 900px) {
    .login-shell {
        grid-template-columns: 1fr;
    }
}

/* ---- Left hero panel ---- */

.login-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, var(--green) 0%, var(--green2) 62%, #082f29 100%);
    color: #EAF3F0;
    padding: 44px 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

    .login-hero::before,
    .login-hero::after {
        content: "";
        position: absolute;
        border-radius: 50%;
        background: radial-gradient(closest-side, rgba(255,255,255,.14), transparent 72%);
        pointer-events: none;
    }

    .login-hero::before {
        width: 420px;
        height: 420px;
        top: -160px;
        right: -160px;
    }

    .login-hero::after {
        width: 320px;
        height: 320px;
        bottom: -140px;
        left: -100px;
        background: radial-gradient(closest-side, rgba(180,83,9,.18), transparent 72%);
    }

@media (max-width: 900px) {
    .login-hero {
        padding: 30px 26px 36px;
        gap: 18px;
    }
}

.hero-badge {
    align-self: flex-start;
    font-family: var(--mono);
    font-size: .72rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #BFE0D8;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.16);
    padding: 5px 11px;
    border-radius: 999px;
    position: relative;
    z-index: 1;
}

.login-hero .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.22);
    color: #fff;
    display: grid;
    place-items: center;
    font-family: var(--disp);
    font-weight: 700;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.login-hero .brand h1 {
    font-family: var(--disp);
    font-weight: 600;
    font-size: 1.4rem;
    letter-spacing: -.01em;
    color: #fff;
}

    .login-hero .brand h1 span {
        color: #9FD7C8;
    }

.hero-title {
    font-family: var(--disp);
    font-weight: 600;
    font-size: clamp(1.7rem, 3vw, 2.3rem);
    line-height: 1.15;
    letter-spacing: -.01em;
    max-width: 360px;
    position: relative;
    z-index: 1;
}

.hero-sub {
    color: #C9E2DC;
    font-size: .95rem;
    line-height: 1.6;
    max-width: 360px;
    position: relative;
    z-index: 1;
}

.hero-points {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
    position: relative;
    z-index: 1;
}

    .hero-points li {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        font-size: .88rem;
        color: #E1F0EB;
    }

    .hero-points svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
        margin-top: 1px;
        color: #9FD7C8;
    }

.login-hero .login-note {
    margin-top: auto;
    position: relative;
    z-index: 1;
    color: #8FBBB0;
}

@media (max-width: 900px) {
    .hero-title, .hero-sub, .hero-points { display: none; }
    .login-hero .login-note { margin-top: 0; }
}

/* ---- Right panel: role picker ---- */

.login-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.login-main-inner {
    width: 100%;
    max-width: 620px;
}

.login-main h2 {
    font-family: var(--disp);
    font-weight: 600;
    font-size: 1.55rem;
    letter-spacing: -.01em;
}

.login-main .lead {
    color: var(--ink2);
    font-size: .92rem;
    margin-top: 6px;
    margin-bottom: 26px;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

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

.role-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 20px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow);
    transition: transform .18s, box-shadow .18s, border-color .18s;
    position: relative;
    overflow: hidden;
}

    .role-card:hover {
        transform: translateY(-3px);
        border-color: color-mix(in srgb, var(--rc, var(--green)) 45%, var(--line));
        box-shadow: 0 2px 4px rgba(27,30,28,.06), 0 18px 34px -16px color-mix(in srgb, var(--rc, var(--green)) 55%, transparent);
    }

    .role-card::after {
        content: "";
        position: absolute;
        inset: auto 0 0 0;
        height: 3px;
        background: var(--rc, var(--green));
        opacity: 0;
        transition: .18s;
    }

    .role-card:hover::after {
        opacity: 1
    }

.role-icon-wm {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 48px;
    height: 48px;
    color: var(--rc, var(--green));
    opacity: .07;
    pointer-events: none;
}

    .role-icon-wm svg {
        width: 100%;
        height: 100%;
    }

.role-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: .95rem;
    color: #fff;
    background: linear-gradient(155deg, var(--rc, var(--green)), color-mix(in srgb, var(--rc, var(--green)) 70%, black));
    flex-shrink: 0;
}

.role-card h3 {
    font-size: 1rem;
    font-weight: 700
}

.role-card .rname {
    color: var(--ink2);
    font-size: .8rem;
    font-weight: 500;
    margin-top: 1px
}

.role-card p {
    color: var(--ink2);
    font-size: .82rem;
    line-height: 1.5;
    position: relative;
}

.role-card .go {
    margin-top: auto;
    font-size: .82rem;
    font-weight: 700;
    color: var(--rc, var(--green));
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

    .role-card .go svg {
        width: 14px;
        height: 14px;
        transition: transform .18s;
    }

    .role-card:hover .go svg {
        transform: translateX(3px);
    }

.login-note {
    font-size: .8rem;
    color: #8B928C
}

/* ---- Sign-in modal ---- */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(14,20,18,.55);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s;
    z-index: 80;
}

    .modal-overlay.show {
        opacity: 1;
        pointer-events: auto;
    }

.login-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 100%;
    max-width: 380px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 24px 60px -20px rgba(0,0,0,.35);
    padding: 30px 30px 26px;
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -46%) scale(.96);
    transition: opacity .2s ease, transform .22s cubic-bezier(.2,.8,.3,1.1);
}

    .login-panel.show {
        opacity: 1;
        pointer-events: auto;
        transform: translate(-50%, -50%) scale(1);
    }

    .login-panel::before {
        content: "";
        position: absolute;
        inset: 0 0 auto 0;
        height: 5px;
        border-radius: 18px 18px 0 0;
        background: var(--accent, var(--green));
    }

    .login-panel .lp-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 20px;
    }

        .login-panel .lp-head h3 {
            font-family: var(--disp);
            font-weight: 600;
            font-size: 1.1rem;
        }

        .login-panel .lp-head span {
            color: var(--accent, var(--green));
            font-weight: 700;
        }

    .login-panel .lp-close {
        background: none;
        border: 1px solid var(--line);
        border-radius: 8px;
        width: 30px;
        height: 30px;
        color: var(--ink2);
        font-size: .95rem;
        cursor: pointer;
        transition: .15s;
    }

        .login-panel .lp-close:hover {
            border-color: var(--red);
            color: var(--red);
            background: var(--red-soft);
        }

    .login-panel .f {
        display: flex;
        flex-direction: column;
        gap: 6px;
        margin-bottom: 14px;
    }

        .login-panel .f label {
            font-size: .78rem;
            font-weight: 700;
            letter-spacing: .03em;
            text-transform: uppercase;
            color: var(--ink2);
        }

        .login-panel .f input {
            border: 1px solid var(--line2);
            border-radius: var(--radius-s);
            padding: 10px 12px;
            font-size: .95rem;
            font-family: inherit;
            background: #FDFCFA;
            outline: none;
            transition: .15s;
        }

            .login-panel .f input:focus {
                border-color: var(--accent, var(--green));
                box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, var(--green)) 16%, transparent);
                background: #fff;
            }

    .login-panel .btn-submit {
        width: 100%;
        border: none;
        border-radius: 10px;
        padding: 11px;
        margin-top: 4px;
        background: var(--accent, var(--green));
        color: #fff;
        font-weight: 700;
        font-size: .92rem;
        cursor: pointer;
        transition: .15s;
    }

        .login-panel .btn-submit:hover {
            filter: brightness(0.92);
            transform: translateY(-1px);
        }

.login-panel-inline {
    position: static;
    max-width: 380px;
    margin: 0 auto;
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.alert-error {
    background: var(--red-soft);
    border: 1px solid var(--red-line);
    color: var(--red);
    font-size: .85rem;
    padding: 9px 12px;
    border-radius: var(--radius-s);
    margin-bottom: 16px;
}
