/* S&J Distributor ID Portal — shared styles.
   Mobile-first: distributors build their IDs on phones far more than desktops. */

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

@font-face {
  font-family: 'Playfair Display';
  src: url('../assets/vendor/fonts/playfair-display.woff2') format('woff2-variations');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

/* The ID's name line is a true italic, not a slanted upright — the source design
   uses Playfair's italic cut, whose letterforms differ from the roman. */
@font-face {
  font-family: 'Playfair Display';
  src: url('../assets/vendor/fonts/playfair-display-italic-latin.woff2') format('woff2-variations');
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                 U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Playfair Display';
  src: url('../assets/vendor/fonts/playfair-display-italic-latin-ext.woff2') format('woff2-variations');
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'SJ Icons';
  src: url('../assets/vendor/fontawesome/webfonts/fa-solid-900.woff2') format('woff2');
  font-weight: 900;
  font-display: block;
}

@font-face {
  font-family: 'SJ Icons Brand';
  src: url('../assets/vendor/fontawesome/webfonts/fa-brands-400.woff2') format('woff2');
  font-weight: 400;
  font-display: block;
}

:root {
  --pink: #fe5182;
  --pink-soft: #ff7fa3;
  --pink-wash: #fff5f8;
  --pink-line: #ffd9e5;
  --ink: #2b1f45;
  --muted: #7a6f88;
  --ok: #14855f;
  --ok-wash: #e8f7f0;
  --warn: #a9761c;
  --warn-wash: #fdf5e3;
  --bad: #c0324b;
  --bad-wash: #fdeef1;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(190, 90, 130, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #fff 0%, var(--pink-wash) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--pink); }

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

.site-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--pink-line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}

.site-header img { width: 38px; height: 38px; object-fit: contain; }
.site-header .brand { font-weight: 800; font-size: 15px; line-height: 1.2; }
.site-header .brand span { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.site-header nav { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.site-header nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
}
.site-header nav a:hover { background: var(--pink-wash); }
.site-header nav a.active { background: var(--pink); color: #fff; }

main { max-width: 980px; margin: 0 auto; padding: 24px 20px 64px; }
main.narrow { max-width: 460px; }
main.wide { max-width: 1180px; }

h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -0.02em; }
h2 { font-size: 18px; margin: 0 0 12px; }
.lede { color: var(--muted); margin: 0 0 24px; font-size: 15px; }

.card {
  background: #fff;
  border: 1px solid var(--pink-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.card + .card { margin-top: 18px; }

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

label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 6px; }
.field + .field { margin-top: 16px; }
.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

input[type=text], input[type=email], input[type=tel], select, textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--pink-line);
  border-radius: 12px;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--pink-soft);
  box-shadow: 0 0 0 3px rgba(255, 127, 163, 0.18);
}

/* Real-world names carry diacritics and the odd hyphen; never autocapitalise
   or autocorrect them into something else. */
input[data-name] { autocapitalize: words; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--pink);
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: filter .15s ease, transform .05s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--pink); border-color: var(--pink-line); }
.btn.ghost:hover { background: var(--pink-wash); }
.btn.small { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn.danger { background: var(--bad); }

.actions { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; }

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

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  margin: 0 0 18px;
  border: 1px solid transparent;
}
.alert.info { background: var(--pink-wash); border-color: var(--pink-line); }
.alert.ok { background: var(--ok-wash); border-color: #bfe6d5; color: var(--ok); }
.alert.warn { background: var(--warn-wash); border-color: #f0dfb4; color: var(--warn); }
.alert.error { background: var(--bad-wash); border-color: #f5c8d2; color: var(--bad); }

.pill-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.pill-badge.pending { background: var(--warn-wash); color: var(--warn); }
.pill-badge.approved { background: var(--ok-wash); color: var(--ok); }
.pill-badge.rejected, .pill-badge.suspended, .pill-badge.revoked { background: var(--bad-wash); color: var(--bad); }
.pill-badge.active { background: var(--ok-wash); color: var(--ok); }

/* ---------- OTP input ---------- */

.otp-inputs { display: flex; gap: 8px; justify-content: space-between; }
.otp-inputs input {
  width: 100%;
  aspect-ratio: 3 / 4;
  padding: 0;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--pink-line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--pink-wash); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: #fff;
  border: 1px solid var(--pink-line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat .n { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.stat .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }

@media (max-width: 560px) {
  main { padding: 18px 14px 56px; }
  .card { padding: 18px; }
  h1 { font-size: 22px; }
}

/* ---------- select ---------- */

/* A native select rather than a scripted listbox: six fixed roles do not need a
   custom widget, and the native control brings its own keyboard handling, its own
   focus management, and the platform picker on phones. The only thing restyled is
   the chrome, via appearance:none plus an inline-SVG chevron. */
.select-wrap { position: relative; }

select {
  width: 100%;
  padding: 12px 42px 12px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237a6f88' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  border: 1px solid var(--pink-line);
  border-radius: 12px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

select:hover { border-color: var(--pink-soft); }

select:focus {
  border-color: var(--pink-soft);
  box-shadow: 0 0 0 3px rgba(255, 127, 163, 0.18);
}

/* Until something is chosen, the placeholder option should read as placeholder
   text rather than as a real value. */
select.is-empty { color: var(--muted); }

select.invalid {
  border-color: var(--bad);
  box-shadow: 0 0 0 3px rgba(192, 50, 75, 0.12);
}

/* ---------- bot check ---------- */

/* Turnstile renders a fixed 300x65 iframe it will not let us restyle, so the
   layout work is all in the surrounding box: centre it, and reserve its height
   up front so the submit button does not jump when the widget finishes loading. */
.turnstile-field {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 65px;
}

.turnstile-field .field-error {
  text-align: center;
}

/* ---------- inline validation ---------- */

.field-error {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--bad);
}

input.invalid, textarea.invalid {
  border-color: var(--bad);
  box-shadow: 0 0 0 3px rgba(192, 50, 75, 0.12);
}

/* Account-state notice on the sign-in page (pending, suspended, rejected,
   unknown). Slightly richer than a plain .alert because it carries a heading
   and sometimes an action. */
.alert.account-notice { text-align: left; }
.alert.account-notice strong { display: block; margin-bottom: 4px; }
.alert.account-notice p { margin: 0; }
.alert.account-notice .btn { margin-top: 12px; }
