:root {
  --bg: #f5f7fc;
  --bg-strong: #0d1631;
  --paper: rgba(255, 255, 255, 0.98);
  --paper-soft: rgba(255, 255, 255, 0.92);
  --paper-accent: #f8faff;
  --ink: #13213e;
  --muted: #5f6f8d;
  --line: rgba(19, 33, 62, 0.1);
  --line-strong: rgba(19, 33, 62, 0.18);
  --brand: #00008b;
  --brand-deep: #00006d;
  --brand-soft: #eef0ff;
  --danger: #8f2018;
  --danger-soft: #fff4f2;
  --warning: #6e532d;
  --warning-soft: #fff8ea;
  --success: #0c6643;
  --success-soft: #eef8f4;
  --shadow: 0 24px 60px rgba(19, 33, 62, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Montserrat", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(0, 0, 139, 0.06), transparent 24%),
    linear-gradient(180deg, #f9fbff 0%, var(--bg) 100%);
  line-height: 1.6;
}

body.auth-body {
  background:
    radial-gradient(circle at top left, rgba(84, 104, 182, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(0, 0, 139, 0.14), transparent 30%),
    linear-gradient(180deg, #091022 0%, var(--bg-strong) 100%);
  color: #ffffff;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img,
video {
  max-width: 100%;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
}

body.auth-body h1,
body.auth-body h2,
body.auth-body h3,
.page-hero h1,
.page-hero h2,
.page-hero h3 {
  color: inherit;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.04;
}

h2 {
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  line-height: 1.1;
}

p {
  margin: 0;
}

.site-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
}

.site-shell.narrow {
  width: min(880px, calc(100% - 28px));
}

.auth-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 36px 0;
}

.portal-card,
.portal-panel,
.portal-section,
.success-card,
.policy-card {
  background: var(--paper);
  border: 1px solid rgba(19, 33, 62, 0.08);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.portal-card {
  padding: 34px;
}

.portal-card.dark-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(246, 249, 255, 0.98) 100%);
}

.page-header {
  display: grid;
  gap: 18px;
  margin-bottom: 28px;
}

.brand-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
}

.brand-kicker::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.brand-motion-shell {
  width: min(240px, 46vw);
  padding: 12px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 0, 139, 0.12);
  box-shadow: 0 18px 34px rgba(0, 0, 139, 0.08);
}

.brand-motion {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  object-fit: contain;
}

.lede {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 66ch;
}

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

.intro-copy,
.section-copy,
.support-copy,
.page-copy {
  color: var(--muted);
}

.auth-grid {
  display: grid;
  gap: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}

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

.field.full {
  grid-column: 1 / -1;
}

