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

/* ===== Brand tokens — change colors here ===== */
:root {
  --brand: #3ec1f3;        /* The Ultimate Sweat sky blue */
  --brand-deep: #0b7fb0;
  --brand-soft: #e6f7fe;
  --ink: #0b0b0c;
  --bg: #ffffff;
  --panel: #f5f6f7;
  --line: #e2e4e7;
  --muted: #6a6f77;
  --ok: #15803d;
  --ok-soft: #e8f6ed;
  --warn: #b45309;
  --warn-soft: #fdf3e2;
  --bad: #c62828;
  --bad-soft: #fdecec;
  --font-body: Inter, system-ui, -apple-system, sans-serif;
  --font-head: "Barlow Condensed", Impact, "Arial Narrow", sans-serif;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-deep); }
img { max-width: 100%; }

h1, h2, h3, .head { font-family: var(--font-head); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; line-height: 1.05; margin: 0; }
h1 { font-size: clamp(34px, 6vw, 52px); }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* ===== Top bar ===== */
.topbar { background: var(--ink); color: #fff; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--font-head); font-size: 20px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.brand img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #fff; }
.brand-sub { font-family: var(--font-head); letter-spacing: .14em; text-transform: uppercase; color: var(--brand); font-size: 15px; font-weight: 600; }
html.embedded .topbar { display: none; }

.wrap { max-width: 860px; margin: 0 auto; padding: 32px 16px 64px; }
html.embedded .wrap { padding-top: 8px; }

/* ===== Check my request ===== */
.lookup { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 12px; }
.lookup-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; font-size: 14px; }
.lookup-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.lookup-form input { background: #fff; }

/* ===== Spot price strip ===== */
.spot-strip { display: flex; align-items: center; gap: 6px 16px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px; margin-bottom: 18px; font-size: 14px; background: #fff; }
.spot-strip.locked { background: var(--brand-soft); border-color: transparent; color: var(--brand-deep); }
.spot-title { font: 700 14px var(--font-head); letter-spacing: .14em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 6px; }
.spot-title .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.spot-chip { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; color: var(--ink); }
.spot-chip abbr { text-decoration: none; color: var(--brand-deep); font-weight: 700; margin-right: 2px; }
.spot-note { color: var(--muted); font-size: 12.5px; }
.spot-strip.locked .spot-note { color: var(--brand-deep); opacity: .85; }
@media (max-width: 520px) { .spot-note { flex-basis: 100%; } }

/* ===== Hero ===== */
.hero { text-align: center; padding: 8px 0 24px; }
.hero h1 span { color: var(--brand); text-shadow: 0 0 18px rgba(62,193,243,.35); }
.hero p { max-width: 560px; margin: 12px auto 0; color: var(--muted); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0; }
.step { background: var(--panel); border-radius: var(--radius); padding: 16px; }
.step b { display: block; font-family: var(--font-head); font-size: 34px; color: var(--brand); line-height: 1; }
.step strong { display: block; font-family: var(--font-head); text-transform: uppercase; letter-spacing: .06em; font-size: 18px; margin: 6px 0 2px; }
.step span { color: var(--muted); font-size: 13px; }
@media (max-width: 640px) { .steps { grid-template-columns: 1fr; } }

.rules { border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 28px; font-size: 14px; }
.rules ul { margin: 6px 0 0; padding-left: 18px; }
.rules li { margin: 3px 0; }

/* ===== Form sections ===== */
.section { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; background: #fff; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.section-num { font-family: var(--font-head); font-weight: 700; font-size: 28px; color: var(--brand); }
.section-head p { margin: 0; color: var(--muted); font-size: 13px; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
@media (max-width: 640px) { .grid, .grid.three { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } }

label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
label.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
label.field .hint.known { color: var(--ok); font-weight: 600; }
.opt { font-weight: 400; color: var(--muted); }
input, select, textarea {
  font: inherit; font-size: 15px; color: var(--ink); background: #fff;
  border: 1px solid #cfd3d8; border-radius: 8px; padding: 10px 12px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(62,193,243,.25); }
input.invalid, select.invalid, textarea.invalid { border-color: var(--bad); }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 10px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--ink); }

/* Segmented toggle */
.seg { display: inline-flex; border: 1px solid var(--ink); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 8px 18px; font: 600 14px var(--font-body); cursor: pointer; color: var(--ink); }
.seg button.on { background: var(--ink); color: #fff; }

/* Item cards */
.item { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.item-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.item-title { font-family: var(--font-head); font-size: 20px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.item input, .item select, .item textarea { background: #fff; }

.photos { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.thumb { position: relative; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; cursor: pointer; font-size: 13px; line-height: 22px; padding: 0; }
.add-photo { width: 72px; height: 72px; border: 1.5px dashed #b9bec5; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); cursor: pointer; background: #fff; }
.add-photo:hover { border-color: var(--brand); color: var(--brand-deep); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid var(--ink); background: var(--ink); color: #fff; border-radius: 8px; padding: 12px 22px; font: 700 16px var(--font-head); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; text-decoration: none; transition: transform .1s, background .15s, box-shadow .15s; }
.btn:hover { box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: #fff; color: var(--ink); }
.btn.brand { background: var(--brand); border-color: var(--brand); color: var(--ink); }
.btn.ok { background: var(--ok); border-color: var(--ok); }
.btn.bad { background: #fff; color: var(--bad); border-color: var(--bad); }
.btn.sm { padding: 7px 12px; font-size: 14px; }
.btn.block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; padding: 0; }
.link-btn:hover { color: var(--bad); }

.add-item { width: 100%; border: 1.5px dashed #b9bec5; background: #fff; color: var(--ink); border-radius: var(--radius); padding: 14px; font: 600 16px var(--font-head); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.add-item:hover { border-color: var(--brand); color: var(--brand-deep); }

.alert { border-radius: 8px; padding: 12px 14px; font-size: 14px; margin: 12px 0; }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.info { background: var(--brand-soft); color: var(--brand-deep); }

.spinner { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== ID upload ===== */
.id-box { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.id-add { width: 220px; height: 140px; font-size: 13px; gap: 4px; }
.id-add.invalid { border-color: var(--bad); color: var(--bad); }
.id-preview { width: 220px; }
.id-preview img { width: 220px; height: 140px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.id-preview .link-btn { margin-top: 6px; }
.id-tips { margin: 0; padding-left: 18px; flex: 1; min-width: 200px; line-height: 1.6; }

/* ===== Status page ===== */
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: #fff; margin-bottom: 18px; }
.badge { display: inline-block; font: 600 12px var(--font-body); padding: 4px 10px; border-radius: 99px; background: var(--panel); color: var(--ink); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.badge.submitted { background: #eef0f3; }
.badge.offer_sent { background: var(--brand-soft); color: var(--brand-deep); }
.badge.accepted { background: var(--ok-soft); color: var(--ok); }
.badge.paid { background: var(--ok); color: #fff; }
.badge.declined, .badge.expired { background: var(--warn-soft); color: var(--warn); }
.badge.shipped { background: var(--ink); color: #fff; }
.badge.cancelled { background: var(--warn-soft); color: var(--warn); }
.badge.closed { background: var(--bad-soft); color: var(--bad); }

.progress { display: flex; gap: 6px; margin: 18px 0 6px; }
.progress div { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.progress div.on { background: var(--brand); }
.progress-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

.lines { width: 100%; border-collapse: collapse; font-size: 14px; }
.lines th { text-align: left; font: 600 12px var(--font-body); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 0; border-bottom: 2px solid var(--ink); }
.lines td { padding: 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.lines .r { text-align: right; white-space: nowrap; padding-left: 12px; }
.lines tfoot td { border: 0; font-weight: 700; font-size: 18px; padding-top: 14px; }
.lines .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.big-total { font-family: var(--font-head); font-size: 48px; font-weight: 700; letter-spacing: .02em; line-height: 1; }
.timer { font-variant-numeric: tabular-nums; font-weight: 600; }
.choice-row { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.choice-row.keep .choice-price { color: var(--muted); text-decoration: line-through; }
.choice-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.choice-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.choice-row .seg button { padding: 6px 14px; }
.choice-row .seg button:disabled { opacity: .35; cursor: not-allowed; }
.choice-row.sell .seg button.on { background: var(--ok); border-color: var(--ok); }
.choice-sum { margin-top: 14px; padding: 12px 14px; background: var(--panel); border-radius: 8px; font-size: 15px; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
@media (max-width: 520px) { .choice { grid-template-columns: 1fr; } }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal-box { background: #fff; border-radius: 14px; padding: 24px; max-width: 440px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-box h3 { margin-bottom: 10px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

/* Invoice */
.invoice { border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; background: #fff; }
.inv-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; border-bottom: 3px solid var(--ink); padding-bottom: 18px; margin-bottom: 18px; }
.inv-head h2 { font-size: 28px; }
.inv-head > div:first-child { flex: 1 1 260px; }
.inv-meta { text-align: right; font-size: 14px; }
.inv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; font-size: 14px; margin-bottom: 18px; }
.inv-cols h4 { margin: 0 0 4px; font: 600 12px var(--font-body); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
@media (max-width: 520px) { .inv-cols { grid-template-columns: 1fr; } .inv-meta { text-align: left; } }

@media print {
  body * { visibility: hidden; }
  .invoice, .invoice * { visibility: visible; }
  .invoice { position: absolute; left: 0; top: 0; width: 100%; border: 0; padding: 0; }
}
