/* KampZ for Brands — vanilla, no framework. Companion to brand/app.js.
   Single dark theme, matching KampZ's real brand identity (deep indigo
   ground, violet -> pink gradient, amber accent; Bricolage Grotesque +
   Instrument Sans + Spline Sans Mono) as used on kampz.online and in the
   app — see brand/DESIGN.md for the token list and patterns before
   changing colors, fonts, radii, or component treatments here.
   Forked from the old shared admin/style.css design system on 2026-09-20:
   admin/style.css keeps the flat light/dark utility look for the internal
   admin tool, this file speaks the product brand for the brand-facing
   surface instead. */

:root {
  --bg: #171430;
  --bg-2: #1d1a3d;
  --card: #221e4a;
  --card-2: #2a2558;
  --line: rgba(240, 238, 251, 0.1);
  --line-strong: rgba(240, 238, 251, 0.18);
  --text: #f0eefb;
  --text-dim: #a7a2c9;
  --faint: #7b76a3;
  --primary: #7c63ff;
  --primary-deep: #6c4dff;
  --primary-ink: #ffffff;
  --accent: #ff3d7f;
  --accent-soft: #ff7fa9;
  --amber: #ffb424;
  --ok: #4ade94;
  --warn: #ffb424;
  --danger: #ff5c7a;
  --radius: 16px;
  --shadow: 0 20px 50px rgba(8, 6, 20, 0.45), 0 2px 8px rgba(8, 6, 20, 0.3);
  font-family: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  position: relative;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3 {
  margin: 0;
  font-family: "Bricolage Grotesque", "Instrument Sans", sans-serif;
  letter-spacing: -0.01em;
}
button {
  font: inherit;
  cursor: pointer;
}
input,
select,
textarea {
  font: inherit;
}
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--primary);
}
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* ---------- ambient brand glow (sitewide, fixed, decorative) ---------- */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.32;
}
body::before {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  top: -160px;
  right: -120px;
}
body::after {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  bottom: -160px;
  left: -100px;
}
@media (prefers-reduced-motion: no-preference) {
  body::before {
    animation: blobFloat 14s ease-in-out infinite;
  }
  body::after {
    animation: blobFloat 16s ease-in-out infinite reverse;
  }
  @keyframes blobFloat {
    0%,
    100% {
      transform: translate(0, 0) scale(1);
    }
    50% {
      transform: translate(-20px, 24px) scale(1.06);
    }
  }
}

.grad {
  background: linear-gradient(100deg, var(--primary) 10%, var(--accent) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- buttons ---------- */
.btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 14px;
  transition: filter 0.12s ease, background 0.12s ease, border-color 0.12s ease,
    transform 0.12s ease, box-shadow 0.12s ease, color 0.12s ease;
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.btn-primary {
  background: linear-gradient(120deg, var(--primary-deep), var(--accent));
  color: var(--primary-ink);
  box-shadow: 0 6px 20px rgba(124, 99, 255, 0.32);
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}
.btn-primary:not(:disabled):hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}
.btn-primary:not(:disabled):hover::after {
  left: 120%;
}
.btn-primary:not(:disabled):active {
  transform: translateY(0);
}
.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text-dim);
}
.btn-ghost:hover {
  background: var(--card);
  color: var(--text);
}
.btn-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

/* ---------- login / auth screens ---------- */
.login {
  display: grid;
  place-items: center;
  padding: 32px 24px 48px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: linear-gradient(160deg, var(--card), var(--card-2) 130%);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 34px 30px;
}
.login-sub {
  color: var(--text-dim);
  margin: 8px 0 22px;
  font-size: 14px;
}
.field {
  display: block;
  margin-bottom: 16px;
}
.field span {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 13.5px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
}
.field textarea {
  min-height: 84px;
  resize: vertical;
}
.field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 40px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23A7A2C9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>');
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px;
}
.field select option {
  background: var(--bg-2);
  color: var(--text);
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--faint);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: transparent;
}
.login-card .btn-primary {
  width: 100%;
  margin-top: 6px;
}
.form-error {
  color: var(--danger);
  font-weight: 600;
  margin: 0 0 14px;
  font-size: 13.5px;
}