.field label,
.field legend {
  font-size: 0.96rem;
  font-weight: 700;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.hint,
.microcopy,
.meta-copy {
  color: var(--muted);
  font-size: 0.91rem;
}

.required {
  color: var(--danger);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 14px 15px;
  font: inherit;
  color: var(--ink);
  background: #ffffff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

textarea {
  min-height: 132px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #8b94a3;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(0, 0, 139, 0.12);
}

input[disabled],
select[disabled],
textarea[disabled],
button[disabled] {
  opacity: 0.66;
  cursor: not-allowed;
}

.button-row,
.link-row,
.support-links,
.notice-links,
.success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.button {
  appearance: none;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 999px;
  cursor: pointer;
  padding: 16px 26px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button-primary {
  background: var(--brand);
  color: #ffffff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 18px 34px rgba(0, 0, 139, 0.18);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--brand-deep);
  transform: translateY(-1px);
  box-shadow: 0 20px 36px rgba(0, 0, 139, 0.22);
  text-decoration: none;
}

.button-secondary {
  background: #ffffff;
  color: var(--brand);
  border: 1px solid rgba(0, 0, 139, 0.16);
  box-shadow: 0 12px 24px rgba(19, 33, 62, 0.06);
}

.button-tertiary {
  background: transparent;
  color: var(--brand);
  border: 1px dashed rgba(0, 0, 139, 0.2);
}

.button-full {
  width: 100%;
}

.notice-box,
.warning-box,
.status-box,
.callout-box,
.locked-box {
  padding: 20px 22px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--paper-accent);
  color: var(--ink);
}

.warning-box {
  background: var(--warning-soft);
  border-color: rgba(110, 83, 45, 0.2);
  color: var(--warning);
}

.status-box.error,
.locked-box {
  background: var(--danger-soft);
  border-color: rgba(143, 32, 24, 0.18);
  color: var(--danger);
}

.status-box.success {
  background: var(--success-soft);
  border-color: rgba(12, 102, 67, 0.18);
  color: var(--success);
}

.notice-box h2,
.warning-box h2,
.callout-box h2,
.locked-box h2 {
  margin-bottom: 10px;
  font-size: 1.12rem;
}

.notice-box p + p,
.warning-box p + p,
.callout-box p + p,
.locked-box p + p {
  margin-top: 12px;
}

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

.portal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  font-size: 0.94rem;
}

.portal-footer {
  display: grid;
  gap: 12px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.92rem;
}

.portal-section {
  padding: 28px;
}

.panel-grid {
  display: grid;
  gap: 20px;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-grid,
.check-grid {
  display: grid;
  gap: 12px;
}

.choice-card,
.check-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 15px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.choice-card input,
.check-card input {
  margin-top: 2px;
  accent-color: var(--brand);
}

.choice-card strong,
.check-card strong {
  display: block;
  font-size: 0.97rem;
}

.choice-card span,
.check-card span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.choice-card.primary {
  border-color: rgba(0, 0, 139, 0.16);
  background: linear-gradient(180deg, rgba(238, 240, 255, 0.7) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.demo-shell {
  padding: 34px 0 64px;
}

.demo-hero {
  display: grid;
  gap: 22px;
  margin-bottom: 24px;
}

.demo-watermark {
  position: relative;
  overflow: hidden;
}

.demo-watermark::before {
  content: "DEMO ONLY";
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-18deg);
  font-size: clamp(3rem, 9vw, 7rem);
  letter-spacing: 0.16em;
  color: rgba(0, 0, 139, 0.04);
  font-weight: 800;
  pointer-events: none;
  white-space: nowrap;
}

.demo-gate[aria-disabled="true"] {
  opacity: 0.55;
}

.demo-disabled-note {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(238, 240, 255, 0.72);
  border: 1px solid rgba(0, 0, 139, 0.12);
  color: var(--brand);
  font-size: 0.93rem;
  font-weight: 600;
}

.response-box {
  display: none;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid transparent;
}

.response-box.is-visible {
  display: block;
}

.response-box.error {
  background: var(--danger-soft);
  border-color: rgba(143, 32, 24, 0.18);
  color: var(--danger);
}

.response-box.success {
  background: var(--success-soft);
  border-color: rgba(12, 102, 67, 0.18);
  color: var(--success);
}

.success-card {
  padding: 32px;
  display: grid;
  gap: 18px;
}

.success-kicker {
  display: inline-flex;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 139, 0.08);
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reference-pill {
  display: inline-flex;
  width: fit-content;
  padding: 10px 16px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 139, 0.14);
  color: var(--brand);
  font-weight: 700;
}

.page-grid {
  display: grid;
  gap: 24px;
}

.policy-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.policy-list li + li {
  margin-top: 10px;
}

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-item {
  padding: 14px 16px;
  border-radius: 16px;
  background: #fbfcfe;
  border: 1px solid var(--line);
}

.detail-item strong {
  display: block;
  margin-bottom: 6px;
}

.link-stack {
  display: grid;
  gap: 10px;
}

.footer-contact {
  display: grid;
  gap: 4px;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.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;
}

@media (max-width: 860px) {
  .form-grid,
  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-shell,
  .site-shell.narrow {
    width: min(100% - 20px, 1180px);
  }

  .portal-card,
  .portal-panel,
  .portal-section,
  .success-card,
  .policy-card {
    padding: 22px;
  }

  .button-row,
  .link-row,
  .support-links,
  .notice-links,
  .success-actions {
    align-items: stretch;
  }

  .button {
    width: 100%;
  }
}
