/*
  SafarSetu Connect — affiliate self-service portal
  Shared stylesheet for all three pages (index, login, dashboard).
  Visual language matches the rest of the SafarSetu suite (Outfit + Inter,
  cyan/purple accents on a dark base) so applicants feel they're inside the
  same product family.
*/
:root {
  --bg: #0B1015;
  --bg-card: #131A22;
  --bg-soft: #1A222B;
  --border: #25313D;
  --text: #E7EEF6;
  --text-muted: #8A9BAE;
  --accent: #0F766E;
  --accent-hi: #14B8A6;
  --cyan: #06B6D4;
  --purple: #8B5CF6;
  --amber: #F59E0B;
  --success: #22C55E;
  --danger: #EF4444;
  --radius: 14px;
  --shadow: 0 8px 40px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3 { font-family: 'Outfit', 'Inter', sans-serif; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 36px; margin: 0 0 8px; }
h2 { font-size: 22px; margin: 0 0 8px; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--accent-hi); }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.section { padding: 48px 0; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(12px);
  background: rgba(11,16,21,.75); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; max-width: 1100px; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: 10px; font-family: 'Outfit'; font-weight: 700; font-size: 18px; color: var(--text); }
.logo-pill { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), var(--cyan)); display: grid; place-items: center; color: white; font-weight: 800; }
.nav-actions { display: flex; gap: 10px; align-items: center; }

/* Hero */
.hero { background: radial-gradient(60% 80% at 50% 0%, rgba(6,182,212,.15), transparent 70%), var(--bg); padding: 64px 0 32px; text-align: center; }
.hero h1 { font-size: 52px; line-height: 1.05; background: linear-gradient(180deg, #fff, #B8C7D4); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero p.lead { color: var(--text-muted); font-size: 18px; max-width: 620px; margin: 12px auto 28px; }

/* Cards */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card h2 { color: var(--text); }

/* Form */
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
.form-grid > .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; font-size: 14px; color: var(--text); transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(6,182,212,.18);
}
.field textarea { resize: vertical; min-height: 80px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: 14px; padding: 11px 22px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer; transition: all .2s; text-decoration: none;
  font-family: inherit;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #115E54; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(239,68,68,.4); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.badge-success { background: rgba(34,197,94,.15); color: #4ADE80; }
.badge-warning { background: rgba(245,158,11,.15); color: #FBBF24; }
.badge-danger  { background: rgba(239,68,68,.15);  color: #FCA5A5; }
.badge-info    { background: rgba(6,182,212,.15);  color: #67E8F9; }

/* Tier chip — colours come from .tier-* classes set inline */
.tier-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 12px; border: 1px solid currentColor; }

/* Stats grid */
.stats { display: grid; gap: 14px; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .stats { grid-template-columns: 1fr; } }
.stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat .label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); }
.stat .value { font-family: 'Outfit'; font-size: 28px; font-weight: 700; margin-top: 6px; }
.stat .sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Tables */
.table-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead { background: rgba(255,255,255,.03); }
th { text-align: left; padding: 12px 16px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; font-size: 11px; letter-spacing: .08em; border-bottom: 1px solid var(--border); }
td { padding: 14px 16px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
.platform-cell { text-transform: capitalize; }

/* Toast */
.toast-host { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--bg-card); border: 1px solid var(--border); padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); animation: slide .25s ease-out; max-width: 320px; }
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
@keyframes slide { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Bar chart (vanilla) */
.bars { display: flex; align-items: flex-end; gap: 12px; padding: 16px 0; height: 160px; }
.bar { flex: 1; background: linear-gradient(180deg, var(--cyan), var(--accent)); border-radius: 8px 8px 0 0; min-height: 4px; position: relative; }
.bar .lbl { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--text-muted); }
.bar .val { position: absolute; top: -22px; left: 0; right: 0; text-align: center; font-size: 11px; font-weight: 600; }

/* Misc */
.muted { color: var(--text-muted); }
.code-pill { font-family: 'JetBrains Mono', ui-monospace, monospace; background: var(--bg-soft); padding: 4px 10px; border-radius: 8px; color: var(--cyan); border: 1px solid var(--border); }
.copy-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copy-row input { flex: 1; min-width: 220px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; color: var(--text); font-size: 13px; font-family: 'JetBrains Mono', monospace; }
