:root {
  --bg: #140b2b;
  --bg-soft: #1b1040;
  --panel: rgba(24, 16, 58, 0.76);
  --panel-strong: rgba(28, 18, 67, 0.92);
  --panel-dark: #0d0920;
  --line: rgba(114, 94, 255, 0.28);
  --line-strong: rgba(79, 216, 255, 0.42);
  --text: #eef3ff;
  --muted: #b3b7e6;
  --brand: #ff4fd8;
  --brand-dark: #7a5cff;
  --accent: #42d9ff;
  --accent-soft: rgba(66, 217, 255, 0.16);
  --success: #65ffbb;
  --warning: #ffd166;
  --danger: #ff6b9f;
  --shadow: 0 28px 70px rgba(5, 4, 22, 0.48);
  --shadow-soft: 0 16px 40px rgba(15, 10, 44, 0.34);
  --radius: 28px;
  --radius-sm: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 79, 216, 0.28), transparent 26%),
    radial-gradient(circle at top right, rgba(66, 217, 255, 0.22), transparent 22%),
    linear-gradient(180deg, #26104f 0%, #140b2b 42%, #0a0820 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(84, 225, 255, 0.12) 1px, transparent 1px), linear-gradient(90deg, rgba(84, 225, 255, 0.12) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.28), transparent 75%);
  pointer-events: none;
}

a { color: inherit; }

h2, h3 {
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  letter-spacing: 0.01em;
}

h1, strong {
  font-family: "Segoe UI", "Trebuchet MS", "Arial Narrow", sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.shell {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 56px;
}

.topbar {
  position: relative;
  z-index: 80;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  margin-bottom: 28px;
  background: rgba(18, 12, 44, 0.72);
  border: 1px solid rgba(93, 82, 255, 0.34);
  border-radius: 999px;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
}

.brand { display: flex; flex-direction: column; text-decoration: none; }
.brand strong { font-size: clamp(1.45rem, 2vw, 2.35rem); letter-spacing: 0.03em; }
.brand span { color: var(--muted); font-size: 0.95rem; max-width: 38rem; }

.nav { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.nav { position: relative; z-index: 81; }

.locale-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(16, 10, 40, 0.72);
}

.locale-link {
  min-width: 44px;
  text-align: center;
  text-decoration: none;
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--muted);
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.locale-link:hover {
  color: var(--text);
  background: rgba(66, 217, 255, 0.12);
  transform: translateY(-1px);
}

.locale-link.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(255, 79, 216, 0.18), rgba(66, 217, 255, 0.18));
  box-shadow: 0 0 0 1px rgba(255, 79, 216, 0.14), 0 0 22px rgba(66, 217, 255, 0.18);
}

.nav a, .ghost-button {
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(29, 18, 67, 0.84);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.nav a:hover, .ghost-button:hover, button:hover, .button-link:hover { transform: translateY(-1px); }

.nav a.active {
  background: linear-gradient(135deg, rgba(255, 79, 216, 0.18), rgba(66, 217, 255, 0.18));
  border-color: rgba(84, 225, 255, 0.42);
  box-shadow: 0 0 0 1px rgba(255, 79, 216, 0.14), 0 0 22px rgba(66, 217, 255, 0.18);
}

.nav-user { color: var(--muted); padding: 0 6px; }
.nav-menu {
  position: relative;
  z-index: 82;
}

.nav-menu summary {
  list-style: none;
}

.nav-menu summary::-webkit-details-marker {
  display: none;
}

.nav-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(29, 18, 67, 0.84);
  color: var(--text);
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.nav-menu[open] .nav-menu-toggle,
.nav-menu-toggle.active,
.nav-menu-toggle:hover {
  background: linear-gradient(135deg, rgba(255, 79, 216, 0.18), rgba(66, 217, 255, 0.18));
  border-color: rgba(84, 225, 255, 0.42);
  box-shadow: 0 0 0 1px rgba(255, 79, 216, 0.14), 0 0 22px rgba(66, 217, 255, 0.18);
}

.nav-menu-caret {
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 140ms ease;
}

.nav-menu[open] .nav-menu-caret {
  transform: rotate(-135deg) translate(-1px, -1px);
}

.nav-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 22px;
  background: rgba(16, 10, 40, 0.96);
  border: 1px solid rgba(84, 225, 255, 0.18);
  box-shadow: var(--shadow-soft);
  z-index: 90;
}

.nav-menu-link,
.nav-menu-button {
  width: 100%;
}

.nav-menu-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-menu-form {
  display: grid;
}

