:root {
    color-scheme: light;
    --nva-canvas: #efe9df;
    --nva-canvas-deep: #e7dfd2;
    --nva-paper: #fbf8f2;
    --nva-paper-strong: #fffdf9;
    --nva-ink: #20231f;
    --nva-ink-soft: #5f625b;
    --nva-line: #d8cfc1;
    --nva-line-strong: #bfae98;
    --nva-emerald: #155e4b;
    --nva-emerald-dark: #0f4538;
    --nva-emerald-soft: #e4efe9;
    --nva-bronze: #9a6a36;
    --nva-bronze-soft: #f2e6d7;
    --nva-danger: #9f403f;
    --nva-danger-soft: #f8e9e6;
    --nva-success: #216a4e;
    --nva-success-soft: #e3f0e9;
    --nva-shadow: 0 28px 70px rgba(50, 43, 34, .12);
    --nva-radius-lg: 30px;
    --nva-radius-md: 18px;
    --nva-radius-sm: 12px;
    --nva-safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    min-height: 100%;
    background: var(--nva-canvas);
    -webkit-text-size-adjust: 100%;
}

body.nva-login-body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--nva-ink);
    background:
        radial-gradient(circle at 12% 18%, rgba(21, 94, 75, .08), transparent 28%),
        radial-gradient(circle at 86% 78%, rgba(154, 106, 54, .10), transparent 30%),
        linear-gradient(135deg, var(--nva-paper) 0%, var(--nva-canvas) 52%, var(--nva-canvas-deep) 100%);
    font-family: "Noto Sans Thai", "Leelawadee UI", Tahoma, Arial, sans-serif;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.nva-login-canvas {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
}

.nva-login-canvas::before,
.nva-login-canvas::after {
    content: "";
    position: fixed;
    z-index: -1;
    pointer-events: none;
}

.nva-login-canvas::before {
    inset: 0;
    background-image:
        linear-gradient(rgba(32, 35, 31, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(32, 35, 31, .035) 1px, transparent 1px);
    background-size: 76px 76px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.75), transparent 82%);
}

.nva-login-canvas::after {
    width: 460px;
    height: 460px;
    border: 1px solid rgba(154, 106, 54, .22);
    border-radius: 50%;
    right: -180px;
    top: 18%;
    box-shadow:
        0 0 0 54px rgba(154, 106, 54, .035),
        0 0 0 112px rgba(21, 94, 75, .025);
}

.nva-access-header,
.nva-access-footer {
    width: min(1480px, calc(100% - 64px));
    margin-inline: auto;
}

.nva-access-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 0 18px;
    border-bottom: 1px solid rgba(122, 108, 89, .22);
}

.nva-access-brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    color: inherit;
    text-decoration: none;
}

.nva-access-logo-frame {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    padding: 8px;
    border: 1px solid rgba(154, 106, 54, .42);
    border-radius: 15px;
    background: #242622;
}

.nva-access-logo-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.nva-access-brand-copy {
    display: grid;
    gap: 2px;
}

.nva-access-brand-copy strong {
    letter-spacing: .08em;
    font-size: 14px;
    line-height: 1.2;
}

.nva-access-brand-copy small,
.nva-access-environment small {
    color: var(--nva-ink-soft);
    font-size: 10px;
    letter-spacing: .08em;
    line-height: 1.3;
}

.nva-access-environment {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 220px;
    padding: 10px 14px;
    border: 1px solid var(--nva-line);
    border-radius: 14px;
    background: rgba(255, 253, 249, .68);
}

.nva-access-environment > span:last-child {
    display: grid;
    gap: 1px;
}

.nva-access-environment strong {
    font-size: 12px;
}

.nva-environment-dot,
.nva-status-dot {
    display: block;
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--nva-emerald);
    box-shadow: 0 0 0 5px rgba(21, 94, 75, .10);
}

.nva-access-main {
    display: grid;
    place-items: center;
    width: 100%;
    padding: 54px 32px 42px;
}

.nva-access-stage {
    width: min(620px, 100%);
}

.nva-access-kicker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 0 15px;
    color: var(--nva-bronze);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .18em;
}

.nva-kicker-line {
    width: 34px;
    height: 1px;
    background: var(--nva-bronze);
}

