/* =====================================================================
   FirstHack — Google / Material Design theme
   Light surface, Google Sans stack, 4-colour brand system.

   DATA-MARK PALETTE (validated for colour-blind separation + contrast):
     blue  #1A73E8 · red #D93025 · amber #F29900 · green #1E8E3E
   Google's raw brand colours (#4285F4 #EA4335 #FBBC04 #34A853) are used
   ONLY for large decorative shapes, never for small marks or text —
   #FBBC04 fails contrast at text size.
   ===================================================================== */

:root {
  /* ---- Surfaces ---- */
  --bg:            #ffffff;
  --bg-sunken:     #f8f9fa;
  --bg-elev:       #ffffff;
  --bg-elev-2:     #f1f3f4;
  --border:        #dadce0;
  --border-strong: #bdc1c6;

  /* ---- Ink ---- */
  --text:       #202124;
  --text-dim:   #5f6368;
  --text-faint: #80868b;
  --on-accent:  #ffffff;

  /* ---- Google brand (large shapes only) ---- */
  --g-blue:   #4285f4;
  --g-red:    #ea4335;
  --g-yellow: #fbbc04;
  --g-green:  #34a853;

  /* ---- Data marks / accents (validated) ---- */
  --blue:   #1a73e8;
  --red:    #d93025;
  --amber:  #f29900;
  --green:  #1e8e3e;

  --blue-dark: #1557b0;
  --blue-tint: #e8f0fe;
  --red-tint:  #fce8e6;
  --amber-tint:#fef7e0;
  --green-tint:#e6f4ea;

  /* ---- Semantic ---- */
  --brand:      var(--blue);
  --brand-tint: var(--blue-tint);
  --success:    var(--green);
  --warning:    var(--amber);
  --danger:     var(--red);
  --info:       var(--blue);

  /* ---- Shape & elevation (Material) ---- */
  --radius:    12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --e1: 0 1px 2px rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
  --e2: 0 1px 2px rgba(60,64,67,.3), 0 2px 6px 2px rgba(60,64,67,.15);
  --e3: 0 4px 8px 3px rgba(60,64,67,.15), 0 1px 3px rgba(60,64,67,.3);

  --font: 'Google Sans', 'Product Sans', Roboto, -apple-system, BlinkMacSystemFont,
          'Segoe UI', Helvetica, Arial, sans-serif;
  --mono: 'Roboto Mono', SFMono-Regular, ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

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(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 560px; }
.container-mid    { max-width: 880px; }

/* ---------------- Navigation ---------------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) 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: 700; font-size: 21px; letter-spacing: -.5px;
  color: var(--text); display: flex; align-items: center; gap: 2px;
}
.nav-brand:hover { text-decoration: none; }
.nav-brand .g1 { color: var(--g-blue); }
.nav-brand .g2 { color: var(--g-red); }
.nav-brand .g3 { color: var(--g-yellow); }
.nav-brand .g4 { color: var(--g-green); }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a {
  color: var(--text-dim); font-size: 14px; font-weight: 500;
  padding: 8px 12px; border-radius: var(--radius-sm);
}
.nav-links a:hover { color: var(--text); background: var(--bg-elev-2); text-decoration: none; }
/* A .btn inside the nav must keep its own colours — `.nav-links a` has higher
   specificity than `.btn-primary`, which would otherwise render the main
   Register CTA in muted grey on blue (invisible). */
.nav-links a.btn-primary,
.nav-links a.btn-primary:hover { color: #fff; background: var(--blue); }
.nav-links a.btn-primary:hover { background: var(--blue-dark); }
.nav-links a.btn-ghost,
.nav-links a.btn-ghost:hover { color: var(--blue); }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 26px; cursor: pointer; padding: 4px 8px; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--border);
    box-shadow: var(--e2);
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  .nav-links.open { max-height: 460px; }
  .nav-links a { padding: 14px 24px; border-radius: 0; border-bottom: 1px solid var(--border); }
  .nav-links .btn { margin: 12px 24px; justify-content: center; }
}

