/* 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: #fbfaf7;
  --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: 860px;
}

* { 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; }
}