@import url('https://fonts.googleapis.com/css2?family=Saira+Condensed:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
    --bg:        #0A0C0F;
    --bg-2:      #0F1319;
    --panel:     #12171E;
    --panel-2:   #171D26;
    --line:      #222A34;
    --line-2:    #2E3A48;
    --ink:       #EAF0F6;
    --ink-dim:   #8A97A6;
    --ink-faint: #5B6673;
    --ignite:    #FF7A18;
    --ignite-2:  #FF9E2C;
    --redline:   #FF3B30;
    --match:     #37E0A6;
    --radius:    12px;
    --display:   'Saira Condensed', 'Arial Narrow', system-ui, sans-serif;
    --body:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --mono:      'JetBrains Mono', ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background:
        radial-gradient(1000px 480px at 50% -8%, rgba(255,122,24,0.07), transparent 55%),
        var(--bg);
    background-attachment: fixed;
    color: var(--ink);
    font-family: var(--body);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* Signature: a redline sweep across the very top of every page */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 2px;
    z-index: 100;
    background: linear-gradient(90deg,
        transparent 8%, rgba(255,122,24,0) 22%,
        var(--ignite) 44%, var(--redline) 50%, var(--ignite) 56%,
        rgba(255,122,24,0) 78%, transparent 92%);
    background-size: 250% 100%;
    animation: sweep 6.5s linear infinite;
}
@keyframes sweep {
    from { background-position: 130% 0; }
    to   { background-position: -130% 0; }
}

body.centered {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

a { color: var(--ignite); text-decoration: none; transition: color .15s; }
a:hover { color: var(--ignite-2); }

h1, h2 { font-family: var(--display); font-weight: 600; letter-spacing: .01em; }
h2 { font-size: 24px; margin: 0; text-transform: uppercase; }

.muted { color: var(--ink-dim); }
.small { font-size: 13px; }
.center { text-align: center; }
.mt { margin-top: 34px; }
code { font-family: var(--mono); background: var(--bg-2); padding: 1px 6px; border-radius: 5px; font-size: 13px; }
hr { border: none; border-top: 1px solid var(--line); margin: 22px 0; }

/* ---------- Card (public / login) ---------- */
.card {
    position: relative;
    background: linear-gradient(180deg, var(--panel), var(--bg-2));
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 34px;
    width: 100%;
    max-width: 470px;
    box-shadow: 0 24px 70px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.03);
    animation: riseIn .55s cubic-bezier(.2,.7,.2,1) both;
}
.card.narrow { max-width: 390px; }

.logo {
    font-family: var(--display);
    font-weight: 700;
    font-size: 30px;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin: 0 0 6px;
    text-align: center;
    line-height: 1.05;
}
.logo::after {
    content: '';
    display: block;
    width: 58px; height: 3px;
    margin: 10px auto 0;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--ignite), var(--redline));
    box-shadow: 0 0 14px rgba(255,122,24,.45);
}

/* ---------- Forms ---------- */
label {
    display: block;
    margin: 15px 0;
    font-size: 13px;
    color: var(--ink-dim);
    letter-spacing: .01em;
}
input[type=text], input[type=password], input[type=file], textarea, select {
    width: 100%;
    margin-top: 7px;
    padding: 11px 13px;
    background: var(--bg-2);
    border: 1px solid var(--line-2);
    border-radius: 9px;
    color: var(--ink);
    font-family: var(--body);
    font-size: 15px;
    transition: border-color .18s, box-shadow .18s, background .18s;
}
input[type=file] { padding: 9px; color: var(--ink-dim); }
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--ignite);
    box-shadow: 0 0 0 3px rgba(255,122,24,.14);
    background: #0c1116;
}
textarea { resize: vertical; }

label.check {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 12px 0 4px;
    color: var(--ink);
    font-size: 14px;
}
label.check input { width: auto; margin: 0; accent-color: var(--ignite); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

/* identifier / grouped boxes */
.ident-box {
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 15px 17px;
    margin: 17px 0;
    background: rgba(255,255,255,0.015);
}
.ident-title {
    font-family: var(--display);
    font-weight: 600;
    font-size: 16px;
    letter-spacing: .03em;
    text-transform: uppercase;
    margin-bottom: 5px;
}
.ident-box p { margin: 4px 0 8px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    background: linear-gradient(180deg, var(--ignite-2), var(--ignite));
    color: #1c0f00;
    border: none;
    border-radius: 9px;
    padding: 11px 20px;
    font-family: var(--body);
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: .01em;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 4px 16px rgba(255,122,24,0.24);
    transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
}
.btn:hover { color: #1c0f00; transform: translateY(-1px); box-shadow: 0 7px 22px rgba(255,122,24,0.4); filter: brightness(1.04); }
.btn:active { transform: translateY(0); box-shadow: 0 3px 12px rgba(255,122,24,0.3); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; filter: grayscale(.3); }
.btn.full { width: 100%; margin-top: 10px; }
.btn.small { padding: 8px 15px; font-size: 13.5px; }
.btn.tiny { padding: 6px 11px; font-size: 12.5px; border-radius: 7px; }

.btn.ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line-2);
    box-shadow: none;
}
.btn.ghost:hover { color: var(--ink); border-color: var(--ignite); background: rgba(255,122,24,0.06); box-shadow: none; filter: none; }