/* ---------- brand mark ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  color: var(--text);
}
.brand span {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.brand-mark {
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--primary-deep), var(--accent));
  flex-shrink: 0;
}

/* ---------- app shell ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 22px;
  background: rgba(23, 20, 48, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.tabs {
  display: flex;
  gap: 4px;
}
.tab {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: 10px;
  transition: background 0.12s ease, color 0.12s ease;
}
.tab:hover {
  background: var(--card);
  color: var(--text);
}
.tab.active {
  background: linear-gradient(120deg, var(--primary-deep), var(--accent));
  color: #fff;
}
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.whoami {
  color: var(--text-dim);
  font-size: 13px;
}

/* account overflow menu (holds whoami + sign-out actions) */
.icon-btn {
  min-width: 40px;
  padding: 9px 12px;
  text-align: center;
}
.acct {
  position: relative;
}
.acct-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 210px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 20;
}
.acct-menu .whoami {
  padding: 6px 10px 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.acct-menu .whoami:empty {
  display: none;
}
.acct-menu .btn {
  width: 100%;
  text-align: left;
  border-color: transparent;
}
.acct-menu .btn:hover {
  background: var(--bg-2);
  color: var(--text);
}
.content {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}
.pad {
  padding: 32px 4px;
}
.small {
  font-size: 12px;
}
.muted {
  color: var(--text-dim);
}
.section-title {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-soft);
  margin: 28px 0 14px;
}
.section-title:first-child {
  margin-top: 0;
}

/* ---------- home content (banners + blog) ---------- */
.content-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.content-form {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px 16px;
  margin: 16px 0 4px;
}
.content-form .card-title {
  margin-top: 0;
}
.content-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.content-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.content-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.content-row:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 14px 34px rgba(8, 6, 20, 0.35);
}
.content-main {
  flex: 1;
  min-width: 0;
}
.content-title {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.content-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.content-actions .btn {
  padding: 7px 13px;
  font-size: 13px;
}
.card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
@media (max-width: 720px) {
  .content-row {
    flex-wrap: wrap;
  }
  .content-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ---------- status pills (mono chip style) ---------- */
.pill {
  display: inline-block;
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--bg-2);
  color: var(--text-dim);
  border: 1px solid var(--line-strong);
}
.pill[data-s="resolved"] {
  background: rgba(74, 222, 148, 0.14);
  color: var(--ok);
  border-color: transparent;
}
.pill[data-s="open"] {
  background: rgba(255, 61, 127, 0.16);
  color: var(--accent-soft);
  border-color: transparent;
}
.pill[data-s="in_progress"] {
  background: rgba(255, 180, 36, 0.16);
  color: var(--amber);
  border-color: transparent;
}
.pill[data-s="closed"] {
  background: rgba(124, 99, 255, 0.18);
  color: #b3a6ff;
  border-color: transparent;
}

/* ---------- drawer ---------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
}
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 20, 0.6);
  backdrop-filter: blur(2px);
}
.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(560px, 100%);
  background: linear-gradient(160deg, #1d1a3d, #1a1738 60%, #201a3c);
  border-left: 1px solid var(--line-strong);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.18s ease;
}
@keyframes slideIn {
  from {
    transform: translateX(24px);
    opacity: 0.4;
  }
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(34, 30, 74, 0.6);
  font-weight: 700;
}
.drawer-head > div {
  display: flex;
  gap: 6px;
}
.drawer-body {
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.d-kv {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 4px 10px;
  font-size: 13px;
}
.d-kv span {
  color: var(--text-dim);
}
.d-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* ---------- applicant cards ---------- */
.applicant-card {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.applicant-card:last-child {
  border-bottom: none;
}
.applicant-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 6px;
}
.applicant-msg {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13.5px;
  margin: 6px 0 10px;
}

/* ---------- warning / rejection notice ---------- */
.warn-box {
  border: 1px solid rgba(255, 180, 36, 0.4);
  background: rgba(255, 180, 36, 0.08);
  color: var(--amber);
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 12.5px;
  margin-top: 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line-strong);
  padding: 11px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  z-index: 100;
}

/* ---------- brand portal: always-visible SEO intro header ---------- */
.portal-intro {
  max-width: 420px;
  margin: 60px auto 0;
  padding: 0 24px;
  text-align: center;
}
.portal-intro .brand {
  justify-content: center;
  margin-bottom: 18px;
}
.portal-eyebrow {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 14px;
}
.portal-intro h1 {
  font-size: clamp(24px, 4vw, 28px);
  font-weight: 800;
  margin: 0 0 10px;
  line-height: 1.15;
}
.portal-intro p {
  color: var(--text-dim);
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
}
.portal-trust {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
  margin: 20px 0 0;
  padding: 0;
}
.portal-trust li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px 6px 10px;
}
.portal-trust li::before {
  content: "✓";
  color: var(--ok);
  font-weight: 700;
  font-size: 11px;
}

