/* =====================================================================
   InitHack — Design system
   Dark, high-contrast, developer-native. Built for 17-19 year olds on
   mobile: large tap targets, big type, minimal chrome.
   ===================================================================== */

:root {
  --bg:            #0b1020;
  --bg-elev:       #131a2e;
  --bg-elev-2:     #1a2340;
  --border:        #253055;
  --text:          #e8ecf8;
  --text-dim:      #94a3c4;
  --text-faint:    #64748b;
  --brand:         #6366f1;
  --brand-2:       #a855f7;
  --brand-glow:    rgba(99,102,241,.35);
  --success:       #22c55e;
  --success-bg:    rgba(34,197,94,.12);
  --warning:       #f59e0b;
  --warning-bg:    rgba(245,158,11,.12);
  --danger:        #ef4444;
  --danger-bg:     rgba(239,68,68,.12);
  --info:          #38bdf8;
  --info-bg:       rgba(56,189,248,.12);
  --radius:        14px;
  --radius-sm:     10px;
  --shadow:        0 10px 40px rgba(0,0,0,.4);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 560px; }
.container-mid { max-width: 860px; }

/* ---------------- Navigation ---------------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11,16,32,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.nav-brand { font-weight: 800; font-size: 20px; letter-spacing: -.5px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.nav-brand:hover { text-decoration: none; }
.nav-brand .dot { color: var(--brand-2); }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--text-dim); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 26px; cursor: pointer; padding: 4px 8px; }

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-elev); border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  .nav-links.open { max-height: 420px; }
  .nav-links a { padding: 14px 20px; border-bottom: 1px solid var(--border); }
  .nav-links .btn { margin: 12px 20px; text-align: center; }
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-family: var(--font); font-size: 15px; font-weight: 600; line-height: 1;
  cursor: pointer; transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 6px 24px var(--brand-glow); }
.btn-primary:hover { box-shadow: 0 10px 32px var(--brand-glow); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--bg-elev-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #06210f; }
.btn-warning { background: var(--warning); color: #2b1a00; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 16px 32px; font-size: 17px; }
.btn-block { width: 100%; }

/* ---------------- Cards ---------------- */
.card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.card + .card { margin-top: 18px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card-title { font-size: 18px; font-weight: 700; margin: 0; letter-spacing: -.3px; }
.card-sub { color: var(--text-dim); font-size: 14px; margin: 4px 0 0; }

/* ---------------- Forms ---------------- */
.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; gap: 0; } }
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 7px; color: var(--text); }
label .req { color: var(--danger); }
.hint { font-size: 12.5px; color: var(--text-faint); margin-top: 6px; }