.nva-access-card {
    position: relative;
    padding: 38px;
    border: 1px solid rgba(154, 106, 54, .30);
    border-radius: var(--nva-radius-lg);
    background: rgba(255, 253, 249, .92);
    box-shadow: var(--nva-shadow);
}

.nva-access-card::before {
    content: "";
    position: absolute;
    inset: 0 28px auto;
    height: 3px;
    border-radius: 0 0 10px 10px;
    background: linear-gradient(90deg, var(--nva-bronze), var(--nva-emerald));
}

.nva-access-card-head {
    text-align: center;
}

.nva-access-mark {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    margin: 0 auto 18px;
    border: 1px solid rgba(21, 94, 75, .26);
    border-radius: 16px;
    color: var(--nva-emerald-dark);
    background: linear-gradient(145deg, rgba(228, 239, 233, .92), rgba(255, 253, 249, .95));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.72);
}

.nva-access-mark svg {
    display: block;
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nva-access-status {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 14px;
    padding: 7px 11px;
    border-radius: 999px;
    background: var(--nva-emerald-soft);
    color: var(--nva-emerald-dark);
    font-size: 11px;
    font-weight: 800;
}

.nva-access-card h1 {
    margin: 0;
    color: var(--nva-ink);
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.2;
    letter-spacing: -.035em;
}

.nva-access-card-head > p {
    max-width: 480px;
    margin: 11px auto 0;
    color: var(--nva-ink-soft);
    font-size: 13px;
    line-height: 1.75;
}

.nva-access-alert {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-top: 24px;
    padding: 13px 14px;
    border-radius: var(--nva-radius-sm);
    font-size: 12px;
    line-height: 1.55;
}

.nva-access-alert-error {
    border: 1px solid rgba(159, 64, 63, .22);
    color: #7c302f;
    background: var(--nva-danger-soft);
}

.nva-access-alert-success {
    border: 1px solid rgba(33, 106, 78, .20);
    color: var(--nva-emerald-dark);
    background: var(--nva-success-soft);
}

.nva-alert-symbol {
    display: grid;
    flex: 0 0 25px;
    place-items: center;
    width: 25px;
    height: 25px;
    border-radius: 8px;
    background: rgba(255,255,255,.62);
    font-weight: 900;
}

.nva-access-form {
    display: grid;
    gap: 18px;
    margin-top: 28px;
}

.nva-field {
    display: grid;
    gap: 8px;
}

.nva-field-label {
    color: #3c403a;
    font-size: 12px;
    font-weight: 800;
}

.nva-field-control {
    display: flex;
    align-items: center;
    min-height: 54px;
    overflow: hidden;
    border: 1px solid var(--nva-line);
    border-radius: 14px;
    background: var(--nva-paper-strong);
}

.nva-field-control:focus-within {
    border-color: var(--nva-emerald);
    box-shadow: 0 0 0 3px rgba(21, 94, 75, .10);
}

.nva-field-control input {
    width: 100%;
    min-width: 0;
    height: 52px;
    padding: 0 16px;
    border: 0;
    outline: 0;
    color: var(--nva-ink);
    background: transparent;
    font-size: 14px;
}

.nva-field-control input::placeholder {
    color: #aaa397;
}

.nva-field > small {
    color: #77786f;
    font-size: 10px;
    line-height: 1.5;
}

.nva-password-control input {
    padding-right: 8px;
}

.nva-password-toggle {
    flex: 0 0 auto;
    margin-right: 7px;
    padding: 8px 11px;
    border: 0;
    border-radius: 10px;
    color: var(--nva-emerald-dark);
    background: var(--nva-emerald-soft);
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
}

.nva-password-toggle:focus-visible,
.nva-submit-button:focus-visible,
.nva-secondary-button:focus-visible {
    outline: 3px solid rgba(154, 106, 54, .28);
    outline-offset: 3px;
}

.nva-submit-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    margin-top: 4px;
    padding: 0 19px;
    border: 0;
    border-radius: 14px;
    color: #fffef9;
    background: var(--nva-emerald-dark);
    cursor: pointer;
    font-size: 13px;
    font-weight: 900;
}

.nva-submit-button span:last-child {
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    border-radius: 50%;
    background: rgba(255,255,255,.10);
    font-size: 18px;
}