/* ---------- brand portal: footer (trust + policy links) ---------- */
.portal-foot {
  max-width: 480px;
  margin: 40px auto 24px;
  padding: 18px 24px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--faint);
  font-size: 12.5px;
}
.portal-foot a {
  color: var(--text-dim);
  text-decoration: none;
}
.portal-foot a:hover {
  color: var(--text);
  text-decoration: underline;
}
.portal-foot-links {
  display: flex;
  gap: 14px;
}

/* ---------- brand portal: password show/hide toggle ---------- */
.password-field {
  position: relative;
}
.password-field input {
  width: 100%;
  padding-right: 58px;
}
.password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 8px;
}
.password-toggle:hover {
  text-decoration: underline;
}

/* ---------- brand portal: phone field (country code + number) ---------- */
.phone-field {
  display: flex;
  gap: 8px;
}
.phone-field select {
  flex: 0 0 132px;
  padding: 11px 10px;
}
.phone-field input {
  flex: 1;
  min-width: 0;
}

/* ---------- brand portal: auth tabs (sign in / create account) ---------- */
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-2);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 22px;
}
.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px 10px;
  border-radius: 9px;
  transition: background 0.15s ease, color 0.15s ease;
}
.auth-tab.active {
  background: linear-gradient(120deg, var(--primary-deep), var(--accent));
  color: #fff;
}
.auth-link {
  width: 100%;
  margin-top: 10px;
}

/* ---------- brand portal: email/phone verification steps ---------- */
.verify-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 8px;
}
.verify-step {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--bg-2);
}
.verify-step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 12px;
}
.verify-step-num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-deep), var(--accent));
  color: #fff;
  font-family: "Instrument Sans", sans-serif;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.verify-step-body .field {
  margin-bottom: 10px;
}
.ok-line {
  color: var(--ok);
  font-weight: 700;
  margin: 0;
}

/* ---------- brand portal: platform picker (listing form) ---------- */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
  gap: 9px 12px;
  margin: 6px 0 16px;
}
.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-dim);
}

/* ---------- mobile / phone browsers ---------- */
@media (max-width: 640px) {
  body {
    -webkit-tap-highlight-color: transparent;
  }

  /* topbar: brand + actions on row 1, horizontally scrollable tab strip on row 2 */
  .topbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }
  .topbar .brand-label {
    display: none;
  }
  .topbar-right {
    gap: 6px;
  }
  .tabs {
    order: 3;
    flex-basis: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    margin: 0 -12px;
    padding: 2px 12px 0;
  }
  .tabs::-webkit-scrollbar {
    display: none;
  }
  .tab {
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding: 10px 14px;
  }
  .acct-menu {
    min-width: 200px;
  }

  .content {
    padding: 18px 14px 48px;
  }
  .section-title {
    margin: 24px 0 12px;
  }

  .portal-intro {
    margin: 40px auto 0;
  }

  /* touch targets */
  .btn {
    padding: 11px 16px;
  }
  .content-actions .btn {
    padding: 10px 14px;
    font-size: 13px;
  }

  /* content composer: full-width submit instead of a cramped right-aligned button */
  .content-head {
    flex-wrap: wrap;
  }
  .content-form {
    padding: 18px 16px 14px;
  }
  .content-form-actions {
    justify-content: stretch;
  }
  .content-form-actions .btn {
    flex: 1;
  }

  .applicant-head {
    flex-wrap: wrap;
  }

  /* iOS Safari zooms the page when focusing an input under 16px — bump them */
  .field input,
  .field textarea,
  .field select {
    font-size: 16px;
  }

  /* drawers are already full-width (width: min(560px, 100%)) — just tighten */
  .drawer-body {
    padding: 16px;
    gap: 16px;
  }
  .d-kv {
    grid-template-columns: 80px 1fr;
    word-break: break-word;
  }

  /* ambient glow blobs are a desktop nicety — drop them so they don't eat
     scroll performance / battery on phones */
  body::before,
  body::after {
    display: none;
  }
}
