:root {
    color-scheme: dark;
    --bg: #02080d;
    --bg-deep: #010407;
    --surface: rgba(6, 20, 28, 0.86);
    --surface-strong: #071923;
    --surface-soft: rgba(10, 34, 45, 0.72);
    --border: rgba(80, 224, 255, 0.18);
    --border-strong: rgba(80, 224, 255, 0.34);
    --text: #e9fbff;
    --muted: #8eabb4;
    --muted-strong: #b8d0d7;
    --cyan: #45e6ff;
    --cyan-strong: #12cce9;
    --cyan-soft: rgba(69, 230, 255, 0.12);
    --cyan-glow: rgba(38, 216, 246, 0.22);
    --green: #55f2c2;
    --amber: #ffd166;
    --red: #ff6b88;
    --radius-lg: 0px;
    --radius-md: 0px;
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    line-height: 1.5;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--bg-deep);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(
            circle at 50% -18%,
            rgba(40, 221, 251, 0.18),
            transparent 34rem
        ),
        radial-gradient(
            circle at 9% 82%,
            rgba(0, 174, 205, 0.08),
            transparent 28rem
        ),
        linear-gradient(180deg, #031018 0%, var(--bg) 48%, var(--bg-deep) 100%);
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(69, 230, 255, 0.026) 1px, transparent 1px),
        linear-gradient(90deg, rgba(69, 230, 255, 0.026) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, black, transparent 88%);
}

a {
    color: var(--cyan);
    text-decoration-color: rgba(69, 230, 255, 0.42);
    text-underline-offset: 0.18em;
}

a:hover {
    color: #8ff3ff;
}

.shell {
    width: min(100% - 2rem, 52rem);
    min-height: 100vh;
    margin-inline: auto;
    padding-block: clamp(2rem, 7vw, 5.5rem);
    display: grid;
    align-items: center;
}

.card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: clamp(1.35rem, 5vw, 3.25rem);
    background:
        linear-gradient(180deg, rgba(10, 34, 45, 0.86), rgba(4, 15, 22, 0.91)),
        var(--surface);
    box-shadow:
        var(--shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.025);
    backdrop-filter: blur(18px);
}

.card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(69, 230, 255, 0.78),
        transparent
    );
}

.card::after {
    content: "";
    position: absolute;
    width: 16rem;
    height: 16rem;
    top: -9rem;
    right: -7rem;
    border-radius: 50%;
    background: rgba(69, 230, 255, 0.08);
    filter: blur(18px);
    pointer-events: none;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.72rem;
    margin-bottom: 2.35rem;
}

.brand-mark {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    border: 1px solid var(--border-strong);
    border-radius: 0px;
    background: linear-gradient(
        145deg,
        rgba(69, 230, 255, 0.18),
        rgba(69, 230, 255, 0.035)
    );
    box-shadow: 0 0 28px rgba(69, 230, 255, 0.11);
}

.brand-mark::before,
.brand-mark::after {
    content: "";
    position: absolute;
    background: var(--cyan);
    box-shadow: 0 0 12px rgba(69, 230, 255, 0.65);
}

.brand-mark::before {
    width: 0.88rem;
    height: 2px;
}

.brand-mark::after {
    width: 2px;
    height: 0.88rem;
}

.brand-name {
    font-size: 0.88rem;
    font-weight: 760;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted-strong);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.48rem;
    margin: 0 0 0.8rem;
    color: var(--cyan);
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: "";
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 12px currentColor;
}

h1,
h2 {
    margin: 0;
    color: #f1fcff;
    line-height: 1.06;
    letter-spacing: -0.035em;
}

h1 {
    max-width: 12ch;
    font-size: clamp(2.15rem, 7vw, 4rem);
    font-weight: 760;
}

h2 {
    font-size: clamp(1.55rem, 4vw, 2.2rem);
}

.lede {
    max-width: 40rem;
    margin: 1rem 0 2.35rem;
    color: var(--muted);
    font-size: clamp(1rem, 2.4vw, 1.13rem);
}

.stack {
    display: grid;
    gap: 1.2rem;
}

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

.field-full {
    grid-column: 1 / -1;
}

label {
    display: grid;
    gap: 0.48rem;
    color: var(--muted-strong);
    font-size: 0.86rem;
    font-weight: 680;
}

input,
textarea,
button,
.button {
    width: auto;
    align-self: flex-start;
}

input,
textarea {
    width: 100%;
    border: 1px solid rgba(143, 199, 211, 0.2);
    border-radius: var(--radius-md);
    outline: none;
    padding: 0.88rem 0.95rem;
    background: rgba(1, 10, 15, 0.68);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.018);
    transition:
        border-color 150ms ease,
        box-shadow 150ms ease,
        background-color 150ms ease;
}

input::placeholder,
textarea::placeholder {
    color: #54717a;
}

