@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;1,14..32,300;1,14..32,400&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:       #C8A96E;
  --brand-dark:  #A8894E;
  --text:        #111111;
  --text-muted:  #6B6B6B;
  --bg:          #F7F5F0;
  --bg-card:     #FFFFFF;
  --border:      #E3DDD5;
  --success:     #2A7D46;
  --error:       #C0392B;
  --warning:     #C17B2A;
  --radius:      4px;
  --shadow:      0 1px 3px rgba(0,0,0,.06);
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; display: block; }

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4 {
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.025em;
}
h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.625rem, 3vw, 2.5rem); }
h3 { font-size: 1.125rem; font-weight: 600; }

/* ── Layout helpers ──────────────────────────────────────── */
.container      { max-width: 1120px; margin: 0 auto; padding: 0 2rem; }
.container-sm   { max-width: 560px;  margin: 0 auto; padding: 0 2rem; }
.section        { padding: 6rem 0; }
.section-sm     { padding: 3rem 0; }
.flex           { display: flex; }
.flex-center    { display: flex; align-items: center; justify-content: center; }
.flex-between   { display: flex; align-items: center; justify-content: space-between; }
.gap-1          { gap: .5rem; }
.gap-2          { gap: 1rem; }
.gap-3          { gap: 1.5rem; }
.mt-1           { margin-top: .5rem; }
.mt-2           { margin-top: 1rem; }
.mt-3           { margin-top: 2rem; }
.mb-1           { margin-bottom: .5rem; }
.mb-2           { margin-bottom: 1rem; }
.mb-3           { margin-bottom: 2rem; }
.text-center    { text-align: center; }
.text-muted     { color: var(--text-muted); }
.text-sm        { font-size: .875rem; }
.text-xs        { font-size: .75rem; }
.font-bold      { font-weight: 600; }
.w-full         { width: 100%; }

