@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300..700;1,300..700&family=Figtree:ital,wght@0,300..900;1,300..900&display=swap");

:root {
  color-scheme: dark;
  --bg: hsl(225, 30%, 6%);
  --bg-deep: hsl(225, 40%, 10%);
  --panel: rgba(255, 255, 255, 0.03);
  --panel-2: rgba(10, 18, 40, 0.5);
  --border: rgba(255, 255, 255, 0.1);
  --border-soft: rgba(128, 176, 255, 0.35);
  --text: #ffffff;
  --text-soft: #bfdbfe;
  --muted: hsl(225, 25%, 65%);
  --accent: #00ffee;
  --accent-dim: rgba(0, 255, 238, 0.12);
  --accent-glow: rgba(0, 255, 238, 0.2);
  --danger: #ff6b8a;
  --success: #4ade80;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --font-sans: "Figtree", system-ui, sans-serif;
  --font-serif: "Cormorant Garamond", Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  font-weight: 300;
  background: var(--bg);
  color: var(--text-soft);
  line-height: 1.6;
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-insignia {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.brand-wordmark {
  height: 28px;
  width: auto;
  display: block;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 30%, rgba(0, 255, 238, 0.35), rgba(9, 12, 22, 0.9));
  border: 1px solid rgba(0, 255, 238, 0.35);
  color: var(--accent);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.35rem;
}

.brand-title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.65rem;
  color: var(--text);
  letter-spacing: 0.01em;
}

.brand-sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
}

.mock-badge {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(0, 255, 238, 0.3);
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: start;
}

.sidebar,
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.sidebar { padding: 20px; }

.sidebar h2 {
  margin: 0 0 16px;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.step-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}

.step-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.92rem;
}

.step-list li:last-child { border-bottom: none; }
.step-list li.active { color: var(--text); font-weight: 500; }
.step-list li.done { color: var(--accent); }

.step-list .num {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid var(--border);
}

.step-list li.active .num {
  background: var(--accent-dim);
  border-color: rgba(0, 255, 238, 0.4);
  color: var(--accent);
}

.step-list li.done .num {
  background: rgba(0, 255, 238, 0.08);
  border-color: rgba(0, 255, 238, 0.35);
  color: var(--accent);
}

.sidebar-card {
  padding: 14px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
}

.label {
  margin: 0 0 4px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

.label.mt { margin-top: 12px; }

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  word-break: break-all;
}

.muted { color: var(--muted); }

.status-pill {
  display: inline-block;
  margin: 0;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(0, 255, 238, 0.25);
}

.panel {
  padding: 28px 32px 32px;
  min-height: 520px;
}

.panel h1,
.admin-shell-head h1,
.auth-card h1 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 2rem;
  color: var(--text);
  line-height: 1.15;
}

.lede {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 62ch;
  font-weight: 300;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  margin-bottom: 8px;
}

.form-grid .span-2 { grid-column: span 2; }

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-soft);
  font-weight: 400;
}

input,
select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 5px;
  border: 1px solid var(--border-soft);
  background: rgba(10, 16, 32, 0.45);
  color: var(--text);
  font: inherit;
  font-weight: 400;
  transition: border-color 0.15s ease, background 0.15s ease;
}

input::placeholder {
  color: rgba(122, 152, 216, 0.7);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(10, 16, 32, 0.65);
  box-shadow: 0 0 0 2px rgba(0, 255, 238, 0.15);
}

input.readonly {
  opacity: 0.75;
  cursor: not-allowed;
  background: rgba(0, 24, 48, 0.35);
}

.checkbox {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--text-soft);
  line-height: 1.5;
  margin: 12px 0 20px;
}

.checkbox input { width: auto; margin-top: 4px; }

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.btn {
  appearance: none;
  border-radius: 5px;
  padding: 0.85em 1.4em;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  background: rgba(0, 255, 238, 0.15);
  color: var(--text);
  border: 2px solid var(--accent);
  box-shadow: 0 2px 12px var(--accent-glow);
}

.btn.primary:hover:not(:disabled) {
  background: rgba(0, 255, 238, 0.25);
  box-shadow: 0 4px 20px rgba(0, 255, 238, 0.35);
}

.btn.secondary {
  background: rgba(10, 16, 32, 0.4);
  color: var(--text);
  border: 1px solid var(--border-soft);
}

.btn.secondary:hover:not(:disabled) {
  border-color: var(--accent);
}

.btn.ghost {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--border);
}

.btn.ghost:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--text);
}

.summary {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px 16px;
  margin: 0 0 8px;
}

.summary dt { color: var(--muted); margin: 0; }
.summary dd { margin: 0; word-break: break-word; color: var(--text-soft); }

.info-box {
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.info-box a {
  color: var(--accent);
  word-break: break-all;
}

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  background: rgba(255, 107, 138, 0.1);
  border: 1px solid rgba(255, 107, 138, 0.35);
  color: #ffc7d2;
}

.alert.ok {
  background: rgba(0, 255, 238, 0.08);
  border-color: rgba(0, 255, 238, 0.35);
  color: #b8fff8;
}

.existing-apps { margin-top: 28px; }
.existing-apps ul { list-style: none; margin: 0; padding: 0; }

.existing-apps li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.existing-apps button { flex-shrink: 0; }

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  padding: 10px 0 10px 16px;
  border-left: 2px solid var(--border);
  margin-left: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.timeline li strong {
  color: var(--text-soft);
  display: block;
  margin-bottom: 2px;
}

.hidden { display: none !important; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .summary { grid-template-columns: 1fr; }
}

/* —— Admin invite portal —— */
.admin-page .page.admin-page-inner {
  max-width: min(1440px, 100%);
  padding: 24px 32px 40px;
}

.admin-main { width: 100%; }

.admin-panel {
  width: 100%;
  min-height: auto;
  padding: 32px 40px 40px;
}

.admin-header { margin-bottom: 20px; }

.auth-card {
  max-width: 520px;
  margin: 0 auto;
}

.auth-card .lede { max-width: none; }

.admin-shell-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.admin-shell-head h1 { margin-bottom: 6px; }

.admin-lede {
  margin-bottom: 0;
  max-width: 72ch;
}

.form-grid-narrow {
  grid-template-columns: 1fr;
  max-width: 420px;
}

.form-grid-wide {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 20px;
}

.form-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px 22px;
  margin: 0 0 20px;
  background: var(--panel-2);
}

.form-section legend {
  padding: 0 8px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  font-family: var(--font-sans);
}

.form-grid-wide .span-2 { grid-column: span 2; }

.invite-history {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.invite-history h2 {
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text);
}

.invite-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.invite-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.invite-table th,
.invite-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.invite-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  background: rgba(9, 12, 22, 0.35);
}

.invite-table tbody tr:last-child td { border-bottom: none; }

.invite-table td.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 1100px) {
  .form-grid-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid-wide .span-2 { grid-column: span 2; }
}

@media (max-width: 700px) {
  .admin-page .page.admin-page-inner { padding: 16px; }
  .admin-panel { padding: 20px 18px 28px; }
  .admin-shell-head { flex-direction: column; align-items: stretch; }
  .form-grid-wide,
  .form-grid-wide .span-2 {
    grid-template-columns: 1fr;
    grid-column: span 1;
  }
}
