/* Dark Google / Material product aesthetic */
:root {
  --bg: #202124;
  --bg-elevated: #292a2d;
  --surface: #303134;
  --surface-2: #3c4043;
  --border: #5f6368;
  --border-subtle: #3c4043;
  --text: #e8eaed;
  --text-secondary: #9aa0a6;
  --link: #8ab4f8;
  --link-hover: #aecbfa;
  --primary: #8ab4f8;
  --primary-text: #202124;
  --primary-hover: #aecbfa;
  --danger: #f28b82;
  --ok: #81c995;
  --focus: #8ab4f8;
  --shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.15);
  --radius: 8px;
  --radius-pill: 24px;
  --font: Roboto, "Google Sans", "Product Sans", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: var(--font);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* —— App chrome —— */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.gbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 64px;
  padding: 0 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-subtle);
}

.gbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 1.375rem;
  font-weight: 400;
  letter-spacing: 0;
}

.gbar-brand:hover {
  text-decoration: none;
  color: var(--text);
}

.gbar-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.gbar-mark svg {
  width: 16px;
  height: 16px;
  fill: var(--primary-text);
}

.gbar-product {
  color: var(--text);
}

.gbar-product span {
  color: var(--text-secondary);
  font-weight: 400;
}

.gbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gbar-nav a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  text-decoration: none;
}

.gbar-nav a:hover {
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.gbar-nav .admin-link {
  font-size: 0.75rem;
  opacity: 0.7;
}

.content {
  flex: 1;
  width: min(720px, calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

.content.wide {
  width: min(1100px, calc(100% - 48px));
}

.footer {
  margin-top: auto;
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  background: #171717;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.footer a {
  color: var(--text-secondary);
}

.footer a:hover {
  color: var(--text);
}

/* —— Hero / landing —— */
.hero {
  display: grid;
  gap: 12px;
  padding-top: 24px;
}

.eyebrow {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

.hero h1,
.page-title {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text);
}

.lede {
  margin: 0 0 8px;
  max-width: 36rem;
  color: var(--text-secondary);
  font-size: 1.0625rem;
  line-height: 1.5;
  font-weight: 400;
}

/* —— Card —— */
.card {
  margin-top: 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 28px 24px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 400;
}

.card p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
  font-size: 0.9375rem;
}

/* —— Forms —— */
.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

.field {
  display: grid;
  gap: 6px;
}

.field > span,
.claim-form label > span:first-child,
.claim-form > label:not(.tos-check) {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
}

.claim-form label:not(.tos-check) {
  display: grid;
  gap: 6px;
}

input[type="email"],
input[type="text"],
input[type="password"],
input[type="number"] {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.cta input[type="email"] {
  flex: 1 1 240px;
  width: auto;
}

input:hover {
  border-color: var(--text-secondary);
}

input:focus {
  border-color: var(--focus);
  box-shadow: inset 0 0 0 1px var(--focus);
}

input::placeholder {
  color: #80868b;
}

button,
.btn {
  appearance: none;
  border: 0;
  height: 40px;
  padding: 0 24px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--primary-text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s var(--ease), box-shadow 0.15s var(--ease);
  white-space: nowrap;
}

button:hover,
.btn:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow);
}

button:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

button.ghost,
.btn.ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--border);
}

button.ghost:hover,
.btn.ghost:hover {
  background: rgba(138, 180, 248, 0.08);
  box-shadow: none;
}

.seat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.seat-stat {
  background: var(--surface);
  border-radius: 8px;
  padding: 14px 16px;
}

.seat-stat strong {
  display: block;
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 4px;
  color: var(--text);
}