.btn.danger {
    background: linear-gradient(180deg, #FF5B52, var(--redline));
    color: #fff;
    box-shadow: 0 4px 16px rgba(255,59,48,0.24);
}
.btn.danger:hover { color: #fff; box-shadow: 0 7px 22px rgba(255,59,48,0.4); }

:focus-visible { outline: 2px solid var(--ignite); outline-offset: 2px; }

/* ---------- Messages ---------- */
.ok    { color: var(--match); font-size: 14px; }
.error { color: #FF9A8F; font-size: 14px; }
.notice { border-radius: 10px; padding: 17px; margin: 15px 0; }
.error-box { background: rgba(255,59,48,.09); border: 1px solid rgba(255,59,48,.32); }
.error-box strong { font-family: var(--display); letter-spacing: .03em; text-transform: uppercase; }
.error-box p { margin: 6px 0 0; }

/* ---------- Drop zone (gauge feel) ---------- */
.drop { margin-top: 20px; }
.drop-inner {
    border: 1.5px dashed var(--line-2);
    border-radius: 14px;
    padding: 38px 18px;
    text-align: center;
    cursor: pointer;
    background: radial-gradient(130% 130% at 50% 0%, rgba(255,122,24,0.05), transparent 62%);
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.drop-inner:hover { border-color: var(--ignite); box-shadow: inset 0 0 0 3px rgba(255,122,24,.07); }
.drop-inner.over { border-color: var(--ignite); animation: pulse 1.1s ease infinite; }
@keyframes pulse {
    0%, 100% { box-shadow: inset 0 0 0 3px rgba(255,122,24,.08); }
    50%      { box-shadow: inset 0 0 0 7px rgba(255,122,24,.16); }
}
.drop-icon { font-size: 28px; color: var(--ignite); margin-bottom: 8px; }
.drop-text { font-size: 15px; }

/* ---------- Result options ---------- */
.list { margin: 18px 0; display: flex; flex-direction: column; gap: 11px; }
.row {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    animation: riseIn .5s cubic-bezier(.2,.7,.2,1) both;
    transition: border-color .18s, transform .18s;
}
.row:hover { border-color: var(--line-2); transform: translateX(2px); }
.row-main { flex: 1 1 auto; min-width: 0; }
.row-action { flex: 0 0 auto; }
.row-title { font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: .02em; }
.row-sub { margin-top: 3px; }

.optnum {
    flex: 0 0 auto;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    width: 50px; height: 50px;
    border-radius: 11px;
    background: linear-gradient(180deg, var(--panel-2), var(--bg));
    border: 1px solid var(--line-2);
    box-shadow: inset 0 0 12px rgba(255,122,24,0.06);
}
.optnum-label { font-family: var(--mono); font-size: 9px; letter-spacing: 1.6px; color: var(--ink-faint); }
.optnum-n { font-family: var(--mono); font-weight: 700; font-size: 21px; line-height: 1; color: var(--ignite); }

/* ---------- Tags ---------- */
.tag {
    display: inline-block;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 3px 9px;
    border-radius: 999px;
}
.tag.ok        { background: rgba(55,224,166,.14); color: var(--match); }
.tag.warn      { background: rgba(255,158,44,.16); color: var(--ignite-2); }
.tag.muted-tag { background: var(--bg-2); color: var(--ink-dim); }

/* ---------- Admin layout ---------- */
.topbar {
    background: rgba(10,12,15,0.72);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 20;
}
.topbar-inner {
    max-width: 1020px; margin: 0 auto;
    padding: 0 22px; height: 60px;
    display: flex; align-items: center; justify-content: space-between;
}
.brand {
    font-family: var(--display);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.brand .muted { letter-spacing: .04em; }
.nav { display: flex; align-items: center; gap: 17px; font-size: 14px; }
.nav a { color: var(--ink-dim); position: relative; padding: 4px 0; }
.nav a:hover, .nav a.active { color: var(--ink); }
.nav a.active::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
    background: linear-gradient(90deg, var(--ignite), var(--redline)); border-radius: 2px;
}
.nav a.danger { color: #FF8A82; }

.wrap { max-width: 1020px; margin: 0 auto; padding: 30px 22px 64px; }

.pagehead {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
    animation: riseIn .45s ease both;
}

/* ---------- Panels & tables ---------- */
.panel {
    background: linear-gradient(180deg, var(--panel), var(--bg-2));
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 6px;
    overflow-x: auto;
    animation: riseIn .55s cubic-bezier(.2,.7,.2,1) both;
}
.panel.empty { padding: 30px; text-align: center; }
.form-panel { padding: 26px; }
.narrow-panel { max-width: 470px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td {
    text-align: left;
    padding: 13px 15px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.tbl thead th {
    color: var(--ink-dim); font-weight: 600; font-size: 11.5px;
    text-transform: uppercase; letter-spacing: .07em;
}
.tbl tbody tr { animation: riseIn .4s ease both; }
.tbl tbody tr:nth-child(1) { animation-delay: .03s; }
.tbl tbody tr:nth-child(2) { animation-delay: .06s; }
.tbl tbody tr:nth-child(3) { animation-delay: .09s; }
.tbl tbody tr:nth-child(4) { animation-delay: .12s; }
.tbl tbody tr:nth-child(5) { animation-delay: .15s; }
.tbl tbody tr:nth-child(6) { animation-delay: .18s; }
.tbl tbody tr:nth-child(7) { animation-delay: .21s; }
.tbl tbody tr:nth-child(8) { animation-delay: .24s; }
.tbl tr:last-child td, .tbl tbody tr:last-child td { border-bottom: none; }
.tbl .num { text-align: right; font-family: var(--mono); font-size: 13px; }
.tbl td.actions { white-space: nowrap; }
.tbl td.actions .btn { margin-left: 6px; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: var(--panel-2); }
.tbl td strong { font-weight: 600; }

/* ---------- Entrance ---------- */
@keyframes riseIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- Accessibility: honor reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .card, .panel, .pagehead, .row, .tbl tbody tr { opacity: 1 !important; transform: none !important; }
}