.hero, .panel {
  background: var(--panel);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(90, 83, 255, 0.34);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 36px;
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: 24px;
  margin-bottom: 24px;
  background:
    linear-gradient(135deg, rgba(255, 79, 216, 0.14), rgba(66, 217, 255, 0.08)),
    var(--panel);
}

.hero::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -100px;
  top: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(66, 217, 255, 0.22), transparent 70%);
  pointer-events: none;
}

.hero h1 { margin: 0 0 12px; font-size: clamp(1.9rem, 3vw, 3.6rem); line-height: 0.92; }
.hero p { color: var(--muted); font-size: 1.05rem; line-height: 1.7; margin: 0; }

.hero-card {
  background: rgba(13, 9, 32, 0.88);
  color: var(--text);
  border-radius: 24px;
  padding: 24px;
  display: grid;
  gap: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.metric {
  display: grid;
  gap: 4px;
  border-top: 1px solid rgba(84, 225, 255, 0.14);
  padding-top: 14px;
}

.metric strong {
  display: block;
  font-size: 1.2rem;
}

.metric span {
  display: block;
  color: var(--muted);
}

.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.span-5 { grid-column: span 5; }
.span-7 { grid-column: span 7; }
.span-12 { grid-column: span 12; }

.panel { padding: 26px; }
.panel h2, .panel h3 { margin-top: 0; margin-bottom: 14px; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 14px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.single { grid-template-columns: 1fr; }

label { display: grid; gap: 8px; font-size: 0.95rem; color: var(--muted); }

.label-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
}

input {
  width: 100%;
  border: 1px solid rgba(93,74,55,0.18);
  background: rgba(14, 10, 35, 0.82);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.24);
}

.checkbox { display: flex; align-items: center; gap: 10px; color: var(--text); }
.checkbox input { width: auto; }

.button-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

button, .button-link {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: white;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px rgba(122, 92, 255, 0.34), 0 0 26px rgba(255, 79, 216, 0.18);
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.secondary {
  background: rgba(22, 14, 52, 0.82);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

.danger { background: linear-gradient(135deg, #c04b4b, #7c1f1f); }
.inline-form { display: inline; }

.flash, .notice {
  margin-bottom: 14px;
  border-radius: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: rgba(22, 14, 52, 0.82);
  box-shadow: var(--shadow-soft);
}

.flash.success { border-color: rgba(31,122,77,0.25); color: var(--success); }
.flash.error { border-color: rgba(170,46,46,0.25); color: var(--danger); }
.flash.info { border-color: rgba(66, 217, 255, 0.28); color: var(--accent); }
.notice { border-color: rgba(255, 209, 102, 0.35); background: rgba(53, 33, 87, 0.92); color: #ffe08f; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }

.pill {
  display: inline-flex;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  background: rgba(66, 217, 255, 0.12);
  color: var(--text);
}

.pill.success { background: rgba(31,122,77,0.12); color: var(--success); }
.pill.pending { background: rgba(172,106,5,0.14); color: var(--warning); }
.pill.failed { background: rgba(170,46,46,0.12); color: var(--danger); }

.terminal-card {
  padding: 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(21, 14, 50, 0.76);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}

.empty { color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 18px; text-align: center; }
.hero-copy { display: grid; gap: 18px; align-content: start; }

.hero-intro {
  display: grid;
  gap: 16px;
  max-width: 44rem;
}

.hero-visual {
  min-height: 100%;
  padding: 12px;
  border-radius: 26px;
  background: rgba(15, 10, 37, 0.74);
  border: 1px solid rgba(84, 225, 255, 0.26);
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-visual img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  border-radius: 20px;
  box-shadow: 0 20px 32px rgba(31, 23, 16, 0.14);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}

.pricing-panel {
  margin-top: 24px;
  margin-bottom: 24px;
  background:
    linear-gradient(135deg, rgba(255, 79, 216, 0.12), rgba(66, 217, 255, 0.08)),
    var(--panel-strong);
}

.pricing-panel h2 {
  margin-bottom: 6px;
}

.info-card {
  grid-column: span 4;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--panel-strong);
  border: 1px solid rgba(101, 92, 255, 0.28);
  box-shadow: var(--shadow-soft);
}

.info-card p, .info-card li { color: var(--muted); line-height: 1.65; }

.info-card ul {
  margin: 0;
  padding-left: 18px;
}

.link-list {
  display: grid;
  gap: 12px;
}

.resource-link {
  display: block;
  padding: 14px 16px;
  border-radius: 16px;
  text-decoration: none;
  background: linear-gradient(135deg, rgba(255, 79, 216, 0.12), rgba(66, 217, 255, 0.1));
  border: 1px solid rgba(84, 225, 255, 0.2);
}

.resource-link strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.02rem;
}

.resource-link span {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
  word-break: break-word;
}

.auth-panel {
  display: grid;
  gap: 18px;
  align-content: start;
}

.auth-form-shell {
  background: rgba(16, 10, 40, 0.78);
  border: 1px solid rgba(84, 225, 255, 0.18);
  border-radius: 22px;
  padding: 20px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}

.settings-disclosure {
  border: 1px solid rgba(84, 225, 255, 0.18);
  border-radius: 22px;
  background: rgba(16, 10, 40, 0.56);
  overflow: hidden;
}

.settings-disclosure summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  cursor: pointer;
}

.settings-disclosure summary::-webkit-details-marker {
  display: none;
}

.settings-disclosure summary span {
  display: grid;
  gap: 4px;
}

.settings-disclosure summary small {
  color: var(--muted);
  font-size: 0.85rem;
}

.settings-disclosure[open] summary {
  border-bottom: 1px solid rgba(84, 225, 255, 0.14);
}

.disclosure-body {
  padding: 18px 20px 20px;
}

.instruction-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.65;
}

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

.help-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(66, 217, 255, 0.08);
  border: 1px solid rgba(84, 225, 255, 0.16);
}

