:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #162033;
    --muted: #667085;
    --line: #d9e1ec;
    --primary: #2663eb;
    --primary-dark: #1747b8;
    --error: #b42318;
    --error-bg: #fff1f0;
    --success: #027a48;
    --success-bg: #ecfdf3;
    --shadow: 0 18px 50px rgba(22, 32, 51, 0.10);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, #e6efff 0, transparent 32%), var(--bg);
    color: var(--text);
}
a { color: inherit; }

.topbar {
    max-width: 1180px;
    margin: 28px auto 0;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.topbar h1 { margin: 2px 0 0; font-size: 30px; }
.eyebrow { color: var(--primary); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
nav { display: flex; gap: 10px; align-items: center; }
.user-pill { background: #e8eefc; padding: 9px 12px; border-radius: 999px; color: #254174; font-weight: 600; }

.container { max-width: 1180px; margin: 26px auto 60px; padding: 0 22px; }
.container.narrow { max-width: 760px; }
.hero, .hint-box, .upload-card, .card, .login-card {
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(217,225,236,.85);
    border-radius: 24px;
    box-shadow: var(--shadow);
}
.hero { padding: 34px; margin-bottom: 22px; }
.hero h2 { margin: 0 0 10px; font-size: 28px; }
.hero p, .card p, .muted { color: var(--muted); line-height: 1.55; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.card { padding: 24px; }
.card-icon { font-size: 28px; margin-bottom: 8px; }
.card h3 { margin: 0 0 8px; }
.card p { min-height: 52px; }
.hint-box { padding: 22px 26px; margin-top: 22px; }
code { background: #eef2f7; padding: 2px 6px; border-radius: 6px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 13px;
    padding: 11px 16px;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
    transition: transform .12s ease, background .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #edf2f7; color: #24344d; }
.btn-wide { width: 100%; margin-top: 18px; }
.btn[disabled] { opacity: .6; cursor: wait; transform: none; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); padding: 34px; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; background: var(--primary); color: #fff; font-weight: 900; margin-bottom: 16px; }
.login-card h1 { margin: 0 0 8px; }
label { display: block; margin: 16px 0 7px; font-weight: 700; }
input[type="text"], input[type="password"] {
    width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 16px;
}
.alert { padding: 12px 14px; border-radius: 12px; margin: 16px 0; }
.alert-error { color: var(--error); background: var(--error-bg); }

.upload-card { padding: 32px; }
.upload-card h2 { margin-top: 0; }
.dropzone {
    margin-top: 20px;
    border: 2px dashed #aab8cf;
    border-radius: 22px;
    min-height: 190px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    background: #f8fbff;
    cursor: pointer;
    padding: 24px;
}
.dropzone.dragover { border-color: var(--primary); background: #eef5ff; }
.dropzone input { display: none; }
.dropzone-title { font-size: 21px; font-weight: 800; }
.dropzone-subtitle { color: var(--muted); }
.file-name { margin-top: 8px; color: var(--primary); font-weight: 700; word-break: break-word; }
.status { margin-top: 18px; padding: 16px; border-radius: 14px; line-height: 1.45; white-space: pre-line; }
.status.ok { background: var(--success-bg); color: var(--success); }
.status.error { background: var(--error-bg); color: var(--error); }
.raw-result { margin-top: 14px; white-space: pre-wrap; background: #0f172a; color: #dbeafe; padding: 16px; border-radius: 14px; overflow: auto; max-height: 280px; }
.hidden { display: none; }

@media (max-width: 720px) {
    .topbar { align-items: flex-start; flex-direction: column; }
    nav { width: 100%; justify-content: space-between; }
}
