:root {
  --blue: #3f67e8;
  --blue-dark: #2748b8;
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --surface: #ffffff;
  --bg: #f5f7fb;
  --green: #067647;
  --red: #b42318;
  --amber: #b54708;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); line-height: 1.5; }
button, input, select { font: inherit; }
.topbar { min-height: 76px; padding: 12px clamp(20px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; background: #0c1428; color: #fff; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 48px; height: 48px; object-fit: contain; border-radius: 10px; background: var(--blue); }
.brand strong, .brand span { display: block; }
.brand span { color: #aebbea; font-size: 13px; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 48px 0 64px; }
.hero { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: end; padding: 14px 0 36px; }
.hero.compact { grid-template-columns: 1fr; max-width: 760px; margin: 0 auto; }
.hero h1, .login-card h1 { margin: 4px 0 12px; font-size: clamp(30px, 4vw, 50px); line-height: 1.08; letter-spacing: -0.035em; }
.hero p { margin: 0; color: var(--muted); font-size: 17px; }
.eyebrow { margin: 0; color: var(--blue); font-weight: 800; font-size: 12px; letter-spacing: .12em; }
.status-card { min-width: 260px; padding: 20px; border-radius: 18px; background: linear-gradient(135deg, #edf2ff, #fff); border: 1px solid #d8e1ff; }
.status-card span, .status-card strong { display: block; }
.status-card span { margin-top: 8px; color: var(--muted); font-size: 12px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: 0 10px 30px rgba(16, 24, 40, .05); }
.card h2 { margin: 12px 0 6px; font-size: 21px; }
.card p { margin: 0 0 18px; color: var(--muted); }
.step-number { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--blue); color: #fff; font-weight: 800; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 15px; border: 0; border-radius: 11px; font-weight: 750; text-decoration: none; cursor: pointer; transition: transform .15s ease, opacity .15s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--blue); color: #fff; }
.button.secondary { background: #0c1428; color: #fff; }
.button.danger { background: var(--red); color: #fff; }
.button.ghost { color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); }
.button.ghost-dark { color: var(--ink); background: #fff; border: 1px solid var(--line); margin-top: 14px; }
.full-button { width: 100%; margin-top: 16px; }
label { display: block; color: #344054; font-size: 14px; font-weight: 650; }
input[type="text"], input[type="password"], input:not([type]), select { width: 100%; margin-top: 7px; padding: 11px 12px; border: 1px solid #d0d5dd; border-radius: 10px; outline: none; background: #fff; }
input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(63,103,232,.14); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
.setup-card { max-width: 760px; margin: 0 auto; }
.auth-wrap { min-height: 65vh; display: grid; place-items: center; }
.login-card { width: min(420px, 100%); }
.login-card h1 { font-size: 34px; }
.login-card label { margin-top: 20px; }
.help { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
details { margin: 14px 0; }
summary { color: var(--blue-dark); font-weight: 700; cursor: pointer; }
.alert { margin: 0 0 20px; padding: 15px 18px; border-radius: 12px; border: 1px solid; }
.alert.success { background: #ecfdf3; color: var(--green); border-color: #abefc6; }
.alert.error { background: #fef3f2; color: var(--red); border-color: #fecdca; }
.alert ul { margin: 8px 0 0; padding-left: 20px; }
.account-form { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.account-option { display: flex; gap: 10px; padding: 10px; margin: 8px 0; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.account-option input { margin-top: 4px; }
.account-option span, .account-option strong, .account-option small { display: block; }
.account-option small { color: var(--muted); font-weight: 500; }
.selected-account { margin-top: 16px !important; padding: 10px; background: #ecfdf3; border-radius: 10px; color: var(--green) !important; }
.settings-panel { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.settings-form { margin-top: 12px; }
.settings-form label { margin-bottom: 12px; }
.upload-form { display: grid; gap: 14px; }
.file-picker { padding: 18px; border: 1px dashed #98a2b3; border-radius: 12px; background: #f9fafb; }
.file-picker input { display: block; width: 100%; margin-top: 10px; font-weight: 400; }
code { padding: 2px 5px; border-radius: 5px; background: #eef2ff; color: var(--blue-dark); font-size: .9em; }
.job-status { display: inline-block; margin: 10px 0; padding: 5px 9px; border-radius: 999px; background: #eef2ff; color: var(--blue-dark); font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.job-status.scheduled { background: #ecfdf3; color: var(--green); }
.job-status.validation_failed { background: #fef3f2; color: var(--red); }
.summary-list { margin: 6px 0 0; }
.summary-list div { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.summary-list dt { color: var(--muted); }
.summary-list dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.match-list { max-height: 250px; overflow: auto; margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; }
.match-list div { display: grid; grid-template-columns: 30px 1fr; gap: 2px 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.match-list div:last-child { border-bottom: 0; }
.match-list span { grid-row: span 2; display: grid; place-items: center; color: var(--blue); font-weight: 800; }
.match-list small { color: var(--muted); }
.inline-warning { margin-top: 12px; padding: 10px; border-radius: 10px; background: #fffaeb; color: var(--amber); font-size: 13px; }
.inline-warning ul { margin: 6px 0 0; padding-left: 18px; }
.action-form { margin-top: 14px; }
.danger-zone { margin-top: 16px; padding: 14px; border: 1px solid #fecdca; border-radius: 12px; background: #fff7f6; }
.danger-zone p { margin: 5px 0 10px; }
.confirm-check { display: flex; gap: 8px; margin-bottom: 12px; font-size: 13px; }
.confirm-check input { margin-top: 4px; }
.success-note { margin-top: 14px !important; padding: 12px; border-radius: 10px; background: #ecfdf3; color: var(--green) !important; font-weight: 700; }
footer { padding: 24px; text-align: center; color: var(--muted); font-size: 13px; }

@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .status-card { min-width: 0; }
}

@media (max-width: 600px) {
  .container { width: min(100% - 22px, 1180px); padding-top: 28px; }
  .topbar { padding: 10px 14px; }
  .brand span { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .card { padding: 18px; }
}
