:root {
  color-scheme: dark;
  --ink: #0b0b0f;
  --panel: #151718;
  --panel-strong: #202322;
  --paper: #fffdf6;
  --muted: #b9b8ad;
  --line: rgba(255, 253, 246, .16);
  --brand-red: #c1002d;
  --brand-green: #b4cc00;
  --warm: #f0efe2;
  --amber: #f6b94a;
  --danger: #ff5a45;
  --shadow: 0 24px 60px rgba(0, 0, 0, .36);
  font-family: Arial, Helvetica, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--ink); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--paper);
  background:
    linear-gradient(135deg, rgba(193, 0, 45, .20), transparent 34%),
    linear-gradient(225deg, rgba(180, 204, 0, .16), transparent 30%),
    var(--ink);
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 253, 246, .15) 1px, transparent 0),
    linear-gradient(90deg, transparent 0 30%, rgba(180, 204, 0, .055) 30% 31%, transparent 31% 100%);
  background-size: 16px 16px, 100% 100%;
  opacity: .5;
}

button, input, textarea { font: inherit; }

.topbar {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 58px);
  border-bottom: 1px solid var(--line);
  background: rgba(11, 11, 15, .86);
  backdrop-filter: blur(14px);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--paper);
  text-decoration: none;
}

.brand-logo-shell, .login-logo-shell {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid var(--paper);
  border-radius: 8px;
  background: white;
  box-shadow: 5px 5px 0 var(--brand-green);
  overflow: hidden;
}

.brand-logo-shell { width: 124px; height: 58px; }
.brand-logo-shell img { width: 112px; max-height: 48px; }
.brand-copy strong, .brand-copy small { display: block; }
.brand-copy small {
  margin-bottom: 3px;
  color: var(--brand-green);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.brand-copy strong { font-size: 19px; line-height: 1; text-transform: uppercase; }

.text-button {
  padding: 10px 14px;
  color: var(--warm);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 246, .06);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}
.text-button:hover { color: var(--brand-green); border-color: rgba(180, 204, 0, .55); }

.page-shell {
  width: min(1040px, calc(100% - 36px));
  margin: 0 auto;
  padding: 68px 0 88px;
}

.hero { max-width: 900px; margin-bottom: 28px; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--brand-green);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .10em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 900px;
  margin-bottom: 14px;
  font-size: clamp(36px, 6vw, 62px);
  font-weight: 950;
  line-height: .96;
  letter-spacing: -.045em;
  text-transform: uppercase;
}
.hero > p:last-child, .lede {
  max-width: 790px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.import-card, .login-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(32, 35, 34, .98), rgba(20, 22, 22, .98));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.import-card { padding: 38px clamp(22px, 4vw, 42px) 34px; }
.card-stripe {
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: linear-gradient(90deg, var(--brand-red) 0 44%, var(--brand-green) 44% 78%, var(--paper) 78% 100%);
}

.import-card > label, .stack-form label {
  display: block;
  margin-bottom: 10px;
  color: var(--warm);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .07em;
  text-transform: uppercase;
}

textarea, input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--paper);
  background: rgba(11, 11, 15, .66);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea {
  min-height: 220px;
  padding: 17px 18px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  line-height: 1.65;
}
input { height: 48px; padding: 0 14px; }
textarea:focus, input:focus { border-color: var(--brand-green); box-shadow: 0 0 0 3px rgba(180, 204, 0, .12); }
textarea:disabled { color: var(--muted); background: rgba(11, 11, 15, .42); }

.input-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
}
#order-count { color: var(--brand-green); font-weight: 950; }
.over-limit { color: var(--danger) !important; }

.actions { display: flex; gap: 12px; margin-top: 25px; }
.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 950;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease, background .15s ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); }
.button:disabled { cursor: wait; opacity: .68; }
.button-primary { color: var(--ink); background: var(--brand-green); }
.button-secondary { color: var(--paper); border-color: var(--line); background: rgba(255, 253, 246, .07); }
.button-warning { color: var(--ink); background: var(--amber); }
.override-button { min-height: 42px; margin-top: 16px; padding: 0 16px; font-size: 11px; }

.spinner {
  width: 16px;
  height: 16px;
  display: none;
  border: 2px solid rgba(11, 11, 15, .25);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.safety-note { margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.safety-note span { margin-right: 5px; color: var(--brand-green); }

.results { scroll-margin-top: 32px; margin-top: 48px; }
.results-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
h2 { margin-bottom: 14px; font-size: 30px; font-weight: 950; text-transform: uppercase; }
.result-list { display: grid; gap: 10px; }
.result-card {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(32, 35, 34, .98), rgba(20, 22, 22, .98));
  overflow: hidden;
}
.result-card::before { position: absolute; inset: 0 auto 0 0; width: 4px; content: ""; background: var(--line); }
.result-success::before { background: var(--brand-green); }
.result-warning::before { background: var(--amber); }
.result-error::before { background: var(--danger); }
.result-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-weight: 950;
}
.result-success .result-icon { color: var(--brand-green); background: rgba(180, 204, 0, .08); }
.result-warning .result-icon { color: var(--amber); background: rgba(246, 185, 74, .08); }
.result-error .result-icon { color: var(--danger); background: rgba(255, 90, 69, .08); }
.result-card h3 { margin: 2px 0 5px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 15px; }
.result-card p { margin-bottom: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.result-details { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 13px; }
.result-details div { display: grid; gap: 2px; }
.result-details span { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.result-details strong { color: var(--warm); font-size: 13px; }

footer { padding: 0 20px 34px; color: #85857d; text-align: center; font-size: 11px; text-transform: uppercase; }

.login-page { min-height: 100vh; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 30px 20px; }
.login-card { width: min(470px, 100%); padding: 44px 38px 38px; }
.login-card::before { position: absolute; inset: 0 0 auto; height: 7px; content: ""; background: linear-gradient(90deg, var(--brand-red) 0 44%, var(--brand-green) 44% 78%, var(--paper) 78% 100%); }
.login-logo-shell { width: 148px; height: 68px; margin-bottom: 28px; }
.login-logo-shell img { width: 134px; max-height: 56px; }
.login-card h1 { margin-bottom: 12px; font-size: 42px; }
.login-card .lede { margin-bottom: 28px; font-size: 15px; }
.stack-form { display: grid; }
.stack-form label { margin: 15px 0 7px; }
.stack-form .button { width: 100%; margin-top: 23px; }
.login-actions { margin-top: 25px; }
.login-actions .button { width: 100%; }
.login-actions > p { margin: 15px 12px 0; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }
.microsoft-mark { width: 17px; height: 17px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.microsoft-mark i { display: block; background: var(--ink); }
.alert { margin: 18px 0; padding: 12px 14px; border-radius: 8px; font-size: 13px; line-height: 1.45; }
.alert-error { color: #ffd9d4; border: 1px solid rgba(255, 90, 69, .45); background: rgba(255, 90, 69, .1); }

@media (max-width: 680px) {
  .topbar { min-height: 74px; padding: 10px 14px; }
  .brand-logo-shell { width: 92px; height: 46px; box-shadow: 3px 3px 0 var(--brand-green); }
  .brand-logo-shell img { width: 84px; }
  .brand-copy small { display: none; }
  .brand-copy strong { font-size: 13px; }
  .page-shell { width: min(100% - 24px, 1040px); padding-top: 46px; }
  .actions { align-items: stretch; flex-direction: column; }
  .button { width: 100%; }
  .input-meta { align-items: end; flex-direction: column; gap: 4px; }
  .results-heading { align-items: start; }
  .login-card { padding: 40px 24px 30px; }
}
