/* TradePage customer portal — its own stylesheet, deliberately NOT the operator theme.
 *
 * The portal used to import /assets/theme.css, which is why it read as a quieter copy of the console:
 * same tokens, same density, same admin mood. This file replaces it end to end — fonts included — so the
 * surface a customer sees is a product page, not a control panel: warm paper, white cards with soft
 * elevation, a single confident accent, generous type, and no dark-mode chrome (customers never see the
 * console, so the console's toggled theme has nothing to hook into).
 *
 * The ssp-* class names are kept deliberately: they are already portal-specific and independent of the
 * console's markup, so this is a visual change without a risky markup sweep. The console token aliases
 * (--bg, --panel2, --acc) exist because existing portal markup and inline handlers read them; they resolve
 * to the customer palette here, which is what changes the look in one place.
 */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/inter-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('/assets/fonts/sora-latin.woff2') format('woff2');
}

:root {
  color-scheme: light;

  /* Palette: warm paper, near-black ink, one accent that matches the mark. */
  --paper: #fdf2e6;
  --card: #ffffff;
  --ink: #16202c;
  --muted: #667085;
  --line: #eae5dc;
  --brand: #f97316;
  --brand-strong: #ea580c;
  --brand-tint: #fff4ea;
  --ok: #027a48;
  --ok-tint: #ecfdf3;
  --bad: #b42318;
  --bad-tint: #fef3f2;
  --warn: #b54708;
  --warn-tint: #fffbeb;

  /* Aliases the existing portal markup and inline handlers already read from the console theme. */
  --bg: var(--paper);
  --panel2: var(--card);
  --acc: var(--brand);

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 28px -14px rgba(16, 24, 40, 0.18);
  --shadow-lift: 0 2px 4px rgba(16, 24, 40, 0.05), 0 18px 40px -18px rgba(16, 24, 40, 0.25);
  --max: 1240px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 400px at 50% -180px, var(--brand-tint), transparent 70%),
    var(--paper);
  color: var(--ink);
  font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Sora', 'Inter', sans-serif;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

a { color: var(--brand-strong); text-underline-offset: 2px; }
a:hover { color: var(--ink); }

::selection { background: var(--brand-tint); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---- shell ---------------------------------------------------------------------------- */

.ssp-wrap {
  max-width: var(--max);
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 20px 56px;
  display: flex;
  flex-direction: column;
}

.ssp-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  padding: 22px 0 18px;
  color: var(--ink);
}

.ssp-brand img { width: 26px; height: 26px; display: block; }

.ssp-main { flex: 1 0 auto; }

.ssp-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

/* ---- cards ---------------------------------------------------------------------------- */

.ssp-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-bottom: 18px;
}

.ssp-card h1 { font-size: 26px; margin: 0 0 6px; }

.ssp-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.ssp-title h2 { margin: 0; }

.ssp-domain {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.ssp-domain:last-of-type { border-bottom: 0; }
.ssp-card h2 { font-size: 19px; margin: 0 0 6px; }

.ssp-mini { color: var(--muted); font-size: 13.5px; margin: 0 0 14px; }

.ssp-lead { font-size: 17px; color: var(--muted); margin: 0 0 18px; }

/* ---- forms ---------------------------------------------------------------------------- */

label.ssp-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin: 14px 0 6px;
}

