/* GoMakeGo — shared design system */

:root {
  --bg:         #0f1117;
  --surface:    #1e2230;
  --surface-2:  #161a25;
  --border:     #2d3348;
  --border-2:   #3a4258;
  --text:       #e2e8f0;
  --text-bright:#f8fafc;
  --text-dim:   #94a3b8;
  --text-muted: #64748b;
  --primary:    #6366f1;
  --primary-2:  #1e2e4a;
  --primary-3:  #2d4463;
  --primary-fg: #93c5fd;
  --success:    #4ade80;
  --success-bg: #14291f;
  --success-bd: #1e4a2e;
  --danger:     #f87171;
  --danger-bg:  #2a1414;
  --danger-bd:  #3f1515;
  --warn:       #fbbf24;
  --warn-bg:    #2d2a1e;
  --warn-bd:    #3f3a22;
  --radius:     8px;
  --radius-lg:  12px;
  --radius-pill:9999px;
  --shadow-pop: 0 12px 24px -8px rgba(0,0,0,0.5);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
}

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

html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

/* ──────────────────────────────────────────────────────────────────
   Site header
   ────────────────────────────────────────────────────────────────── */

.site-header {
  width: 100%;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 20;
}

.site-header__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-header__logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-bright);
  text-decoration: none;
  flex-shrink: 0;
}
.site-header__logo:hover { color: var(--text-bright); }
.site-header__logo .logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: block;
  object-fit: cover;
}
.site-header__nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.site-header__nav a {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
}
.site-header__nav a:hover { background: var(--surface-2); color: var(--text-bright); }
.site-header__nav a[aria-current="page"] { color: var(--text-bright); background: var(--surface-2); }

.site-header__user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text);
  font-size: 0.8125rem;
}
.user-chip img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}
.user-chip a.profile-link {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-chip a.profile-link:hover { color: var(--text-bright); }
.user-chip .btn-logout {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px 10px;
  cursor: pointer;
  font-size: 0.75rem;
  border-radius: 4px;
  font-family: inherit;
}
.user-chip .btn-logout:hover { color: var(--danger); background: var(--danger-bg); }

.btn-signin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #fff;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
}
.btn-signin:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
.btn-signin svg { width: 16px; height: 16px; }

.hamburger {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-dim);
  font-family: inherit;
  flex-shrink: 0;
  margin-left: auto;
}
.hamburger:hover { color: var(--text-bright); border-color: var(--border-2); }
.hamburger svg { width: 18px; height: 18px; }

@media (max-width: 640px) {
  .site-header__inner { gap: 12px; }
  .hamburger { display: inline-flex; }
  .site-header__nav,
  .site-header__user {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 8px 16px;
    gap: 4px;
    display: none;
  }
  .site-header__nav { padding-bottom: 0; border-bottom: none; }
  .site-header__user { padding-top: 8px; }
  .site-header__nav a { padding: 10px 12px; }
  .site-header[data-open] .site-header__nav,
  .site-header[data-open] .site-header__user { display: flex; }
  .user-chip { width: 100%; justify-content: space-between; }
  .btn-signin { width: 100%; justify-content: center; }
}

/* ──────────────────────────────────────────────────────────────────
   Page containers
   ────────────────────────────────────────────────────────────────── */

.page {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 16px 64px;
  flex: 1;
}
.page--narrow { max-width: 520px; }
.page--wide   { max-width: 1100px; }
.page--full   { max-width: none; padding-left: 24px; padding-right: 24px; }

.page-header { margin-bottom: 28px; }
.page-header h1 {
  font-size: 1.625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-bright);
  margin-bottom: 6px;
}
.page-header p {
  color: var(--text-dim);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.page-section {
  margin-bottom: 22px;
}
.page-section h2 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

/* ──────────────────────────────────────────────────────────────────
   Card surface
   ────────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.card--flush { padding: 0; overflow: hidden; }

/* ──────────────────────────────────────────────────────────────────
   Buttons
   ────────────────────────────────────────────────────────────────── */

.btn {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.1s, background 0.1s, border-color 0.1s;
}
.btn--block { display: block; width: 100%; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn--primary  { background: var(--primary); color: #fff; }
.btn--primary:hover { opacity: 0.9; }

.btn--secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}
.btn--secondary:hover { background: var(--border); color: var(--text-bright); }

.btn--ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--border);
}
.btn--ghost:hover { color: var(--text-bright); border-color: var(--border-2); }

.btn--danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-bd);
}
.btn--danger:hover { background: var(--danger-bd); color: var(--text-bright); }

/* ──────────────────────────────────────────────────────────────────
   Pills (tier, status badges, etc.)
   ────────────────────────────────────────────────────────────────── */

.pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pill--free    { background: var(--border); color: var(--text-dim); }
.pill--paid,
.pill--creator { background: var(--success-bg); color: var(--success); }
.pill--pro     { background: var(--primary-2); color: var(--primary-fg); }
.pill--done    { background: var(--success-bg); color: var(--success); }
.pill--error,
.pill--insufficient,
.pill--evicted { background: var(--danger-bg); color: var(--danger); }
.pill--anon    { background: var(--warn-bg); color: var(--warn); }
.pill--running { background: var(--primary-2); color: var(--primary-fg); }

/* ──────────────────────────────────────────────────────────────────
   Banners
   ────────────────────────────────────────────────────────────────── */

.banner {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--primary-3);
  background: var(--primary-2);
  color: var(--primary-fg);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  line-height: 1.5;
  margin-bottom: 16px;
  text-align: center;
}
.banner a { color: #fff; font-weight: 500; text-decoration: underline; }
.banner--error {
  background: var(--danger-bg);
  border-color: var(--danger-bd);
  color: var(--danger);
}

/* ──────────────────────────────────────────────────────────────────
   Combobox (used on / and /app)
   ────────────────────────────────────────────────────────────────── */

.combobox {
  position: relative;
  flex: 1;
  min-width: 0;
}
.combobox input {
  width: 100%;
  padding: 9px 32px 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.1s;
}
.combobox input:focus { border-color: var(--primary); background: #1a1d29; }
.combobox-chevron {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 0.75rem;
}
.combobox-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  list-style: none;
  padding: 4px 0;
  z-index: 10;
  box-shadow: var(--shadow-pop);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.combobox-list[hidden] { display: none; }
.combobox-list li {
  padding: 7px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8125rem;
  color: var(--text);
  border-radius: 4px;
  margin: 0 4px;
}
.combobox-list li:hover,
.combobox-list li.active {
  background: var(--border);
  color: var(--text-bright);
}
.combobox-list .lang-code {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.6875rem;
}
.combobox-list li.active .lang-code,
.combobox-list li:hover .lang-code { color: var(--text-dim); }
.combobox-list .lang-empty {
  color: var(--text-muted);
  cursor: default;
  padding: 10px 12px;
  font-style: italic;
}
.combobox-list .lang-empty:hover { background: transparent; color: var(--text-muted); }

/* ──────────────────────────────────────────────────────────────────
   Tables (admin)
   ────────────────────────────────────────────────────────────────── */

.table-wrap {
  max-height: 480px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.table-wrap table { background: var(--surface-2); }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.table th, .table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table th {
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.6875rem;
}
.table tr:last-child td { border-bottom: none; }
.table-wrap thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.table td.mono,
.table td.email { font-family: var(--mono); color: var(--text); }
.table td.id    { font-family: var(--mono); color: var(--text-muted); }

/* ──────────────────────────────────────────────────────────────────
   Stats grid (admin)
   ────────────────────────────────────────────────────────────────── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.stat {
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stat .label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.stat .value {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-bright);
  font-family: var(--mono);
}
.stat .sub {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 3px;
}

/* ──────────────────────────────────────────────────────────────────
   Misc shared pieces
   ────────────────────────────────────────────────────────────────── */

.placeholder {
  color: var(--text-muted);
  font-size: 0.8125rem;
  text-align: center;
  padding: 16px 0;
}

/* ──────────────────────────────────────────────────────────────────
   Pricing — Plan grid, Recommended ribbon, monthly/yearly toggle
   ────────────────────────────────────────────────────────────────── */

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  align-items: stretch;
}
.plan { display: flex; flex-direction: column; gap: 14px; position: relative; }
.plan h2 { font-size: 1.125rem; font-weight: 600; color: var(--text-bright); }
.plan .price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.1;
}
.plan .price small { font-size: 0.8125rem; font-weight: 500; color: var(--text-muted); }
.plan .price-note { font-size: 0.75rem; color: var(--text-muted); margin-top: -8px; }
.plan ul {
  list-style: none;
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.7;
  flex: 1;
}
.plan ul li::before { content: '✓ '; color: var(--success); }
.plan ul li.li--addon::before {
  content: '+ ';
  color: var(--primary);
  font-weight: 700;
}
.plan ul li.li--addon {
  color: var(--text-bright);
  font-weight: 500;
}
.plan ul li.li--addon .addon-note {
  display: block;
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.plan [data-yearly] { display: none; }
.plans[data-billing="yearly"] [data-monthly] { display: none; }
.plans[data-billing="yearly"] [data-yearly] { display: inline; }

.card--recommended {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow-pop);
}

.ribbon {
  position: absolute;
  top: -10px;
  right: 16px;
  padding: 2px 10px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.toggle-billing {
  display: flex;
  width: max-content;
  margin: 0 auto 24px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  gap: 4px;
}
.toggle-billing__btn {
  padding: 6px 16px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.toggle-billing__btn:hover { color: var(--text-bright); }
.toggle-billing__btn.is-active {
  background: var(--primary);
  color: #fff;
}
.toggle-billing__hint {
  margin-left: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

/* Pulsing dot used by progress indicators (functional, not decorative) */
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse 1.2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.3); }
}
