/* IDL Teams Join — throwaway prototype
   Experiment tokens: bg #061015 / cards #0c202b / accent #c0e700 */

:root {
  --bg: #061015;
  --panel: #0c202b;
  --card: #0c202b;
  --card-hover: #0f2835;
  --line: #232a35;
  --text: #ffffff;
  --muted: #90999f;
  --muted-2: #d5d7d9;
  --lime: #c0e700;
  --on-lime: #0c0f13;
  --input: #121d22;
  --danger: #e85d5d;
  --ok: #7dcf6e;
  --radius: 8px;
  --font-ui: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: Impact, "Arial Narrow", "Helvetica Condensed", Haettenschweiler, sans-serif;
  --inset: 82px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100%;
}

a { color: var(--muted-2); text-decoration: none; }
a:hover { color: var(--lime); text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }

.topbar {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px var(--inset);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 18px; }
.wordmark {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.04em;
  color: var(--text);
  text-decoration: none;
  line-height: 1;
}
.wordmark:hover { color: var(--lime); text-decoration: none; }
.site-nav { display: flex; align-items: center; gap: 18px; }
.nav-link {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.nav-link:hover { color: var(--muted-2); text-decoration: none; }
.nav-link.is-active { color: var(--lime); }
.get-tickets { text-decoration: none !important; }
.role-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--input);
}
.role-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 7px 12px;
}
.role-btn.is-active { background: var(--lime); color: var(--on-lime); }

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px var(--inset) 64px;
  min-height: calc(100vh - 120px);
}
.site-footer {
  border-top: 1px solid var(--line);
  padding: 16px var(--inset);
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.site-footer p { margin: 0; }

.experiment-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lime);
  margin-bottom: 8px;
}
.display {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 8px;
  line-height: 0.95;
}
.display-xl { font-size: clamp(36px, 6vw, 56px); }
.display-lg { font-size: clamp(28px, 4vw, 40px); }
.display-md { font-size: 22px; }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.small { font-size: 13px; }

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.page-head p { margin: 0; max-width: 560px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 4px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: filter 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn:disabled, .btn.is-disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.btn-lime { background: var(--lime); color: var(--on-lime); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--muted); }
.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}
.btn-danger:hover { background: rgba(232, 93, 93, 0.08); }
.btn-sm { padding: 8px 12px; font-size: 11px; }
.btn-block { width: 100%; }

.debug-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
}
.debug-link {
  background: none;
  border: 0;
  padding: 0;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
}
.debug-link:hover { color: var(--muted-2); text-decoration: underline; }
a.debug-link { color: var(--muted); }
a.debug-link:hover { color: var(--muted-2); }

.filters {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 24px;
  display: grid;
  gap: 14px;
}
.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.filter-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 6px;
  min-width: 108px;
}
.chip {
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--muted-2);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
}
.chip:hover {
  border-color: #2f3a45;
  color: var(--text);
}
/* Quiet active: soft fill / soft border — solid lime reserved for CTAs */
.chip.is-active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: #3d4a56;
  box-shadow: none;
}

.chip-near-me {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
  padding: 7px 14px;
  flex-shrink: 0;
}
.chip-near-me.is-near-me,
.chip-near-me.is-active {
  background: transparent;
  color: var(--lime);
  border-color: var(--lime);
  box-shadow: none;
}
.near-me-hint {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.discover-search-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: 0;
}
.discover-search-wrap {
  flex: 1 1 240px;
  min-width: 0;
  max-width: 480px;
}
.discover-search {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text);
  border-radius: 4px;
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.discover-search::placeholder {
  color: var(--muted);
}
.discover-search:focus {
  border-color: #3d4a56;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.team-card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.kind-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 3px;
  border: 1px solid var(--line);
  color: var(--muted-2);
  background: transparent;
}
.kind-badge.is-pro {
  color: var(--muted-2);
  border-color: #2c3644;
}
.kind-badge.is-community {
  color: #a8b4bc;
  border-color: #2a3540;
}
.team-card-distance {
  font-size: 12px;
  color: var(--muted);
}
.profile-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.profile-badges .badge-open {
  margin: 0;
}
.filters-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.result-count { color: var(--muted); font-size: 13px; }