.nva-identity-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 25px;
    padding: 13px 15px;
    border: 1px solid rgba(154, 106, 54, .25);
    border-radius: 13px;
    background: var(--nva-bronze-soft);
}

.nva-identity-summary span {
    color: #76502b;
    font-size: 11px;
}

.nva-identity-summary strong {
    overflow-wrap: anywhere;
    font-size: 13px;
}

.nva-secondary-form {
    margin-top: 12px;
}

.nva-secondary-button {
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--nva-line);
    border-radius: 12px;
    color: var(--nva-ink-soft);
    background: transparent;
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
}

.nva-access-boundary {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--nva-line);
    color: #7b776e;
    font-size: 9px;
    letter-spacing: .06em;
}

.nva-trust-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 12px;
}

.nva-trust-strip > div {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 9px;
    row-gap: 2px;
    min-width: 0;
    padding: 12px 13px;
    border: 1px solid rgba(122, 108, 89, .24);
    border-radius: 13px;
    background: rgba(255, 253, 249, .72);
}

.nva-trust-strip span {
    grid-row: 1 / 3;
    align-self: center;
    color: var(--nva-bronze);
    font-size: 11px;
    font-weight: 900;
}

.nva-trust-strip strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #2f332e;
    font-size: 11px;
}

.nva-trust-strip small {
    overflow: hidden;
    color: #686a63;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nva-access-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 0 calc(22px + var(--nva-safe-bottom));
    border-top: 1px solid rgba(122, 108, 89, .18);
    color: #76746d;
    font-size: 9px;
    letter-spacing: .05em;
}

@media (max-width: 820px) {
    .nva-login-canvas {
        overflow: visible;
    }

    .nva-login-canvas::before {
        background-size: 58px 58px;
    }

    .nva-login-canvas::after {
        width: 300px;
        height: 300px;
        right: -170px;
        top: 24%;
    }

    .nva-access-header,
    .nva-access-footer {
        width: min(100% - 34px, 620px);
    }

    .nva-access-header {
        padding: 14px 0 13px;
    }

    .nva-access-environment {
        min-width: 0;
        padding: 9px 11px;
    }

    .nva-access-environment small {
        display: none;
    }

    .nva-access-main {
        align-items: start;
        padding: 32px 17px 30px;
    }

    .nva-access-card {
        padding: 30px 24px;
        border-radius: 24px;
    }

    .nva-trust-strip {
        grid-template-columns: 1fr;
    }

    .nva-trust-strip > div {
        grid-template-columns: 28px 1fr;
    }

    .nva-trust-strip small,
    .nva-trust-strip strong {
        white-space: normal;
    }
}

@media (max-width: 520px) {
    .nva-access-header {
        gap: 12px;
    }

    .nva-access-logo-frame {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .nva-access-brand-copy strong {
        font-size: 12px;
    }

    .nva-access-brand-copy small {
        font-size: 8px;
    }

    .nva-access-environment {
        padding: 8px 10px;
    }

    .nva-access-environment strong {
        font-size: 10px;
    }

    .nva-access-main {
        padding-top: 22px;
    }

    .nva-access-kicker {
        margin-bottom: 12px;
        font-size: 8px;
    }

    .nva-access-card {
        padding: 24px 18px 25px;
        border-radius: 21px;
    }

    .nva-access-mark {
        width: 44px;
        height: 44px;
        margin-bottom: 15px;
        border-radius: 14px;
    }

    .nva-access-mark svg {
        width: 24px;
        height: 24px;
    }

    .nva-access-card h1 {
        font-size: 26px;
    }

    .nva-access-card-head > p {
        margin-top: 9px;
        font-size: 12px;
        line-height: 1.65;
    }

    .nva-access-form {
        gap: 15px;
        margin-top: 24px;
    }

    .nva-field-control,
    .nva-field-control input {
        min-height: 50px;
        height: 50px;
    }

    .nva-submit-button {
        min-height: 52px;
    }

    .nva-access-boundary {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .nva-access-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
}

@media (max-width: 380px) {
    .nva-access-header,
    .nva-access-footer {
        width: calc(100% - 24px);
    }

    .nva-access-brand-copy small {
        display: none;
    }

    .nva-access-main {
        padding-inline: 12px;
    }

    .nva-access-card {
        padding-inline: 15px;
    }

    .nva-identity-summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto;
    }
}