/* ---------------- Buttons (Material) ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 24px; border-radius: var(--radius-pill); border: 1px solid transparent;
  font-family: var(--font); font-size: 14px; font-weight: 600; letter-spacing: .2px;
  line-height: 1.4; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: box-shadow .2s, background .2s, transform .08s;
}
.btn:hover { text-decoration: none; box-shadow: var(--e1); }
.btn:active { transform: scale(.985); }
.btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; box-shadow: var(--e2); }
.btn-ghost { background: #fff; border-color: var(--border-strong); color: var(--blue); }
.btn-ghost:hover { background: var(--blue-tint); }
.btn-danger  { background: var(--red);   color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-warning { background: var(--amber); color: #202124; }
.btn-text    { background: transparent; color: var(--blue); padding: 10px 12px; }
.btn-text:hover { background: var(--blue-tint); box-shadow: none; }
.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-lg { padding: 15px 34px; font-size: 16px; }
.btn-block { width: 100%; }

/* ---------------- Cards ---------------- */
.card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
}
.card-hover { transition: box-shadow .2s, transform .2s; }
.card-hover:hover { box-shadow: var(--e2); transform: translateY(-2px); }
.card + .card { margin-top: 18px; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card-title { font-size: 18px; font-weight: 600; margin: 0; letter-spacing: -.2px; color: var(--text); }
.card-sub { color: var(--text-dim); font-size: 14px; margin: 4px 0 0; }

/* ---------------- Forms ---------------- */
.form-group { margin-bottom: 20px; }
.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: 500; margin-bottom: 7px; color: var(--text); }
label .req { color: var(--red); }
.hint { font-size: 12.5px; color: var(--text-dim); 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: 13px 15px;
  background: #fff; color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 112px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:disabled, select:disabled, textarea:disabled { background: var(--bg-sunken); color: var(--text-faint); }
select {
  appearance: none; cursor: pointer;
  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='%235f6368' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center; padding-right: 40px;
}
input[type=file] {
  padding: 14px; background: var(--bg-sunken); border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm); width: 100%; color: var(--text-dim); font-size: 14px; cursor: pointer;
}
.checkbox-row { display: flex; align-items: flex-start; gap: 12px; }
.checkbox-row input[type=checkbox] { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--blue); flex-shrink: 0; cursor: pointer; }
.checkbox-row label { margin: 0; font-weight: 400; font-size: 14px; color: var(--text-dim); }