input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=url], input[type=number], input[type=date], input[type=datetime-local],
input[type=search], select, textarea {
  width: 100%; padding: 12px 14px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
select { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%2394a3c4' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
input[type=file] { padding: 10px; background: var(--bg); border: 1px dashed var(--border); border-radius: var(--radius-sm); width: 100%; color: var(--text-dim); font-size: 14px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; }
.checkbox-row input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex-shrink: 0; }
.checkbox-row label { margin: 0; font-weight: 400; font-size: 14px; color: var(--text-dim); }

/* ---------------- Alerts ---------------- */
.alert {
  padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 18px;
  font-size: 14.5px; border: 1px solid transparent; line-height: 1.55;
}
.alert-success { background: var(--success-bg); border-color: rgba(34,197,94,.35); color: #86efac; }
.alert-error   { background: var(--danger-bg);  border-color: rgba(239,68,68,.35);  color: #fca5a5; }
.alert-warning { background: var(--warning-bg); border-color: rgba(245,158,11,.35); color: #fcd34d; }
.alert-info    { background: var(--info-bg);    border-color: rgba(56,189,248,.35); color: #7dd3fc; }

/* ---------------- Badges ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase;
}
.badge-success { background: var(--success-bg); color: #86efac; }
.badge-danger  { background: var(--danger-bg);  color: #fca5a5; }
.badge-warning { background: var(--warning-bg); color: #fcd34d; }
.badge-info    { background: var(--info-bg);    color: #7dd3fc; }
.badge-muted   { background: rgba(148,163,196,.12); color: var(--text-dim); }
.badge-brand   { background: rgba(99,102,241,.18); color: #a5b4fc; }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: var(--bg-elev-2); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-dim); position: sticky; top: 0; }
tbody tr:hover { background: rgba(99,102,241,.05); }
tbody tr:last-child td { border-bottom: 0; }
td.wrap, th.wrap { white-space: normal; min-width: 200px; }

/* ---------------- Stats ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; position: relative; overflow: hidden;
}
.stat::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: linear-gradient(180deg, var(--brand), var(--brand-2)); }
.stat-label { font-size: 12.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.stat-value { font-size: 30px; font-weight: 800; margin-top: 6px; letter-spacing: -1px; line-height: 1.1; }
.stat-meta { font-size: 12.5px; color: var(--text-faint); margin-top: 4px; }

/* ---------------- Hero / landing ---------------- */
.hero { padding: 84px 0 72px; text-align: center; position: relative; overflow: hidden; }
.hero::after {
  content: ''; position: absolute; top: -180px; left: 50%; transform: translateX(-50%);
  width: 700px; height: 700px; pointer-events: none;
  background: radial-gradient(circle, var(--brand-glow) 0%, transparent 62%);
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(34px, 7vw, 62px); line-height: 1.06; margin: 18px 0 18px; letter-spacing: -2px; font-weight: 900; }
.hero .grad { background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero p.lead { font-size: clamp(16px, 2.4vw, 19px); color: var(--text-dim); max-width: 620px; margin: 0 auto 32px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: 999px;
  background: rgba(99,102,241,.13); border: 1px solid rgba(99,102,241,.3);
  font-size: 13.5px; font-weight: 600; color: #a5b4fc;
}
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 28px; justify-content: center; flex-wrap: wrap; margin-top: 44px; }
.hero-meta div { text-align: center; }
.hero-meta .k { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.hero-meta .v { font-size: 12.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }

.section { padding: 66px 0; }
.section-title { font-size: clamp(26px, 4vw, 36px); font-weight: 800; text-align: center; letter-spacing: -1px; margin: 0 0 12px; }
.section-sub { text-align: center; color: var(--text-dim); max-width: 580px; margin: 0 auto 44px; }

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }

/* ---------------- Timeline (stages) ---------------- */
.timeline { position: relative; padding-left: 34px; }
.timeline::before { content: ''; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 26px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -29px; top: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg-elev); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: var(--text-dim);
}
.tl-item.is-open .tl-dot { border-color: var(--success); color: var(--success); box-shadow: 0 0 0 4px var(--success-bg); }
.tl-item.is-locked .tl-dot { border-color: var(--text-faint); }
.tl-title { font-weight: 700; font-size: 16px; margin: 0 0 4px; }
.tl-meta { font-size: 13.5px; color: var(--text-dim); }

/* ---------------- Utilities ---------------- */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-dim    { color: var(--text-dim); }
.text-faint  { color: var(--text-faint); }
.text-sm     { font-size: 13.5px; }
.text-lg     { font-size: 18px; }
.fw-700      { font-weight: 700; }
.mono        { font-family: var(--mono); }
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}.mt-4{margin-top:32px}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}.mb-4{margin-bottom:32px}
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-gap { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hidden { display: none !important; }

.code-chip {
  display: inline-block; font-family: var(--mono); font-size: 15px; font-weight: 700;
  background: var(--bg); border: 1px dashed var(--brand); color: #a5b4fc;
  padding: 8px 14px; border-radius: var(--radius-sm); letter-spacing: 1px;
}

/* ---------------- Footer ---------------- */
.footer { border-top: 1px solid var(--border); padding: 36px 0; margin-top: 60px; color: var(--text-faint); font-size: 13.5px; }
.footer a { color: var(--text-dim); }

/* ---------------- Admin shell ---------------- */
.admin-layout { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: var(--bg-elev); border-right: 1px solid var(--border); padding: 22px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-brand { padding: 0 22px 20px; font-weight: 800; font-size: 18px; border-bottom: 1px solid var(--border); margin-bottom: 14px; letter-spacing: -.4px; }
.sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 22px; color: var(--text-dim); font-size: 14.5px; font-weight: 500;
  border-left: 3px solid transparent;
}
.sidebar a:hover { background: var(--bg-elev-2); color: var(--text); text-decoration: none; }
.sidebar a.active { background: rgba(99,102,241,.13); color: #a5b4fc; border-left-color: var(--brand); font-weight: 600; }
.sidebar-section { padding: 16px 22px 7px; font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--text-faint); font-weight: 700; }
.admin-main { padding: 28px 32px 60px; overflow-x: hidden; }
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.admin-header h1 { font-size: 25px; margin: 0; letter-spacing: -.7px; }

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar a { border-left: 0; border-bottom: 1px solid transparent; }
  .admin-main { padding: 20px 16px 50px; }
}

/* ---------------- Toggle switch (lock/unlock) ---------------- */
.switch { position: relative; display: inline-block; width: 50px; height: 27px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--danger); border-radius: 27px; transition: background .22s;
}
.slider::before {
  content: ''; position: absolute; height: 21px; width: 21px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: transform .22s;
}
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider::before { transform: translateX(23px); }

/* ---------------- Progress bar ---------------- */
.progress { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .4s ease; }

/* ---------------- Print ---------------- */
@media print {
  .nav, .sidebar, .footer, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .card { border: 1px solid #ccc; }
}
