/* HyperPhish — shared UI design system */
:root {
  --hp-bg: #0a0e14;
  --hp-bg-elevated: #0d1117;
  --hp-surface: #161b22;
  --hp-surface-hover: #1c2128;
  --hp-border: #21262d;
  --hp-border-strong: #30363d;
  --hp-text: #c9d1d9;
  --hp-text-muted: #8b949e;
  --hp-text-faint: #484f58;
  --hp-heading: #f0f6fc;
  --hp-blue: #58a6ff;
  --hp-green: #3fb950;
  --hp-orange: #ff6b35;
  --hp-red: #f85149;
  --hp-yellow: #d29922;
  --hp-purple: #a371f7;
  --hp-radius: 12px;
  --hp-radius-sm: 8px;
  --hp-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --hp-glow-blue: 0 0 60px rgba(88, 166, 255, 0.12);
  --hp-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --hp-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  --hp-max: 1200px;
  --hp-nav-h: 64px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--hp-font);
  background: var(--hp-bg);
  color: var(--hp-text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.hp-page {
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(88, 166, 255, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(63, 185, 80, 0.04), transparent),
    var(--hp-bg);
}

/* ── Navigation ── */
.hp-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--hp-nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(10, 14, 20, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hp-border);
}

.hp-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--hp-heading);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.hp-nav-brand svg { width: 28px; height: 28px; flex-shrink: 0; }

.hp-nav-brand span {
  background: linear-gradient(135deg, var(--hp-blue), var(--hp-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hp-nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--hp-radius-sm);
  font: 600 0.82rem/1 var(--hp-font);
  text-decoration: none;
  border: 1px solid var(--hp-border-strong);
  color: var(--hp-text);
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.hp-btn:hover {
  border-color: var(--hp-blue);
  color: var(--hp-blue);
  transform: translateY(-1px);
}

.hp-btn svg { width: 15px; height: 15px; }

.hp-btn-primary {
  background: linear-gradient(135deg, #1f6feb, #238636);
  border-color: transparent;
  color: #fff;
}

.hp-btn-primary:hover {
  color: #fff;
  box-shadow: var(--hp-glow-blue);
  filter: brightness(1.08);
}

.hp-btn-green { color: var(--hp-green); border-color: rgba(46, 160, 67, 0.35); }
.hp-btn-green:hover { border-color: var(--hp-green); color: var(--hp-green); }

/* ── Hero ── */
.hp-hero {
  text-align: center;
  padding: 56px 24px 40px;
  max-width: 760px;
  margin: 0 auto;
}

.hp-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(88, 166, 255, 0.08);
  border: 1px solid rgba(88, 166, 255, 0.2);
  color: var(--hp-blue);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hp-hero-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hp-green);
  animation: hp-pulse 2s ease-in-out infinite;
}

@keyframes hp-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.hp-hero h1 {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 800;
  color: var(--hp-heading);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.hp-hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--hp-blue) 0%, var(--hp-green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hp-hero .tagline {
  color: var(--hp-text-muted);
  font-size: 1.05rem;
  line-height: 1.65;
  max-width: 560px;
  margin: 0 auto 28px;
}

.hp-hero-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

/* ── Stats strip ── */
.hp-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  max-width: var(--hp-max);
  margin: 0 auto 48px;
  padding: 0 24px;
  background: var(--hp-border);
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-radius);
  overflow: hidden;
}

.hp-stat {
  background: var(--hp-surface);
  padding: 20px 16px;
  text-align: center;
}

.hp-stat .val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--hp-heading);
  letter-spacing: -0.02em;
}

.hp-stat .val.blue { color: var(--hp-blue); }
.hp-stat .val.green { color: var(--hp-green); }
.hp-stat .val.orange { color: var(--hp-orange); }

.hp-stat .lab {
  font-size: 0.72rem;
  color: var(--hp-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

/* ── Steps / How it works ── */
.hp-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: var(--hp-max);
  margin: 0 auto 48px;
  padding: 0 24px;
}

.hp-step {
  background: var(--hp-surface);
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-radius);
  padding: 24px 20px;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
}

.hp-step:hover {
  border-color: var(--hp-border-strong);
  transform: translateY(-2px);
}