/* ---------------- Alerts ---------------- */
.alert {
  padding: 14px 18px; border-radius: var(--radius); margin-bottom: 18px;
  font-size: 14.5px; line-height: 1.6; border: 1px solid transparent;
}
.alert-success { background: var(--green-tint); border-color: #a8dab5; color: #0d652d; }
.alert-error   { background: var(--red-tint);   border-color: #f5b5ae; color: #a50e0e; }
.alert-warning { background: var(--amber-tint); border-color: #fde293; color: #8a5300; }
.alert-info    { background: var(--blue-tint);  border-color: #aecbfa; color: #174ea6; }

/* ---------------- Badges ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600; letter-spacing: .2px;
}
.badge-success { background: var(--green-tint); color: #0d652d; }
.badge-danger  { background: var(--red-tint);   color: #a50e0e; }
.badge-warning { background: var(--amber-tint); color: #8a5300; }
.badge-info    { background: var(--blue-tint);  color: #174ea6; }
.badge-brand   { background: var(--blue-tint);  color: #174ea6; }
.badge-muted   { background: var(--bg-elev-2);  color: var(--text-dim); }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th {
  background: var(--bg-sunken); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: .6px; color: var(--text-dim);
  position: sticky; top: 0;
}
tbody tr:hover { background: var(--bg-sunken); }
tbody tr:last-child td { border-bottom: 0; }
td.wrap, th.wrap { white-space: normal; min-width: 200px; }

/* ---------------- Stat tiles ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.stat {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px; position: relative; overflow: hidden;
}
.stat::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: var(--blue); border-radius: 4px 0 0 4px;
}
.stat.s-blue::before  { background: var(--blue); }
.stat.s-red::before   { background: var(--red); }
.stat.s-amber::before { background: var(--amber); }
.stat.s-green::before { background: var(--green); }
.stat-label { font-size: 12.5px; color: var(--text-dim); font-weight: 500; letter-spacing: .3px; }
.stat-value { font-size: 34px; font-weight: 700; margin-top: 4px; letter-spacing: -1.2px; line-height: 1.1; color: var(--text); }
.stat-meta  { font-size: 12.5px; color: var(--text-faint); margin-top: 4px; }

/* ---------------- Hero ---------------- */
.hero { padding: 72px 0 60px; position: relative; overflow: hidden; background: var(--bg-sunken); }
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .hero-inner { grid-template-columns: 1fr; gap: 36px; } }

.hero h1 {
  font-size: clamp(34px, 5.6vw, 60px); line-height: 1.08;
  margin: 18px 0; letter-spacing: -2px; font-weight: 700;
}
.hero p.lead { font-size: clamp(16px, 2vw, 19px); color: var(--text-dim); max-width: 560px; margin: 0 0 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.g-dots { display: inline-flex; gap: 6px; align-items: center; }
.g-dots i { width: 10px; height: 10px; border-radius: 50%; display: block; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: var(--radius-pill);
  background: #fff; border: 1px solid var(--border);
  font-size: 13.5px; font-weight: 500; color: var(--text-dim);
  box-shadow: var(--e1);
}
.pill .dot-live {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 0 rgba(30,142,62,.6); animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(30,142,62,.55); }
  70%  { box-shadow: 0 0 0 9px rgba(30,142,62,0); }
  100% { box-shadow: 0 0 0 0 rgba(30,142,62,0); }
}

/* ---------------- Sections ---------------- */
.section { padding: 72px 0; }
.section-sunken { background: var(--bg-sunken); }
.section-title { font-size: clamp(27px, 3.6vw, 38px); font-weight: 700; text-align: center; letter-spacing: -1.2px; margin: 0 0 12px; }
.section-sub { text-align: center; color: var(--text-dim); max-width: 600px; margin: 0 auto 44px; font-size: 16.5px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 20px; }

/* ---------------- Progress / capacity meter ---------------- */
.progress {
  height: 10px; background: var(--bg-elev-2); border-radius: var(--radius-pill);
  overflow: hidden; position: relative;
}
.progress-bar {
  height: 100%; border-radius: var(--radius-pill);
  background: var(--blue);
  transition: width .8s cubic-bezier(.4,0,.2,1);
}
.progress-bar.is-warn { background: var(--amber); }
.progress-bar.is-hot  { background: var(--red); }
.progress-lg { height: 16px; }

/* Capacity meter — the "X of Y taken, Z left" widget */
.meter { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; }
.meter-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.meter-num { font-size: 30px; font-weight: 700; letter-spacing: -1px; line-height: 1; }
.meter-of  { font-size: 15px; color: var(--text-dim); font-weight: 400; }
.meter-left { font-size: 14px; font-weight: 600; }
.meter-foot { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12.5px; color: var(--text-dim); }

/* Tier ladder (early bird pricing) */
.tier { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.tier:last-child { border-bottom: 0; }
.tier-mark {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; border: 2px solid var(--border-strong); color: var(--text-faint);
  background: #fff;
}
.tier.is-active .tier-mark { border-color: var(--green); background: var(--green); color: #fff; }
.tier.is-done   .tier-mark { border-color: var(--border-strong); background: var(--bg-elev-2); }
.tier.is-done .tier-name, .tier.is-done .tier-price { text-decoration: line-through; color: var(--text-faint); }
.tier-name { font-weight: 500; font-size: 14.5px; }
.tier-price { margin-left: auto; font-weight: 700; font-size: 15px; }

/* ---------------- Live activity feed ---------------- */
.feed { max-height: 320px; overflow-y: auto; }
.feed-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--border);
  animation: slideIn .45s ease;
}
.feed-item:last-child { border-bottom: 0; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: #fff; letter-spacing: -.3px;
}
.avatar.a0 { background: var(--g-blue); }
.avatar.a1 { background: var(--g-red); }
.avatar.a2 { background: #f9ab00; color: #202124; }
.avatar.a3 { background: var(--g-green); }
.avatar-sm { width: 28px; height: 28px; font-size: 11.5px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -9px; border: 2px solid #fff; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ---------------- Countdown ---------------- */
.countdown { display: flex; gap: 10px; }
.cd-box {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 8px; min-width: 66px; text-align: center;
}
.cd-num { font-size: 26px; font-weight: 700; letter-spacing: -1px; line-height: 1; font-variant-numeric: tabular-nums; }
.cd-lab { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .6px; margin-top: 5px; }

/* ---------------- Timeline ---------------- */
.timeline { position: relative; padding-left: 36px; }
.timeline::before { content: ''; position: absolute; left: 12px; top: 10px; bottom: 10px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 28px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -31px; top: 2px; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; border: 2px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text-faint);
}
.tl-item.is-open   .tl-dot { border-color: var(--green); background: var(--green); color: #fff; }
.tl-item.is-locked .tl-dot { border-color: var(--border-strong); }
.tl-title { font-weight: 600; font-size: 16px; margin: 0 0 4px; }
.tl-meta { font-size: 14px; color: var(--text-dim); }

/* ---------------- Misc ---------------- */
.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); }
.tnum        { font-variant-numeric: tabular-nums; }
.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(--blue-tint); border: 1px dashed var(--blue); color: #174ea6;
  padding: 9px 16px; border-radius: var(--radius-sm); letter-spacing: 1.5px;
}

.divider { height: 1px; background: var(--border); border: 0; margin: 24px 0; }

/* ---------------- Footer ---------------- */
.footer { border-top: 1px solid var(--border); padding: 40px 0; margin-top: 64px; color: var(--text-dim); font-size: 14px; background: var(--bg-sunken); }
.footer a { color: var(--text-dim); }

/* ---------------- Admin shell ---------------- */
.admin-layout { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: #fff; border-right: 1px solid var(--border); padding: 20px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-brand { padding: 0 24px 18px; font-weight: 700; font-size: 19px; border-bottom: 1px solid var(--border); margin-bottom: 12px; letter-spacing: -.3px; }
.sidebar a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 24px; margin: 1px 12px; border-radius: var(--radius-pill);
  color: var(--text-dim); font-size: 14px; font-weight: 500;
}
.sidebar a:hover { background: var(--bg-elev-2); color: var(--text); text-decoration: none; }
.sidebar a.active { background: var(--blue-tint); color: #174ea6; font-weight: 600; }
.sidebar-section { padding: 16px 24px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--text-faint); font-weight: 600; }
.admin-main { padding: 28px 32px 60px; overflow-x: hidden; background: var(--bg-sunken); }
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.admin-header h1 { font-size: 26px; margin: 0; letter-spacing: -.8px; font-weight: 600; }

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

/* ---------------- Toggle switch ---------------- */
.switch { position: relative; display: inline-block; width: 52px; height: 32px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: var(--border-strong); border-radius: var(--radius-pill); transition: background .22s; }
.slider::before {
  content: ''; position: absolute; height: 24px; width: 24px; left: 4px; bottom: 4px;
  background: #fff; border-radius: 50%; transition: transform .22s; box-shadow: var(--e1);
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(20px); }

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