input:hover,
textarea:hover {
    border-color: rgba(69, 230, 255, 0.32);
}

input:focus,
textarea:focus {
    border-color: var(--cyan);
    background: rgba(2, 14, 20, 0.9);
    box-shadow:
        0 0 0 4px var(--cyan-soft),
        0 0 28px rgba(69, 230, 255, 0.06);
}

textarea {
    min-height: 9rem;
    resize: vertical;
    font-family:
        "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.86rem;
    line-height: 1.6;
}

.form-meta {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    margin-top: 0.15rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(69, 230, 255, 0.1);
    border-radius: 0px;
    background: rgba(69, 230, 255, 0.045);
}

.form-meta::before {
    content: "i";
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.02rem;
    border: 1px solid rgba(69, 230, 255, 0.38);
    border-radius: 0%;
    color: var(--cyan);
    font-family: ui-monospace, monospace;
    font-size: 0.72rem;
    font-weight: 800;
}

.hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.55;
}

button,
.button-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 2.95rem;
    border: 1px solid rgba(133, 244, 255, 0.72);
    border-radius: 0px;
    padding: 0.78rem 1.15rem;
    background: linear-gradient(180deg, #59eaff, #19c9e4);
    color: #021016;
    box-shadow:
        0 10px 28px rgba(12, 189, 219, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition:
        transform 140ms ease,
        box-shadow 140ms ease,
        filter 140ms ease;
}

button:hover,
.button-link:hover {
    color: #021016;
    filter: brightness(1.07);
    transform: translateY(-1px);
    box-shadow:
        0 14px 34px rgba(12, 189, 219, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

button:focus-visible,
.button-link:focus-visible,
a:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 4px;
}

button:disabled,
.htmx-request button {
    opacity: 0.58;
    cursor: wait;
    transform: none;
}

.result {
    position: relative;
    padding: 0.3rem 0 0;
    animation: reveal 200ms ease-out both;
}

.result p:not(.eyebrow) {
    color: var(--muted);
}

.result.error .eyebrow {
    color: var(--red);
}

.result.success .eyebrow {
    color: var(--green);
}

.result h2 + p {
    margin-top: 0.85rem;
}

dl {
    margin: 1.6rem 0;
    padding: 1rem 1.05rem;
    border: 1px solid var(--border);
    border-radius: 0px;
    background: rgba(1, 10, 15, 0.55);
}

dt {
    color: var(--muted);
    font-size: 0.69rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

dd {
    margin: 0.38rem 0 0;
    overflow-wrap: anywhere;
}

code {
    color: #bcf8ff;
    font-family:
        "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9em;
}

.status {
    position: relative;
    margin-top: 1.5rem;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 0px;
    padding: 1.05rem 1.1rem 1.05rem 1.25rem;
    background: rgba(2, 14, 20, 0.64);
}

.status::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: currentColor;
    box-shadow: 0 0 18px currentColor;
}

.status strong {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

.status strong::before {
    content: "";
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 0%;
    background: currentColor;
    box-shadow: 0 0 10px currentColor;
}

.status p {
    margin: 0.55rem 0 0;
    color: var(--muted);
}

.status-pending {
    color: var(--amber);
}

.status-approved {
    color: var(--green);
}

.status-rejected {
    color: var(--red);
}

.portal-footer {
    margin-top: 1.8rem;
    color: #58737c;
    font-size: 0.72rem;
    letter-spacing: 0.03em;
}

@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

@media (max-width: 640px) {
    .shell {
        width: min(100% - 1rem, 52rem);
        padding-block: 0.5rem;
    }

    .card {
        min-height: calc(100vh - 1rem);
        border-radius: 0px;
        padding: 1.25rem;
    }

    .brand {
        margin-bottom: 2rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .field-full {
        grid-column: auto;
    }

    button,
    .button-link {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.hp-field {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.section-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.section-divider::before,
.section-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.button-secondary {
    background: transparent;
    border: 1px solid var(--cyan);
    color: var(--cyan);
}

.button-secondary:hover {
    background: #22d3ee;
    color: #02080d;
}

.request-id-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.request-id-row code {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.request-id-row .copy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    height: auto;

    padding: 0.25rem 0.5rem;

    border: 1px solid rgba(34, 211, 238, 0.25);
    background: transparent;
    color: var(--muted);

    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;

    cursor: pointer;
}

.request-id-row .copy-button:hover {
    border-color: var(--cyan);
    background: rgba(34, 211, 238, 0.06);
    color: var(--cyan);
}

.access-box {
    margin: 1.5rem 0;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.18);
}

.access-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0.6rem 0.8rem;

    border-bottom: 1px solid var(--border);

    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.access-box pre {
    margin: 0;
    padding: 1rem;

    background: transparent;
    color: var(--cyan);

    font-family: monospace;
    font-size: 0.9rem;
    line-height: 1.8;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
