:root {
    color-scheme: light;
    --text: #f4f7fb;
    --muted: rgba(244, 247, 251, 0.74);
    --accent: #1da1ff;
    --accent-dark: #0d84d6;
    --panel: rgba(12, 18, 26, 0.64);
    --border: rgba(255, 255, 255, 0.12);
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Georgia, "Times New Roman", serif;
    color: var(--text);
    background:
        linear-gradient(rgba(6, 10, 18, 0.7), rgba(6, 10, 18, 0.82)),
        url("assets/backgrounds/background-5-compressed.jpg") center / cover no-repeat fixed,
        radial-gradient(circle at center, rgba(39, 64, 92, 0.52), rgba(4, 7, 11, 0.96) 62%, #020304 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(1, 3, 7, 0.05), rgba(1, 3, 7, 0.34) 50%, rgba(1, 3, 7, 0.68) 100%);
    opacity: 1;
    pointer-events: none;
}

.page {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 24px;
}

.lookup-shell {
    width: min(100%, 900px);
    position: relative;
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 18px;
    z-index: 1;
}

.logo-head {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
}

.site-logo {
    display: block;
    width: min(100%, 340px);
    height: auto;
    object-fit: contain;
    filter: brightness(0) invert(1) drop-shadow(0 10px 30px rgba(0, 0, 0, 0.34));
}

.hero-copy {
    display: grid;
    gap: 0;
    max-width: 760px;
}

.hero-title {
    margin: 0;
    padding: 14px 0 12px;
    font-size: clamp(2.6rem, 6vw, 4.5rem);
    line-height: 0.95;
    font-weight: 700;
    color: #ffffff;
}

.panel {
    width: min(100%, 720px);
    padding: 40px;
    border: 1px solid var(--border);
    border-radius: 28px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.admin-panel {
    width: min(100%, 760px);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
}

.ghost-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.58);
}

.eyebrow {
    margin: 0 0 12px;
    font-size: 0.75rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--accent);
}

h1,
h2 {
    margin: 0;
}

.lead {
    margin: 16px 0 28px;
    color: var(--muted);
    line-height: 1.6;
}

.lookup-form {
    display: grid;
    gap: 0;
    width: min(100%, 760px);
}

.input-action-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px;
    gap: 0;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 22px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: var(--shadow);
}

.lookup-form label,
.result-card dl div {
    display: grid;
    gap: 8px;
}

.lookup-form span,
dt {
    font-size: 0.95rem;
    font-weight: 700;
}

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

input {
    width: 100%;
    padding: 20px 24px;
    border: 0;
    border-radius: 0;
    font: inherit;
    color: var(--text);
    background: rgba(255, 255, 255, 0.18);
}

input::placeholder {
    color: rgba(244, 247, 251, 0.56);
}

select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    font: inherit;
    background: #fffdfa;
}

button {
    padding: 14px 18px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-weight: 700;
    color: #fffaf5;
    background: var(--accent);
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease;
}

.search-submit {
    width: 100%;
    height: 100%;
    padding: 0 18px;
    display: grid;
    place-items: center;
    border-radius: 0;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.94);
    color: #07111c;
}

.search-submit svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.loading-text {
    display: none;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.82rem;
}

body.is-loading .search-submit {
    background: rgba(255, 255, 255, 0.72);
    cursor: wait;
}

body.is-loading .search-submit svg {
    display: none;
}

body.is-loading .loading-text {
    display: block;
}

button:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

.alert,
.result-card {
    margin-top: 24px;
    padding: 18px 20px;
    border-radius: 22px;
    border: 1px solid var(--border);
    background: rgba(14, 21, 31, 0.74);
    box-shadow: var(--shadow);
}

.success {
    color: #d8ffe0;
    background: rgba(53, 112, 66, 0.24);
}

.error {
    color: #ffd9d3;
    background: rgba(137, 45, 30, 0.32);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.template-box {
    margin: 10px 0 24px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
}

.template-box p,
.field-note {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.field-note {
    margin-top: -4px;
    font-size: 0.92rem;
}

.stat-card {
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
}

.stat-card span {
    display: block;
    font-size: 0.9rem;
    color: var(--muted);
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 1.9rem;
}

.result-card dl {
    margin: 20px 0 0;
    display: grid;
    gap: 16px;
}

.counter-only-card {
    text-align: center;
    width: min(100%, 760px);
    padding: 28px 24px 34px;
    background: linear-gradient(180deg, rgba(14, 20, 30, 0.9), rgba(10, 15, 24, 0.88));
    border-color: rgba(255, 255, 255, 0.1);
}

.counter-output {
    font-size: clamp(5rem, 15vw, 8rem);
    font-weight: 700;
    line-height: 0.92;
    letter-spacing: 0.04em;
    color: #fff7ef;
    text-shadow:
        0 0 18px rgba(255, 210, 160, 0.16),
        0 0 42px rgba(255, 160, 110, 0.18);
}

.scan-label {
    margin: 0 0 16px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.42em;
    text-transform: uppercase;
    color: rgba(255, 231, 205, 0.7);
}

dd {
    margin: 0;
    color: var(--muted);
}

@media (max-width: 640px) {
    .lookup-shell {
        width: 100%;
        gap: 14px;
    }

    .logo-head {
        margin: 0;
    }

    .site-logo {
        width: min(100%, 280px);
    }

    .hero-title {
        padding: 10px 0 10px;
    }

    .input-action-row {
        grid-template-columns: minmax(0, 1fr);
        border-radius: 18px;
    }

    .search-submit {
        min-height: 60px;
        border-top: 1px solid rgba(7, 17, 28, 0.08);
    }

    input {
        padding: 18px 18px;
    }
}
