:root {
  --bg: linear-gradient(160deg, #f8fbff 0%, #f0f4ff 45%, #effaf9 100%);
  --card: #ffffff;
  --ink: #132240;
  --muted: #58627a;
  --line: #dce2ef;
  --accent: #2d67ff;
  --accent-2: #3cb4ff;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, Segoe UI, Arial, sans-serif; color: var(--ink); background: var(--bg); }
.admin-wrap { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.site-header { padding: 20px 24px; background: rgba(255,255,255,0.7); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; gap: 12px; font-size: 14px; align-items: baseline; }
.brand strong { font-size: 18px; }
.brand span { color: var(--muted); }
.session-chip { color: var(--muted); }
.container { width: min(980px, 100%); margin: 0 auto; padding: 24px; display: grid; gap: 16px; }
.auth-panel, .panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: 0 12px 40px rgba(23,42,89,0.08); }
h1, h2 { margin-top: 0; }
.muted { color: var(--muted); margin: 6px 0 16px; }
label { display: block; margin-bottom: 14px; color: #21335b; font-weight: 600; }
input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; margin-top: 7px; }
button { background: linear-gradient(120deg, var(--accent), var(--accent-2)); border: 0; color: white; padding: 11px 16px; border-radius: 9px; font-weight: 700; cursor: pointer; }
button:hover { filter: brightness(1.05); }
.password-row { display: flex; gap: 10px; align-items: center; }
.password-row input { flex: 1; }
.link-like { background: transparent; color: var(--accent); border: 0; padding: 10px; font-weight: 700; }
.alerts { display: grid; gap: 10px; margin-bottom: 12px; }
.alert { border: 1px solid var(--line); border-left: 4px solid #4d5d78; background: #f5f7fb; padding: 10px 12px; border-radius: 8px; }
.alert-error { border-left-color: #e45858; background: #fff3f3; }
.alert-success { border-left-color: #2f8c4b; background: #f1fff4; }
.admin-grid { display: grid; gap: 16px; }
.stats { list-style: none; padding: 0; margin: 0; }
.stats li { margin-bottom: 8px; }
.card-list { display: grid; gap: 10px; }
.card-list .card-link { text-decoration: none; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: #1a2d66; display: block; }
.card-list .card-link:hover { border-color: var(--accent); }

.landing-page {
    margin: 0;
    color: #faf4ff;
    background: linear-gradient(180deg, rgba(6, 3, 24, 0.2), rgba(5, 2, 18, 0.52)), var(--landing-bg) center / cover no-repeat;
}

.landing-main {
    min-height: 100vh;
    padding: 18px 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: column;
    box-sizing: border-box;
}

.landing-login-shell {
    width: min(960px, 100%);
    padding: 14px;
    margin: 0 16px 16px;
    border-radius: 16px;
    transform: translateY(-4vh);
    background: rgba(255, 255, 255, 0.06);
    border: 0;
    backdrop-filter: blur(12px);
    box-shadow: 0 -1px 35px rgba(8, 5, 23, 0.65);
}

.landing-title {
    width: min(960px, 100%);
    margin: 0 16px;
    transform: translateY(8vh);
    font-family: "Avenir Next", "Avenir", "Gill Sans", "Gill Sans MT", "Segoe UI Light", "Segoe UI", "Helvetica Neue", sans-serif;
    color: #f8ecff;
    text-align: center;
    font-size: clamp(1.45rem, 3.4vw, 2.1rem);
    opacity: 0.45;
    letter-spacing: 0.045em;
    text-shadow: 0 2px 22px rgba(8, 5, 23, 0.72);
    font-weight: 100;
}

.landing-login-form {
    display: grid;
    gap: 8px;
}

.field-row {
    display: grid;
    gap: 10px;
}

.field-row.compact {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    justify-content: center;
}

.landing-login-form .text-input {
    margin-top: 0;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(8, 6, 22, 0.44);
    color: #f7f2ff;
    height: 44px;
}

.field-row.compact .text-input {
    min-width: 0;
    flex: 0 1 240px;
    width: 240px;
    max-width: 40vw;
}

.landing-login-form .text-input::placeholder {
    color: rgba(220, 214, 255, 0.68);
}

.landing-login-form .link-like {
    color: #c8b7ff;
    border-color: rgba(200, 183, 255, 0.28);
    white-space: nowrap;
    height: 44px;
    margin-top: 0;
    padding: 0 12px;
}

.landing-submit {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 38%, #22d3ee 100%);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 10px 22px rgba(88, 68, 255, 0.32), 0 2px 6px rgba(12, 9, 38, 0.2);
    padding: 11px 24px;
    height: 44px;
    border-radius: 12px;
    white-space: nowrap;
    margin-top: 0;
    flex: 0 0 auto;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.landing-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(88, 68, 255, 0.38), 0 4px 10px rgba(12, 9, 38, 0.2);
    filter: saturate(118%);
}

.landing-login-shell .alerts {
    margin-bottom: 10px;
}

.landing-login-shell .alert {
    border-left-color: rgba(255, 255, 255, 0.32);
    background: rgba(18, 14, 31, 0.7);
    color: #ffe7ef;
}

.landing-login-shell .alert-error {
    border-left-color: #ff5f5f;
    background: rgba(84, 15, 20, 0.45);
    color: #ffd8de;
}

@media (max-width: 700px) {
    .landing-login-shell {
        border-radius: 14px;
        padding: 10px;
        margin: 0 12px 12px;
    }

    .landing-title {
        width: min(960px, 100%);
        margin: 0 12px;
        font-size: clamp(1.35rem, 7vw, 1.8rem);
    }

    .field-row.compact {
        gap: 6px;
    }

    .field-row.compact .text-input {
        flex-basis: 140px;
    }
}

@media (max-width: 640px) { .container { padding: 16px; } .site-header { padding: 14px; } }


/* Landing gate: tiny, thin-lined, unassuming (disguised login). */
.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;
}

.landing-page .gate-wrap {
    position: fixed;
    left: 50%;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    width: min(520px, calc(100% - 34px));
    z-index: 35;
}

.landing-page .gate {
    position: relative;
    margin: 0;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(7, 6, 16, 0.30);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.62);
}

.landing-page .gate:focus-within {
    border-color: rgba(170, 150, 255, 0.38);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.62), 0 0 0 3px rgba(170, 150, 255, 0.12);
}

.landing-page .gate input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.74);
    font-family: "Avenir Next", "Avenir", "Gill Sans", "Gill Sans MT", "Segoe UI", "Helvetica Neue", sans-serif;
    font-size: 0.62rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    padding: 6px 6px;
    min-width: 0;
}

.landing-page .gate input::placeholder {
    color: rgba(255, 255, 255, 0.34);
}

.landing-page .gate-go {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.70);
    cursor: pointer;
    user-select: none;
}

.landing-page .gate-go svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.landing-page .gate-go:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.08);
}

.landing-page .gate-go:active {
    transform: translateY(0px);
}

.landing-page .gate-status {
    position: absolute;
    right: 12px;
    top: calc(100% + 6px);
    font-size: 0.56rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    user-select: none;
    color: rgba(255, 255, 255, 0.30);
    text-shadow: 0 14px 34px rgba(0, 0, 0, 0.70);
}

.landing-page .gate-status:empty {
    display: none;
}

.landing-page .gate-status-error {
    color: rgba(255, 120, 120, 0.72);
}

@media (max-width: 440px) {
    .landing-page .gate-wrap {
        width: min(520px, calc(100% - 24px));
    }

    .landing-page .gate {
        padding: 8px 10px;
    }
}