.help-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 79, 216, 0.22), rgba(66, 217, 255, 0.22));
  color: var(--text);
  font-weight: 700;
}

.help-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.help-link:hover {
  text-decoration: underline;
}

.field-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  vertical-align: middle;
  outline: none;
}

.field-help-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(66, 217, 255, 0.14);
  border: 1px solid rgba(84, 225, 255, 0.24);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: help;
}

.field-help-popup {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  display: grid;
  gap: 8px;
  width: min(280px, 70vw);
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(13, 9, 32, 0.96);
  border: 1px solid rgba(84, 225, 255, 0.18);
  box-shadow: var(--shadow-soft);
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
  pointer-events: none;
  z-index: 25;
}

.field-help-popup-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.field-help-popup-link:hover {
  text-decoration: underline;
}

.field-help.is-open .field-help-popup,
.field-help:focus-visible .field-help-popup,
.field-help:focus .field-help-popup {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.field-help.is-open .field-help-badge {
  background: linear-gradient(135deg, rgba(255, 79, 216, 0.22), rgba(66, 217, 255, 0.22));
  color: var(--text);
}

.billing-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.billing-meta-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(84, 225, 255, 0.14);
  background: rgba(16, 10, 40, 0.56);
}

.billing-meta-card strong,
.billing-meta-card span {
  display: block;
}

.billing-meta-card strong {
  margin-bottom: 6px;
}

.billing-meta-card span {
  color: var(--muted);
}

.profile-grid {
  align-items: start;
}

.profile-summary {
  display: grid;
  gap: 18px;
  padding: 20px;
  border-radius: 22px;
  background: rgba(16, 10, 40, 0.56);
  border: 1px solid rgba(84, 225, 255, 0.14);
}

.profile-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.site-footer {
  margin-top: 28px;
  padding: 8px 0 0;
}

.footer-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  width: fit-content;
  margin: 0 auto;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(16, 10, 40, 0.72);
  border: 1px solid rgba(84, 225, 255, 0.16);
  box-shadow: var(--shadow-soft);
}

.footer-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: 999px;
  transition: color 140ms ease, background 140ms ease, transform 140ms ease;
}

.footer-nav a:hover {
  color: var(--accent);
  background: rgba(66, 217, 255, 0.1);
  transform: translateY(-1px);
}

.legal-page {
  max-width: 860px;
  margin: 0 auto;
}

.legal-copy {
  color: var(--muted);
  line-height: 1.7;
}

.legal-copy p {
  margin: 0 0 14px;
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .info-card { grid-column: span 12; }
  .span-5, .span-7, .span-12 { grid-column: span 12; }
  .form-grid { grid-template-columns: 1fr; }
  .billing-meta { grid-template-columns: 1fr 1fr; }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    border-radius: 28px;
  }

  .nav-menu-panel {
    left: 0;
    right: auto;
  }
}

@media (max-width: 640px) {
  .shell { width: min(100% - 20px, 1180px); padding-top: 18px; }
  .hero, .panel, .info-card { padding: 20px; }
  .hero h1 { max-width: none; }
  .billing-meta { grid-template-columns: 1fr; }
  .nav { width: 100%; }
  .locale-switcher { width: 100%; justify-content: center; }
  .nav-menu,
  .nav-menu-toggle {
    width: 100%;
  }

  .nav-menu-panel {
    position: static;
    margin-top: 10px;
    min-width: 0;
  }
}
