/* ════════════════════════════════════════════════════
   gate.css — NURI Pitch
   Accordion-style access gate: one persona group per card,
   each expands to reveal its own access-code input.
   Depends on: tokens.css, shared.css (gate-bg/scan-line,
   reveal-overlay base styles live in shared.css)
   ════════════════════════════════════════════════════ */

html, body {
  height: 100%;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 32px 20px;
  padding-bottom: max(32px, env(safe-area-inset-bottom));
}

/* ── SHELL ─────────────────────────────────────────── */
.gate-shell {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 560px;
  animation: gate-shell-in 0.5s var(--ease-spring) forwards;
}
@keyframes gate-shell-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}

/* ── LOGO ──────────────────────────────────────────── */
.gate-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 6px;
}
.gate-logo-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: var(--green-dim);
  border: 1px solid rgba(0,230,118,0.3);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.5px;
}
.gate-logo-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
  line-height: 1;
}

.gate-build {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text3);
  text-align: center;
  margin-bottom: 2rem;
}

/* ── HEADER TEXT ───────────────────────────────────── */
.gate-who-title {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--green);
  opacity: 0.85;
  text-align: center;
  margin-bottom: 0.5rem;
}
.gate-who-sub {
  font-size: 0.9rem;
  color: var(--text2);
  text-align: center;
  line-height: 1.65;
  margin-bottom: 1.75rem;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

/* ── GROUP CARDS ───────────────────────────────────── */
.group-cards {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  /* Only one card animates height at a time (see toggleGroup in
     gate.js) — this keeps the browser from nudging scroll position
     to compensate for a layout shift above the viewport. */
  overflow-anchor: none;
}

.group-card {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
  transition: border-color var(--t-base);
  cursor: pointer;
}
.group-card:hover { border-color: var(--border2); }
.group-card.expanded {
  border-color: rgba(0,230,118,0.5);
  background: var(--green-dim);
  cursor: default;
}
.group-card.collapsed {
  opacity: 0.7;
  transition: all 0.3s var(--ease);
}
.group-card.collapsed:hover {
  opacity: 1;
  border-color: var(--border2);
}

/* ── CARD HEADER ───────────────────────────────────── */
.group-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.4rem;
  user-select: none;
}
.group-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  background: var(--green-dim);
  border: 1px solid rgba(0,230,118,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
  flex-shrink: 0;
  transition: background var(--t-fast);
}
.group-card:hover .group-icon,
.group-card.expanded .group-icon { background: rgba(0,230,118,0.2); }

.group-text { flex: 1; min-width: 0; }
.group-label {
  font-family: var(--cond);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 0.25rem;
}
.group-members {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: var(--text3);
  text-transform: uppercase;
}
.group-chevron {
  color: var(--text3);
  flex-shrink: 0;
  transition: transform 0.3s var(--ease), color var(--t-fast);
}
.group-card.expanded .group-chevron {
  transform: rotate(90deg);
  color: var(--green);
}

/* ── CARD BODY (expandable) ─────────────────────────── */
.group-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.38s var(--ease);
}
.group-card.expanded .group-body {
  max-height: 320px;
}
.group-body-inner {
  padding: 0 1.4rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s 0.1s, transform 0.25s 0.1s;
}
.group-card.expanded .group-body-inner {
  opacity: 1;
  transform: none;
}

.group-divider {
  height: 1px;
  background: var(--border);
  margin: 0 -0.1rem;
}

/* ── CODE INPUT SECTION ─────────────────────────────── */
.code-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.code-label {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green);
  opacity: 0.85;
}
.code-row {
  display: flex;
  gap: 0.5rem;
}
.gate-input {
  flex: 1;
  padding: 0.85rem 1.1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.82rem;
  outline: none;
  transition: border-color var(--t-fast);
  letter-spacing: 0.08em;
}
.gate-input:focus { border-color: var(--green); }
.gate-input::placeholder { color: var(--text3); }
.gate-input:disabled { opacity: 0.5; cursor: not-allowed; }

.gate-btn {
  padding: 0.85rem 1.5rem;
  background: var(--green);
  color: #05170e;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t-fast), transform 0.1s;
  white-space: nowrap;
  flex-shrink: 0;
}
.gate-btn:hover  { background: var(--blue); color: #fff; }
.gate-btn:active { transform: scale(0.97); }
.gate-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.gate-error {
  display: none;
  font-size: 0.6rem;
  color: var(--red);
  letter-spacing: 0.04em;
}
.gate-note {
  font-size: 0.78rem;
  color: var(--text3);
  letter-spacing: 0.04em;
  line-height: 1.65;
  text-align: center;
  margin-top: 0.25rem;
}

/* ── FOOTER NOTICE ─────────────────────────────────── */
.orient-notice {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--text3);
  text-align: center;
  margin-top: 1.5rem;
  letter-spacing: 0.02em;
}
.orient-notice a { color: var(--text2); }
.orient-notice a:hover { color: var(--green); }

/* ── Gate footer ─────────────────────────────────────
   Preserved as-is: SmartPole OS's shared.css doesn't
   define this base rule, so it stays local to gate.css
   here too, matching the pre-existing pattern.        */
.gate-footer {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 1px;
  white-space: nowrap;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
}
.gate-footer::before,
.gate-footer::after {
  content: '';
  width: 32px; height: 1px;
  background: var(--border);
}

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 600px) {
  body { padding: 24px 16px; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .gate-logo-name { font-size: 1.5rem; }
  .gate-who-title { font-size: 0.66rem; }
  .gate-who-sub   { font-size: 0.84rem; }
  .group-header   { padding: 0.9rem 1.1rem; gap: 0.75rem; }
  .group-label    { font-size: 1.02rem; }
  .code-row       { flex-direction: column; }
  .gate-btn       { width: 100%; }
  .gate-footer    { bottom: max(16px, env(safe-area-inset-bottom)); font-size: 9px; }
}
