:root {
    --bg: #0e0f12;
    --card: #16181d;
    --card-edge: #1f2229;
    --line: #262a33;
    --txt: #e8eaef;
    --muted: #8b93a3;
    --accent: #38c172;
    --accent-2: #2ecc71;
    --warn: #f1c40f;
    --err: #e74c3c;
    --blue: #3498db;
    --input-bg: #1b1e25;
    --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    background: radial-gradient(1200px 800px at 50% -10%, #1a1d24 0%, var(--bg) 60%);
    color: var(--txt);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.card {
    width: 100%;
    max-width: 420px;
    background: linear-gradient(180deg, #191c22 0%, var(--card) 100%);
    border: 1px solid var(--card-edge);
    border-radius: var(--radius);
    padding: 28px 26px;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .03);
    position: relative;
    overflow: hidden;
}
.card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--accent) 0%, #1f8a4c 100%);
    border-radius: var(--radius) 0 0 var(--radius);
    opacity: .9;
}

.logo {
    font-size: 13px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 18px;
    font-weight: 600;
}

h1 {
    font-size: 21px;
    line-height: 1.25;
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: .01em;
}

.sub {
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.55;
    margin-bottom: 20px;
}
.sub b { color: var(--warn); }

/* ---------------- form ---------------- */
form { display: flex; flex-direction: column; gap: 16px; }

label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 12.5px;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: .02em;
}

input, select {
    font-family: inherit;
    font-size: 15px;
    color: var(--txt);
    background: var(--input-bg);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 13px 14px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
}
input:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(56, 193, 114, .18);
    background: #20242d;
}
select {
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    cursor: pointer;
}
select option { background: var(--card); color: var(--txt); }

.usn-row { display: flex; align-items: center; }
.usn-at {
    padding: 0 10px 0 13px;
    color: var(--muted);
    font-size: 15px;
    background: var(--input-bg);
    border: 1px solid var(--line);
    border-right: none;
    border-radius: 10px 0 0 10px;
}
.usn-row input { border-radius: 0 10px 10px 0; }
.usn-row input:focus { border-radius: 0 10px 10px 0; }

/* ---------------- buttons ---------------- */
button {
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .01em;
    color: #fff;
    background: linear-gradient(180deg, #40d487 0%, var(--accent) 100%);
    border: none;
    border-radius: 11px;
    padding: 14px 16px;
    cursor: pointer;
    transition: transform .08s ease, box-shadow .15s ease, filter .15s ease, opacity .15s ease;
    box-shadow: 0 10px 22px -10px rgba(46, 204, 113, .6);
    position: relative;
    width: 100%;
}
button:hover { filter: brightness(1.07); }
button:active { transform: translateY(1px) scale(.995); }
button:disabled { opacity: .5; cursor: not-allowed; filter: grayscale(.3); transform: none; }

button.ghost {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
    box-shadow: none;
    margin-top: 10px;
    font-weight: 600;
    font-size: 13.5px;
    padding: 12px;
}
button.ghost:hover { border-color: var(--accent); color: var(--txt); filter: none; }

/* ---------------- error ---------------- */
.err {
    background: rgba(231, 76, 60, .12);
    border: 1px solid rgba(231, 76, 60, .4);
    color: #ff9d92;
    font-size: 13px;
    line-height: 1.5;
    border-radius: 10px;
    padding: 12px 14px;
    animation: shake .3s ease;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* ---------------- ticket id ---------------- */
.ticket-id {
    margin-top: 22px;
    text-align: center;
    color: #4c5566;
    font-size: 11px;
    letter-spacing: .12em;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}

/* ---------------- spinner ---------------- */
.spinner-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0 22px;
}
.spinner {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .07);
    border-top-color: var(--accent);
    border-right-color: rgba(56, 193, 114, .35);
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .spinner { animation-duration: 1.6s; }
}

/* ---------------- otp code boxes ---------------- */
.otp-row {
    display: flex;
    gap: 9px;
    margin-bottom: 20px;
    justify-content: center;
}
.otp-row input {
    width: 100%;
    max-width: 52px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    padding: 14px 0;
    letter-spacing: .05em;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    border-radius: 10px;
}

/* ---------------- badges ---------------- */
.ok-badge, .ko-badge {
    font-size: 46px;
    text-align: center;
    padding: 6px 0 18px;
    animation: pop .4s ease;
}
.ok-badge { filter: drop-shadow(0 6px 16px rgba(46, 204, 113, .5)); }
.ko-badge { filter: drop-shadow(0 6px 16px rgba(231, 76, 60, .5)); }
@keyframes pop {
    0% { transform: scale(.4); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* ---------------- section fade ---------------- */
section { animation: fade .28s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------- small screens ---------------- */
@media (max-width: 440px) {
    .card { padding: 22px 18px; }
    h1 { font-size: 19px; }
    .otp-row { gap: 6px; }
    .otp-row input { max-width: 42px; }
}