/* ── Nav ─────────────────────────────────────────────────── */
.nav {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  overflow: hidden;
}
.nav-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; overflow: hidden;
}
.nav-logo { display: flex; align-items: center; flex-shrink: 0; }
.nav-logo img { height: 47px !important; width: auto !important; max-width: 320px; display: block; }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a { color: var(--text-muted); font-size: .875rem; font-weight: 400; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .75rem 1.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: .875rem; font-weight: 500; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  text-decoration: none !important;
  white-space: nowrap;
  font-family: inherit;
  letter-spacing: .01em;
}
.btn-primary { background: var(--text); color: #fff; border-color: var(--text); }
.btn-primary:hover { background: #2a2a2a; border-color: #2a2a2a; color: #fff; }
.btn-outline { background: transparent; border-color: var(--text); color: var(--text); }
.btn-outline:hover { background: var(--text); color: #fff; }
.btn-sm  { padding: .5rem 1rem; font-size: .8125rem; }
.btn-lg  { padding: .875rem 2.25rem; font-size: .9375rem; }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text); border-color: var(--border); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-danger  { background: var(--error);   color: #fff; border-color: var(--error); }
.btn[disabled], .btn:disabled { opacity: .4; pointer-events: none; }
.btn-block { width: 100%; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}
.card-title { font-size: .9375rem; font-weight: 600; margin-bottom: .75rem; }

/* ── Stat grid ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat-card {
  background: var(--bg-card);
  padding: 1.75rem;
}
.stat-label {
  font-size: .6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text-muted);
}
.stat-value {
  font-size: 2.25rem;
  font-weight: 300;
  color: var(--text);
  margin-top: .375rem;
  line-height: 1;
  letter-spacing: -0.03em;
}
.stat-value.brand { color: var(--brand-dark); }

/* ── Forms ───────────────────────────────────────────────── */
.form-group     { display: flex; flex-direction: column; gap: .375rem; margin-bottom: 1.25rem; }
.form-row       { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-label     { font-size: .8125rem; font-weight: 500; color: var(--text); letter-spacing: .01em; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: .6875rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  color: var(--text);
  background: #fff;
  transition: border-color .15s;
  font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--text);
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: .75rem; color: var(--text-muted); line-height: 1.5; }
.pw-wrap { position: relative; }
.pw-wrap .form-input { padding-right: 2.75rem; }
.pw-toggle {
  position: absolute; right: .875rem; top: 50%; transform: translateY(-50%);
  cursor: pointer; font-size: .75rem; font-weight: 400;
  color: var(--text-muted); white-space: nowrap; user-select: none;
}
.pw-toggle:hover { color: var(--text); }
.code-avail-badge {
  display: inline-block; margin-left: .375rem;
  font-size: .6875rem; font-weight: 500;
  padding: .15em .5em; border-radius: 2px;
  vertical-align: middle; line-height: 1.6;
}
.code-avail-badge:empty { display: none; }
.code-avail-badge.checking  { background: #f3f4f6; color: var(--text-muted); }
.code-avail-badge.available { background: #f0fdf4; color: var(--success); }
.code-avail-badge.taken     { background: #fef2f2; color: var(--error); }
.form-error { font-size: .8125rem; color: var(--error); display: none; }
.form-error.visible { display: block; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  margin-bottom: 1.25rem;
  display: none;
  line-height: 1.5;
}
.alert.visible { display: block; }
.alert-error   { background: #fef2f2; color: var(--error);   border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }
.alert-info    { background: #eff6ff; color: #1d4ed8;        border: 1px solid #bfdbfe; }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; background: var(--bg-card); font-size: .875rem; }
th {
  background: var(--bg);
  font-weight: 500;
  text-align: left;
  padding: .875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
td { padding: .875rem 1.25rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .55rem;
  border-radius: 2px;
  font-size: .6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.badge-pending   { background: #fef3c7; color: #92400e; }
.badge-active    { background: #dcfce7; color: #14532d; }
.badge-approved  { background: #dcfce7; color: #14532d; }
.badge-suspended { background: #fee2e2; color: #7f1d1d; }
.badge-rejected  { background: #f3f4f6; color: #374151; }
.badge-paid      { background: #dbeafe; color: #1e3a8a; }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  padding: 8rem 0 7rem;
  text-align: center;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.hero-eyebrow {
  display: block;
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}
.hero-title { margin-bottom: 1.25rem; }
.hero-desc  {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 380px;
  margin: 0 auto 2.75rem;
  line-height: 1.75;
  font-weight: 300;
}
.hero-ctas  { display: flex; gap: .875rem; justify-content: center; flex-wrap: wrap; }

/* ── Benefits grid ───────────────────────────────────────── */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.benefit-card {
  padding: 2.5rem 2rem;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.benefit-card:nth-child(3n) { border-right: none; }
.benefit-card:nth-last-child(-n+3):nth-child(3n+1),
.benefit-card:nth-last-child(-n+3):nth-child(3n+2),
.benefit-card:nth-last-child(-n+3):nth-child(3n)   { border-bottom: none; }
.benefit-num   { font-size: .6875rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 1.25rem; }
.benefit-title { font-size: .9375rem; font-weight: 600; margin-bottom: .375rem; }
.benefit-desc  { font-size: .875rem; color: var(--text-muted); line-height: 1.65; }

/* ── Referral link box ───────────────────────────────────── */
.ref-link-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.ref-link-url {
  flex: 1;
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: .8125rem;
  color: var(--brand-dark);
  word-break: break-all;
}

/* ── Share panel ─────────────────────────────────────────── */
.share-panel { display: flex; flex-direction: column; gap: 1.25rem; }
.share-caption {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: .875rem;
  color: var(--text-muted);
  font-style: italic;
  position: relative;
}
.share-buttons {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.btn-share {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .5rem .875rem;
  border-radius: var(--radius);
  font-size: .8125rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity .15s;
  font-family: inherit;
  letter-spacing: .01em;
}
.btn-share:hover { opacity: .8; }
.btn-share-native { background: var(--text);  color: #fff; }
.btn-share-fb     { background: #1877f2;       color: #fff; }
.btn-share-ig     { background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af); color: #fff; }
.btn-share-tt     { background: #010101;       color: #fff; }
.btn-share-copy   { background: var(--bg); color: var(--text); border: 1px solid var(--border); }

/* ── Toast ───────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(100px);
  background: var(--text); color: #fff;
  padding: .75rem 1.5rem;
  border-radius: var(--radius);
  font-size: .875rem; font-weight: 400;
  z-index: 9999;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .3s;
  opacity: 0;
  white-space: nowrap;
}
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── Auth page ───────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 2rem 1rem;
}
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem;
  width: 100%;
  max-width: 440px;
}
.auth-logo {
  text-align: center;
  margin-bottom: 2.5rem;
}
.auth-logo img { height: 24px; width: auto; max-width: 160px; object-fit: contain; margin: 0 auto; }
.auth-title    { text-align: center; margin-bottom: .375rem; font-size: 1.375rem; font-weight: 600; letter-spacing: -0.02em; }
.auth-subtitle { text-align: center; color: var(--text-muted); font-size: .875rem; margin-bottom: 2rem; font-weight: 300; }

/* ── Dashboard layout ────────────────────────────────────── */
.dash-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}
.dash-sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 1.75rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.dash-sidebar-logo {
  padding: 0 1.5rem 1.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}
.dash-sidebar-logo img { height: 11px; width: auto; max-width: 100px; object-fit: contain; }
.dash-nav-item {
  display: flex;
  align-items: center;
  padding: .5rem 1.5rem;
  color: var(--text-muted);
  font-size: .8125rem;
  font-weight: 400;
  cursor: pointer;
  transition: color .12s;
  border-left: 2px solid transparent;
  text-decoration: none;
}
.dash-nav-item:hover { color: var(--text); background: transparent; text-decoration: none; }
.dash-nav-item.active { color: var(--text); border-left-color: var(--text); font-weight: 500; }
.dash-main { padding: 3rem; overflow-y: auto; background: var(--bg); }
.dash-main > * { max-width: 860px; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.4);
  align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,.15);
  width: 100%; max-width: 460px;
  overflow: hidden;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-weight: 600; font-size: .9375rem; letter-spacing: -0.01em; }
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.25rem; color: var(--text-muted); line-height: 1; padding: 0;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 1.75rem; }
.dash-header { margin-bottom: 2.5rem; }
.dash-header h1 { font-size: 1.5rem; }
.dash-header p  { color: var(--text-muted); margin-top: .25rem; font-size: .875rem; font-weight: 300; }
.dash-section   { margin-bottom: 3rem; }
.dash-section-title {
  font-size: .6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ── Loading spinner ─────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 1.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); font-size: .875rem; }
.empty-state-icon { display: none; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .dash-layout { grid-template-columns: 1fr; }
  .dash-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    flex-wrap: wrap;
    padding: .5rem;
    gap: .25rem;
  }
  .dash-sidebar-logo { display: none; }
  .dash-nav-item {
    border-left: none;
    border-radius: var(--radius);
    padding: .5rem .75rem;
    font-size: .8125rem;
    border-bottom: 2px solid transparent;
  }
  .dash-nav-item.active { border-left: none; border-bottom-color: var(--text); background: transparent; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; background: var(--border); }
  .auth-card { padding: 2rem; }
  .dash-main { padding: 1.5rem; }
  .benefits-grid { grid-template-columns: 1fr 1fr; }
  .benefit-card:nth-child(3n) { border-right: 1px solid var(--border); }
  .benefit-card:nth-child(2n) { border-right: none; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .hero { padding: 5rem 0 4rem; }
  .section { padding: 4rem 0; }
  .btn-lg { padding: .75rem 1.75rem; }
  .benefits-grid { grid-template-columns: 1fr; }
  .benefit-card { border-right: none !important; }
}