input, textarea, select {
  width: 100%;
  padding: 12px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 16px; /* never below 16: it stops iOS Safari zooming on focus */
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:hover, textarea:hover { border-color: #d8d2c6; }

input:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
}

textarea { resize: vertical; font-family: inherit; }

input::placeholder, textarea::placeholder { color: #98a2b3; }

/* ---- buttons -------------------------------------------------------------------------- */

button, .ssp-btn {
  display: inline-block;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: 0;
  background: var(--brand);
  color: #fff;
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 2px rgba(234, 88, 12, 0.25);
}

button:hover, .ssp-btn:hover { background: var(--brand-strong); }

button:active, .ssp-btn:active { transform: translateY(1px); }

button:disabled { opacity: 0.55; cursor: default; transform: none; }

.ssp-ghost {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 600;
  box-shadow: none;
}

.ssp-ghost:hover { background: var(--paper); border-color: #d8d2c6; }

.ssp-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }

/* ---- feedback ------------------------------------------------------------------------- */

.ssp-err { color: var(--bad); font-size: 14px; min-height: 20px; margin: 10px 0 2px; }

.ssp-ok {
  background: var(--ok-tint);
  border: 1px solid #abefc6;
  color: var(--ok);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14.5px;
  margin-top: 14px;
}

.ssp-note {
  background: var(--brand-tint);
  border: 1px solid #fed7aa;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14.5px;
  margin-top: 14px;
}

/* Status pills — the vocabulary the home page speaks. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.pill::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.pill-live { background: var(--ok-tint); color: var(--ok); border-color: #abefc6; }
.pill-wait { background: var(--warn-tint); color: var(--warn); border-color: #fedf89; }
.pill-draft { background: var(--brand-tint); color: var(--brand-strong); border-color: #fed7aa; }
.pill-off { background: var(--bad-tint); color: var(--bad); border-color: #fecdca; }

.ssp-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--paper);
}

.ssp-foot { color: var(--muted); font-size: 13px; margin-top: 26px; text-align: center; }

/* ---- first impression: sign-in and accept are centered, not full-width ---------------- */

.ssp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0 14px;
  border-bottom: 1px solid var(--line);
}

.ssp-nav .ssp-brand { padding: 18px 0 4px; margin: 0; }

.ssp-nav-right { display: flex; align-items: center; gap: 12px; }
.ssp-nav-right .ssp-mini { margin: 0; }

.ssp-header { margin: 18px 0 20px; }
.ssp-header h1 { font-size: 28px; margin: 0 0 4px; }
.ssp-header .ssp-mini { margin: 0; }
.ssp-centered .ssp-main { display: flex; align-items: center; }
.ssp-centered .ssp-card { width: 100%; max-width: 440px; margin: 0 auto; }
.ssp-centered .ssp-nav { justify-content: center; border-bottom: 0; }

@media (max-width: 560px) {
  .ssp-card { padding: 20px 18px; }
  .ssp-card h1 { font-size: 22px; }
  .ssp-footer { flex-direction: column; align-items: flex-start; gap: 6px; }
  .ssp-centered .ssp-brand { padding-top: 28px; }
}
/* ---- dashboard shell: tabs, tiles, sparkline, inbox ------------------------------- */
.ssp-tabs { display:flex; gap:6px; flex-wrap:wrap; margin:0 0 18px; padding:4px;
  background:var(--card); border:1px solid var(--line); border-radius:12px; width:fit-content; max-width:100%; }
.ssp-tab { border:0; background:transparent; color:var(--muted); font:inherit; font-weight:600;
  font-size:14px; padding:9px 16px; border-radius:9px; cursor:pointer; }
.ssp-tab:hover { color:var(--ink); }
.ssp-tab.active { background:color-mix(in srgb, var(--acc) 16%, transparent); color:var(--acc); }

.ssp-tiles { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.ssp-tile { background:var(--panel2); border:1px solid var(--line); border-radius:12px; padding:14px 16px; }
.ssp-tile b { display:block; font-size:28px; line-height:1.15; letter-spacing:-0.02em; }
.ssp-tile span { color:var(--muted); font-size:12px; }

.ssp-spark { display:flex; align-items:flex-end; gap:4px; height:56px; margin:16px 0 10px; }
.ssp-bar { flex:1; background:color-mix(in srgb, var(--acc) 55%, transparent); border-radius:3px 3px 0 0; min-height:2px; }

.ssp-list { display:grid; gap:8px; }
.ssp-item { border:1px solid var(--line); border-radius:10px; padding:12px; background:var(--panel2);
  cursor:pointer; }
.ssp-item-new { border-left:3px solid var(--acc); }
.ssp-item-msg { margin-top:6px; white-space:pre-wrap; font-size:14px; }

@media (max-width: 760px) { .ssp-tiles { grid-template-columns:repeat(2,1fr); } }
.ssp-reply { margin-top:10px; display:grid; gap:8px; }
.ssp-reply-subject, .ssp-reply-body { width:100%; font:inherit; color:var(--ink); background:var(--card);
  border:1px solid var(--line); border-radius:9px; padding:9px 11px; }
.ssp-reply-body { resize:vertical; }
.ssp-grid2 { display:grid; grid-template-columns:1fr 1fr; gap:18px; margin-top:16px; }
.ssp-h3 { font-size:15px; margin:0 0 8px; }
.ssp-breakdown { display:grid; gap:6px; }
.ssp-bd { display:grid; grid-template-columns:minmax(70px,1fr) 3fr auto; gap:8px; align-items:center; font-size:13px; }
.ssp-bd-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--ink); }
.ssp-bd-bar { background:var(--panel2); border-radius:99px; height:8px; overflow:hidden; }
.ssp-bd-bar i { display:block; height:100%; background:color-mix(in srgb, var(--acc) 60%, transparent); }
.ssp-bd-n { color:var(--muted); font-variant-numeric:tabular-nums; }
@media (max-width: 760px) { .ssp-grid2 { grid-template-columns:1fr; } }
.ssp-pw { position:relative; }
.ssp-pw input { padding-right:46px; }
.ssp-eye { position:absolute; right:6px; top:50%; transform:translateY(-50%); border:0; background:transparent;
  color:var(--muted); padding:7px; border-radius:8px; cursor:pointer; line-height:0; }
.ssp-eye:hover { color:var(--ink); background:var(--panel2); }
.ssp-eye .eye-off { display:none; }
.ssp-eye.showing .eye-off { display:block; }
.ssp-eye.showing .eye-on { display:none; }
/* Inbox header: title on the left, unread badge and filter on the right. */
.ssp-inbox-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin:0 0 8px; }
.ssp-inbox-tools { display:flex; align-items:center; gap:8px; }
.ssp-select { font:inherit; font-size:14px; color:var(--ink); background:var(--card);
  border:1px solid var(--line); border-radius:9px; padding:7px 10px; }
.ssp-item { cursor:default; }
/* A checkbox with a sentence beside it, for preferences. */
.ssp-check { display:flex; align-items:center; gap:9px; margin:12px 0 4px; font-size:14px; color:var(--ink); }
.ssp-check input { width:16px; height:16px; accent-color:var(--brand); }