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

:root {
  --bg: #0b0b0e;
  --bg-deep: #070709;
  --surface: rgba(16, 16, 20, 0.96);
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.24);
  --field: rgba(11, 11, 14, 0.9);
  --text: #f4f7fb;
  --text-muted: #bcc7d6;
  --text-soft: #8f9eb0;
  --accent: #9ab4cf;
  --accent-soft: rgba(154, 180, 207, 0.14);
  --accent-strong: #3b82f6;
  --accent-ink: #ffffff;
  --shadow: 0 24px 52px rgba(0, 0, 0, 0.52);
}

body {
  font-family: "Inter", "Segoe UI Variable", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(180deg, #111114 0%, var(--bg) 50%, var(--bg-deep) 100%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.card {
  width: 100%;
  max-width: 440px;
  padding: 32px 32px 34px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card-wide {
  max-width: 760px;
}

.logo-wrap {
  text-align: center;
  width: min(100%, 286px);
  margin: 0 auto 24px;
}

.logo-wrap img {
  display: block;
  width: 100%;
  height: auto;
}

.title {
  margin-bottom: 10px;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--text);
  text-align: center;
}

.subtitle {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.65;
  text-align: center;
  margin: 0 0 24px;
}

.notice {
  display: none;
  margin-bottom: 16px;
  padding: 13px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid var(--line);
}

.notice.show {
  display: block;
}

.notice.error {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.notice.success {
  background: var(--accent-soft);
  color: var(--text);
  border-color: rgba(154, 180, 207, 0.26);
}

.field {
  margin-bottom: 14px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-soft);
}

input {
  width: 100%;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  color: var(--text);
  font-size: 14px;
}

input:focus {
  outline: none;
  border-color: rgba(154, 180, 207, 0.42);
  box-shadow: 0 0 0 3px rgba(154, 180, 207, 0.12);
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  padding: 0;
  border-radius: 4px;
  accent-color: var(--accent-strong);
  box-shadow: none;
}

button {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 600;
  background: var(--accent-strong);
  color: var(--accent-ink);
  cursor: pointer;
  margin-top: 6px;
  transition: background 160ms ease, transform 160ms ease;
}

button:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

button:active {
  opacity: 0.94;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  background: rgba(59, 130, 246, 0.52);
}

button:disabled:hover {
  background: rgba(59, 130, 246, 0.52);
  transform: none;
}

.links {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}

.links a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 13px;
  transition: color 160ms ease;
}

.links a:hover,
.links a:focus-visible {
  color: var(--text);
  outline: none;
}

.helper {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.legal-panel {
  margin: 18px 0 4px;
  padding: 22px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(154, 180, 207, 0.08), rgba(16, 16, 20, 0.96));
}

.legal-summary-text {
  margin-bottom: 0;
  line-height: 1.72;
}

.legal-age-note {
  margin-top: 12px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.6;
}

.legal-open-note {
  margin-top: 8px;
  color: var(--accent);
  font-size: 12px;
  line-height: 1.6;
}

.legal-readers {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.legal-drawer {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.legal-drawer summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.legal-drawer summary::-webkit-details-marker {
  display: none;
}

.drawer-status {
  margin-left: 10px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 500;
}

.legal-drawer[open] summary {
  border-bottom: 1px solid var(--line);
}

.legal-drawer-body {
  padding: 12px;
}

.legal-frame {
  width: 100%;
  min-height: 360px;
  border: 0;
  border-radius: 12px;
  background: #050608;
}

.legal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ghost-btn {
  width: auto;
  margin-top: 0;
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.ghost-btn:hover {
  background: rgba(59, 130, 246, 0.18);
}

.doc-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.doc-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 12px;
}

.age-gate {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}

.age-gate legend {
  padding: 0 8px;
  color: var(--text-soft);
  font-size: 12px;
}

.choice-row,
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
}

.choice-row + .choice-row {
  margin-top: 10px;
}

.checklist {
  display: grid;
  gap: 8px;
}

.checkbox-row {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.checkbox-row input[type="checkbox"] {
  margin-top: 3px;
  flex: 0 0 auto;
}

.checkbox-row a {
  color: var(--accent-strong);
  text-decoration: none;
}

.checkbox-row a:hover,
.checkbox-row a:focus-visible {
  text-decoration: underline;
}

.checkbox-row input:disabled + span {
  opacity: 0.62;
}

.checkbox-note {
  padding: 0 16px 4px 44px;
  color: var(--text-soft);
  font-size: 12px;
}

.checkbox-note-muted {
  color: rgba(143, 158, 176, 0.86);
  font-size: 11px;
}

.field-error {
  display: none;
  color: #fca5a5;
  font-size: 12px;
  line-height: 1.5;
  padding-left: 4px;
}

.field-error.show {
  display: block;
}

.modal-open {
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.76);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.modal-card {
  width: min(860px, 100%);
  max-height: min(88vh, 900px);
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(12, 12, 15, 0.98);
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-eyebrow {
  color: var(--text-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.modal-head h3 {
  font-size: 22px;
  margin-bottom: 6px;
}

.modal-meta {
  color: var(--text-soft);
  font-size: 12px;
}

.modal-close {
  width: auto;
  min-width: 42px;
  padding: 10px 12px;
  margin-top: 0;
  background: transparent;
  border-color: var(--line);
}

.modal-body {
  overflow: auto;
  max-height: calc(88vh - 100px);
  padding: 22px;
  color: var(--text-muted);
  line-height: 1.7;
}

.modal-body .legal-section + .legal-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.modal-body h2 {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 15px;
  text-transform: none;
  letter-spacing: 0;
}

.modal-body p,
.modal-body li {
  font-size: 14px;
}

.modal-body ul,
.modal-body ol {
  padding-left: 20px;
}

.modal-body a {
  color: var(--accent-strong);
}

@media (max-width: 480px) {
  .card {
    padding: 28px 20px 30px;
  }

  .logo-wrap {
    width: min(100%, 248px);
    margin-bottom: 22px;
  }

  .title {
    font-size: 24px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
  }

  .legal-panel {
    padding: 18px;
  }

  .checkbox-note {
    padding-left: 12px;
  }

  .modal-overlay {
    padding: 10px;
  }

  .modal-head,
  .modal-body {
    padding-left: 16px;
    padding-right: 16px;
  }
}