.discover-primary {
  display: grid;
  gap: 14px;
}
.filters-primary-row {
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px 16px;
}
.filters-city-group {
  flex: 1 1 220px;
  min-width: 0;
}
.filters-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--muted-2);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
}
.filters-toggle:hover {
  border-color: #2f3a45;
  color: var(--text);
}
.filters-toggle.is-open {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: #3d4a56;
}
.filters-toggle.has-active:not(.is-open) {
  color: var(--text);
  border-color: #3d4a56;
}
.filters-toggle-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.7;
  transition: transform 0.15s ease;
}
.filters-toggle.is-open .filters-toggle-caret {
  transform: rotate(180deg);
}
.filters-panel {
  display: none;
  gap: 14px;
  margin-top: 2px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.filters-panel.is-open {
  display: grid;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.team-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  text-align: left;
  color: inherit;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.team-card:hover {
  background: var(--card-hover);
  border-color: #2c3644;
}
.team-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.team-card-name {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 22px;
  letter-spacing: 0.02em;
  margin: 0;
}
.team-card-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.status-text {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--muted);
}
.status-text.is-open { color: var(--lime); }
.status-text.is-invite { color: #f0c56e; }
.view-hint {
  margin-top: auto;
  padding-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.empty-state {
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
}
.empty-state h2 { margin: 0 0 8px; }
.empty-state p { margin: 0 0 20px; color: var(--muted); }

.back-row { margin-bottom: 16px; }
.back-row a { color: var(--muted-2); }
.back-row a:hover { color: var(--lime); }

.profile { display: grid; gap: 20px; }
@media (min-width: 800px) {
  .profile { grid-template-columns: 1.4fr 0.9fr; align-items: start; }
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.profile-meta-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.profile-meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.profile-meta-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.profile-meta-list .k { color: var(--muted); }
.profile-meta-list .v { font-weight: 600; text-align: right; }

.cta-box h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  margin: 0 0 8px;
  font-size: 20px;
}
.cta-box p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.notice {
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 14px;
}
.notice strong { color: var(--text); }
.badge-open {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lime);
  border: 1px solid rgba(192, 231, 0, 0.35);
  background: transparent;
  padding: 4px 8px;
  border-radius: 3px;
  margin: 10px 0 0;
}

.form-shell { max-width: 560px; }
.form-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px 0;
  position: relative;
}
.identity-preview {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 18px;
}
.identity-card {
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  margin-bottom: 18px;
}
.identity-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.identity-card-note { margin: 0; }
.identity-fields {
  display: grid;
  gap: 10px;
}
.identity-fields .field-tight { margin-bottom: 0; }
.identity-fields .field-tight input {
  background: var(--panel);
}
@media (min-width: 560px) {
  .identity-fields {
    grid-template-columns: 1fr 1fr;
  }
  .identity-fields .field-tight:last-child {
    grid-column: 1 / -1;
  }
}
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a3540, #121d22);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--lime);
  flex-shrink: 0;
}
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid rgba(192, 231, 0, 0.35);
  border-color: var(--lime);
}
.field textarea { min-height: 90px; resize: vertical; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.form-sticky-actions {
  position: sticky;
  bottom: 0;
  margin: 8px -20px 0;
  padding: 14px 20px 18px;
  background: linear-gradient(180deg, rgba(6, 16, 21, 0) 0%, var(--panel) 28%);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  z-index: 5;
}

.success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #16301a;
  border: 1px solid #2a5530;
  display: grid;
  place-items: center;
  font-size: 28px;
  margin-bottom: 16px;
  color: var(--ok);
}
.checklist { list-style: none; padding: 0; margin: 16px 0 20px; }
.checklist li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  display: flex;
  gap: 10px;
}
.checklist li::before { content: "✓"; color: var(--lime); font-weight: 700; }

.privacy-banner {
  background: #12180a;
  border: 1px solid #3a4a10;
  color: #dce8a8;
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}
.thread-layout { display: grid; gap: 16px; }
@media (min-width: 800px) {
  .thread-layout { grid-template-columns: 1fr 1fr; }
}
.msg-bubble {
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-top: 12px;
}
.msg-bubble .who {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.status-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 3px;
  margin-bottom: 12px;
}
.status-pending { background: #1a1508; color: #f0c56e; border: 1px solid #4a3a12; }
.status-accepted { background: #16301a; color: #b8f0b0; border: 1px solid #2a5530; }
.status-declined { background: #3a1515; color: #ffb4b4; border: 1px solid #5a2222; }
.status-expired { background: #1a1a1a; color: var(--muted); border: 1px solid var(--line); }
.status-next { background: #0c1a2a; color: #8ec8ff; border: 1px solid #1e3a55; }

.captain-inbox { margin-bottom: 20px; }
.inbox-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 8px;
  cursor: pointer;
  width: 100%;
  color: inherit;
  text-align: left;
}
.inbox-item:hover { background: var(--card-hover); }
.note-box { margin-top: 12px; }
.captain-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

@media (max-width: 900px) {
  :root { --inset: 24px; }
  .site-nav { display: none; }
}
@media (max-width: 640px) {
  :root { --inset: 14px; }
  .topbar-inner { padding: 12px var(--inset); flex-wrap: wrap; }
  .app { padding: 20px var(--inset) 48px; }
  .get-tickets { display: none; }
  .filter-label { min-width: 100%; margin-bottom: 2px; }
}

.field-invalid {
  border-color: #ff5c5c !important;
  outline: 1px solid rgba(255, 92, 92, 0.45);
}
.form-error {
  margin: 0 0 12px;
  color: #ffb4b4;
  border-color: rgba(255, 92, 92, 0.55);
}