.hp-step-num {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.hp-step-num.red { background: rgba(218, 54, 51, 0.12); color: var(--hp-red); border: 1px solid rgba(218, 54, 51, 0.25); }
.hp-step-num.yellow { background: rgba(210, 153, 34, 0.12); color: var(--hp-yellow); border: 1px solid rgba(210, 153, 34, 0.25); }
.hp-step-num.green { background: rgba(46, 160, 67, 0.12); color: var(--hp-green); border: 1px solid rgba(46, 160, 67, 0.25); }

.hp-step h3 {
  color: var(--hp-heading);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.hp-step p {
  color: var(--hp-text-muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

/* ── Toolbar (search + filters) ── */
.hp-toolbar {
  max-width: var(--hp-max);
  margin: 0 auto 20px;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.hp-toolbar-left {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  flex: 1;
}

.hp-search {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.hp-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--hp-text-faint);
  pointer-events: none;
}

.hp-search input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: var(--hp-surface);
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-radius-sm);
  color: var(--hp-heading);
  font: 0.88rem var(--hp-font);
  outline: none;
  transition: border-color 0.15s;
}

.hp-search input::placeholder { color: var(--hp-text-faint); }
.hp-search input:focus { border-color: var(--hp-blue); }

.hp-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.hp-filter {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--hp-border);
  background: transparent;
  color: var(--hp-text-muted);
  font: 600 0.78rem var(--hp-font);
  cursor: pointer;
  transition: all 0.15s;
}

.hp-filter:hover { border-color: var(--hp-border-strong); color: var(--hp-text); }
.hp-filter.active {
  background: rgba(88, 166, 255, 0.12);
  border-color: rgba(88, 166, 255, 0.35);
  color: var(--hp-blue);
}

.hp-diff-toggle {
  display: flex;
  background: var(--hp-bg-elevated);
  border: 1px solid var(--hp-border-strong);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}

.hp-diff-toggle button {
  border: 0;
  background: transparent;
  color: var(--hp-text-muted);
  font: 600 0.78rem var(--hp-font);
  padding: 7px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
}

.hp-diff-toggle button:hover { color: var(--hp-heading); }
.hp-diff-toggle button.active { background: #1f6feb; color: #fff; }
.hp-diff-toggle button.active[data-level="easy"] { background: #da3633; }
.hp-diff-toggle button.active[data-level="medium"] { background: #d29922; }

.hp-section-head {
  max-width: var(--hp-max);
  margin: 0 auto 12px;
  padding: 0 24px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.hp-section-head h2 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--hp-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hp-section-head .count {
  font-size: 0.78rem;
  color: var(--hp-text-faint);
}

/* ── Simulation grid ── */
.hp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  padding: 0 24px 40px;
  max-width: var(--hp-max);
  margin: 0 auto;
}

.hp-card {
  background: var(--hp-surface);
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-radius);
  padding: 16px;
  text-decoration: none;
  color: var(--hp-text);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.18s ease;
  position: relative;
  overflow: hidden;
}

.hp-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.06), transparent);
  opacity: 0;
  transition: opacity 0.18s;
}

.hp-card:hover {
  background: var(--hp-surface-hover);
  border-color: var(--hp-border-strong);
  transform: translateY(-2px);
  box-shadow: var(--hp-shadow);
}

.hp-card:hover::before { opacity: 1; }

.hp-card.hidden { display: none; }

.hp-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--hp-bg-elevated);
  border: 1px solid var(--hp-border);
  overflow: hidden;
  padding: 6px;
}

.hp-card-icon svg,
svg.hp-card-icon {
  width: 100%;
  height: 100%;
  max-width: 22px;
  max-height: 22px;
  object-fit: contain;
}

.hp-card-name {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--hp-heading);
  position: relative;
}

.hp-card-cat {
  font-size: 0.68rem;
  color: var(--hp-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* ── Trust strip ── */
.hp-trust {
  max-width: var(--hp-max);
  margin: 0 auto 40px;
  padding: 16px 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}

.hp-trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--hp-text-muted);
  font-size: 0.8rem;
}

.hp-trust-item svg {
  width: 16px;
  height: 16px;
  color: var(--hp-green);
  flex-shrink: 0;
}