.seat-stat span {
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.status {
  min-height: 1.25rem;
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.4;
}

.status.error { color: var(--danger); }
.status.ok { color: var(--ok); }

.hint {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  max-width: 36rem;
  margin: 0;
}

/* —— Claim —— */
.claim-shell {
  display: grid;
  gap: 12px;
  padding-top: 12px;
}

.claim-shell h1 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.claim-form {
  display: grid;
  gap: 16px;
  margin-top: 8px;
}

.tos-check {
  display: grid !important;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  margin: 4px 0;
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.45;
}

.tos-check input {
  width: auto !important;
  height: auto !important;
  margin-top: 3px;
  accent-color: var(--primary);
}

.tos-check a {
  color: var(--link);
}

.tos-versions {
  display: block;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

/* —— Licensed module downloads (claim page only) —— */
.downloads-card {
  margin-top: 20px;
}

.downloads-card code {
  color: var(--link);
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.85em;
}

.downloads-list {
  display: grid;
  gap: 20px;
  margin-top: 18px;
}

.download-release h3 {
  margin: 0 0 4px;
  font-size: 1.0625rem;
  font-weight: 500;
}

.download-release .hint {
  margin-bottom: 10px;
}

.download-files {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.download-files li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface);
}

.download-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.download-meta strong {
  font-weight: 500;
  color: var(--text);
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.875rem;
}

.download-meta span {
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.download-size {
  color: var(--text-secondary) !important;
}

.download-soon {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-style: italic;
}

.download-files .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  height: 36px;
  padding: 0 18px;
}

.download-files .btn:hover {
  text-decoration: none;
  color: var(--primary-text);
}

/* —— Legal —— */
.legal {
  max-width: 40rem;
}

.legal h1 {
  margin: 4px 0 8px;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 400;
}

.legal ol {
  margin: 20px 0 0;
  padding-left: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.65;
  font-size: 0.9375rem;
}

.legal li {
  margin-bottom: 14px;
}

.legal strong {
  color: var(--text);
  font-weight: 500;
}

.legal code {
  color: var(--link);
  font-size: 0.9em;
  font-family: "Roboto Mono", ui-monospace, monospace;
}

/* —— Admin —— */
.admin-login,
.admin-console {
  margin-top: 8px;
}

.admin-login h1,
.admin-console h1,
.admin-shell h1 {
  margin: 0 0 8px;
  font-size: 1.75rem;
  font-weight: 400;
}

.admin-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 20px;
}

.admin-add {
  display: grid;
  grid-template-columns: 1.4fr 1fr 5rem 1fr auto;
  gap: 10px;
  margin-bottom: 12px;
  padding: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}

.admin-add input {
  width: 100%;
  height: 40px;
}

.admin-add button {
  height: 40px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-elevated);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-table th {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--surface);
}

.admin-table input.seat-edit {
  width: 4.5rem;
  height: 32px;
  padding: 0 8px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.row-actions button {
  height: 32px;
  padding: 0 12px;
  font-size: 0.75rem;
}

.admin-detail {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-elevated);
}

.admin-detail h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 400;
}

.admin-detail-actions {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

.admin-audit {
  margin-top: 24px;
  color: var(--text-secondary);
}

.admin-audit summary {
  cursor: pointer;
  margin-bottom: 10px;
  color: var(--text);
  font-weight: 500;
}

.admin-audit code,
.admin-table code {
  font-size: 0.8125rem;
  color: var(--link);
  font-family: "Roboto Mono", ui-monospace, monospace;
}

/* Legacy class aliases used by existing markup */
.shell {
  /* pages migrated to .app / .content; keep harmless */
}

.topbar { /* replaced by .gbar */ }
.holding { color: var(--text-secondary); font-size: 0.875rem; }
.brand { font-weight: 400; }
.glow-cta { /* no glow in Google theme */ }
.panel {
  margin-top: 0;
  padding: 0;
  border: 0;
  max-width: none;
}
.legal-shell .legal { padding: 0; }

@media (max-width: 720px) {
  .gbar {
    padding: 0 16px;
    height: 56px;
  }

  .gbar-brand {
    font-size: 1.125rem;
  }

  .content,
  .content.wide {
    width: min(100% - 32px, 1100px);
    padding: 32px 0 48px;
  }

  .cta {
    flex-direction: column;
    align-items: stretch;
  }

  .cta input[type="email"],
  .cta button,
  button,
  .btn,
  input {
    width: 100%;
  }

  .seat-row {
    grid-template-columns: 1fr;
  }

  .admin-add {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-direction: column;
    gap: 12px;
  }
}