/* ── Footer ── */
.hp-footer {
  border-top: 1px solid var(--hp-border);
  padding: 32px 24px;
  max-width: var(--hp-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.hp-footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--hp-text-faint);
  font-size: 0.8rem;
}

.hp-footer-brand svg { width: 20px; height: 20px; }

.hp-footer-links {
  display: flex;
  gap: 16px;
}

.hp-footer-links a {
  color: var(--hp-text-faint);
  text-decoration: none;
  font-size: 0.78rem;
  transition: color 0.15s;
}

.hp-footer-links a:hover { color: var(--hp-blue); }

/* ── Dashboard ── */
.hp-dash-wrap {
  max-width: var(--hp-max);
  margin: 0 auto;
  padding: 24px 24px 48px;
}

.hp-dash-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}

.hp-dash-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--hp-heading);
  letter-spacing: -0.02em;
}

.hp-dash-header .sub {
  color: var(--hp-text-faint);
  font-size: 0.82rem;
  margin-top: 4px;
}

.hp-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--hp-green);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hp-live .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--hp-green);
  animation: hp-pulse 1.5s ease-in-out infinite;
}

.hp-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.hp-stat-card {
  background: var(--hp-surface);
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-radius);
  padding: 18px 20px;
}

.hp-stat-card .val {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hp-stat-card .lab {
  font-size: 0.7rem;
  color: var(--hp-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 4px;
}

.hp-panel {
  background: var(--hp-surface);
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-radius);
  padding: 24px;
  margin-bottom: 24px;
}

.hp-panel-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--hp-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.hp-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.hp-bar-label {
  width: 100px;
  text-align: right;
  font-size: 0.78rem;
  color: var(--hp-text-muted);
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hp-bar-track {
  flex: 1;
  height: 22px;
  background: var(--hp-bg-elevated);
  border-radius: 6px;
  overflow: hidden;
}

.hp-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
  min-width: 2px;
}

.hp-bar-val {
  width: 32px;
  font-size: 0.78rem;
  color: var(--hp-text-muted);
  font-weight: 600;
  flex-shrink: 0;
  text-align: right;
}

.hp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.hp-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--hp-bg-elevated);
  border-bottom: 1px solid var(--hp-border);
  color: var(--hp-text-faint);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hp-table td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(33, 38, 45, 0.5);
}

.hp-table tr:last-child td { border-bottom: none; }
.hp-table tr:hover td { background: var(--hp-surface-hover); }
.hp-table strong { color: var(--hp-heading); font-weight: 600; }

.hp-empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--hp-text-faint);
}

.hp-empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: rgba(88, 166, 255, 0.08);
  border: 1px solid rgba(88, 166, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hp-empty-icon svg { width: 28px; height: 28px; color: var(--hp-blue); }
.hp-empty h3 { color: var(--hp-text-muted); font-size: 1rem; margin-bottom: 8px; }
.hp-empty p { font-size: 0.85rem; max-width: 360px; margin: 0 auto; }

.hp-event {
  padding: 8px 12px;
  background: var(--hp-bg-elevated);
  border: 1px solid var(--hp-border);
  border-radius: 6px;
  font: 0.78rem var(--hp-mono);
  color: var(--hp-text-muted);
  margin-bottom: 6px;
}

.hp-event:last-child { margin-bottom: 0; }

/* ── Education page nav offset ── */
.hp-edu-nav { margin-bottom: 0; }

/* ── Utilities ── */
.v-blue { color: var(--hp-blue); }
.v-green { color: var(--hp-green); }
.v-orange { color: var(--hp-orange); }
.v-red { color: var(--hp-red); }
.v-yellow { color: var(--hp-yellow); }
.v-purple { color: var(--hp-purple); }

@media (max-width: 768px) {
  .hp-steps { grid-template-columns: 1fr; }
  .hp-stats { grid-template-columns: 1fr; }
  .hp-toolbar { flex-direction: column; align-items: stretch; }
  .hp-search { max-width: none; }
  .hp-nav { padding: 0 16px; }
  .hp-nav-brand span { display: none; }
}

@media (max-width: 500px) {
  .hp-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .hp-card { padding: 12px; flex-direction: column; text-align: center; }
  .hp-bar-label { width: 70px; font-size: 0.7rem; }
}
