*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #0f172a;
  --bg-soft: #111827;
  --card: rgba(255, 255, 255, 0.94);
  --section: rgba(248, 250, 252, 0.72);
  --text: #0f172a;
  --muted: #475569;
  --line: #dbe4f0;
  --line-strong: #cbd5e1;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: rgba(37, 99, 235, 0.12);
  --danger: #dc2626;
  --success: #15803d;
  --success-soft: rgba(21, 128, 61, 0.12);
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
  --shadow-strong: 0 24px 60px rgba(15, 23, 42, 0.22);
  --radius-card: 22px;
  --radius-section: 18px;
  --radius-field: 14px;
  --container: 1120px;
  --field-height: 52px;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.28), transparent 35%),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.22), transparent 25%),
    linear-gradient(135deg, var(--bg), var(--bg-soft));
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.page {
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.page--centered {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding-top: 40px;
  padding-bottom: 40px;
}

.hero {
  color: #fff;
  margin-bottom: 24px;
}

.hero__nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 4px;
}

.hero__content {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.82;
}

.hero h1 {
  margin: 0 0 14px;
  max-width: 16ch;
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero__text {
  margin: 0;
  max-width: 58ch;
  font-size: 1.05rem;
  line-height: 1.65;
  opacity: 0.92;
  text-wrap: pretty;
}

.hero__faq-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.36);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
}

.hero__faq-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  padding: 32px;
}

.form-section + .form-section {
  margin-top: 28px;
}

.form-section {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-section);
  background: var(--section);
}

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

.section-header h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  line-height: 1.25;
  color: var(--text);
}

.section-header p {
  margin: 0;
  max-width: 60ch;
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}

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

.field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

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

label {
  margin-bottom: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  text-wrap: pretty;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-field);
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.98);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease,
    background-color 0.2s ease;
}

input {
  min-height: var(--field-height);
  padding: 14px 16px;
}

textarea {
  min-height: 120px;
  padding: 14px 16px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #64748b;
}

input:hover,
textarea:hover {
  border-color: var(--line-strong);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.8);
  box-shadow: 0 0 0 4px var(--primary-soft);
  transform: translateY(-1px);
}

.checkbox-grid,
.radio-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
}

.checkbox-grid label,
.radio-group label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.45;
  text-wrap: pretty;
}

.checkbox-grid--vertical {
  grid-auto-flow: column;
  grid-template-rows: repeat(5, auto);
}

.checkbox-grid--single {
  grid-template-columns: 1fr;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-height: auto;
  margin: 2px 0 0;
  padding: 0;
  flex: 0 0 auto;
  transform: scale(1.08);
  accent-color: var(--primary);
  box-shadow: none;
}

.hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  text-wrap: pretty;
}

.error {
  min-height: 20px;
  margin-top: 6px;
  color: var(--danger);
  font-size: 0.88rem;
  line-height: 1.35;
}

.input-error {
  border-color: rgba(220, 38, 38, 0.85) !important;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1) !important;
}

.actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
  flex-wrap: wrap;
}

button,
.btn-primary,
.btn-secondary {
  appearance: none;
  border: 0;
  border-radius: 999px;
  min-height: 48px;
  padding: 12px 22px;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

button:hover,
.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-1px);
}

button:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: #e2e8f0;
  color: var(--text);
  border: 1px solid transparent;
}

.btn-secondary:hover {
  background: #cfd9e6;
}

.form-message {
  margin-top: 18px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.45;
  min-height: 24px;
  text-align: right;
}

.form-message.success {
  color: var(--success);
}

.form-message.error {
  color: var(--danger);
}

/* =========================
   PAYMENT SUMMARY
========================= */

.payment-summary-loading {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 8px 0;
}

.loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  animation: dot-pulse 1.2s ease-in-out infinite;
}

.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-pulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
  40%           { opacity: 1;    transform: scale(1);    }
}

.payment-summary-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.payment-product-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
}

.payment-product-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.payment-product-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.payment-product-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
}

.payment-product-price {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-dark);
  white-space: nowrap;
}

.payment-secure-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.payment-summary-error {
  padding: 12px 16px;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: 12px;
  color: var(--danger);
  font-size: 0.9rem;
}

#submitBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* =========================
   SUCCESS PAGE
========================= */

.success-shell {
  width: min(100%, 760px);
  margin: 0 auto;
}

.success-card-v2 {
  position: relative;
  margin-top: 14px;
  padding: 40px 32px 32px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 28px;
  box-shadow: var(--shadow-strong);
  text-align: center;
}

.success-badge {
  width: 72px;
  height: 72px;
  margin: 0 auto 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(21, 128, 61, 0.12);
}

.success-badge span {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.success-heading {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
  text-wrap: balance;
}

.success-lead {
  margin: 0 auto 8px;
  max-width: 40ch;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  text-wrap: pretty;
}

.success-description {
  margin: 0 auto;
  max-width: 48ch;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--muted);
  text-wrap: pretty;
}

.success-note {
  margin: 24px auto 0;
  max-width: 460px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.96rem;
  line-height: 1.55;
  text-align: center;
  text-wrap: pretty;
}

.success-actions-v2 {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.success-actions-v2 a {
  text-decoration: none;
}

.success-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  min-width: 170px;
  padding: 0 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.98rem;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.25);
  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    color 0.2s ease;
}

.success-link-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.success-link-btn:focus-visible,
.success-link-secondary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16);
}

.success-link-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  min-width: 190px;
  padding: 0 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  background: rgba(226, 232, 240, 0.9);
  color: var(--text);
  border: 1px solid var(--line);
  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.success-link-secondary:hover {
  background: #e2e8f0;
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

/* =========================
   TERMS PAGE
========================= */

.terms-hero {
  color: #fff;
  margin-bottom: 24px;
}

.terms-hero h1 {
  margin: 0 0 14px;
  max-width: 760px;
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.terms-hero p:not(.eyebrow) {
  margin: 0;
  max-width: 680px;
  font-size: 1.05rem;
  line-height: 1.65;
  opacity: 0.92;
}

.terms-back-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  margin-bottom: 24px;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.terms-back-link:hover {
  background: rgba(255, 255, 255, 0.18);
}

.terms-language-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.terms-language-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.terms-card {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: var(--shadow);
}

.terms-card + .terms-card {
  margin-top: 28px;
}

.terms-section-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.terms-section-header h2 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.terms-section-header p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.terms-card section + section {
  margin-top: 24px;
}

.terms-card h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  line-height: 1.3;
}

.terms-card p,
.terms-card li {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.68;
  text-wrap: pretty;
}

.terms-card p {
  margin: 0;
}

.terms-card ul {
  margin: 10px 0 0;
  padding-left: 22px;
}

.terms-card li + li {
  margin-top: 6px;
}

.terms-card a {
  color: var(--primary-dark);
  font-weight: 800;
}

@media (max-width: 900px) {
  .hero__content {
    max-width: 680px;
  }

  .hero h1 {
    max-width: 14ch;
  }

  .hero__text {
    max-width: 52ch;
  }
}

@media (max-width: 768px) {
  .page {
    width: min(100% - 20px, var(--container));
    padding: 24px 0 40px;
  }

  .page--centered {
    align-items: start;
    padding-top: 24px;
    padding-bottom: 32px;
  }

  .hero {
    margin-bottom: 18px;
  }

  .hero__nav {
    justify-content: flex-start;
    margin-bottom: 18px;
  }

  .hero__content {
    max-width: 100%;
  }

  .hero h1 {
    max-width: 100%;
    font-size: clamp(1.8rem, 8vw, 2.45rem);
    line-height: 1.08;
  }

  .hero__text {
    max-width: 100%;
    font-size: 1rem;
    line-height: 1.6;
  }

  .card {
    padding: 22px 18px;
    border-radius: 18px;
  }

  .form-section {
    padding: 18px;
  }

  .form-grid,
  .checkbox-grid,
  .radio-group {
    grid-template-columns: 1fr;
  }

  .form-grid {
    gap: 18px;
  }

  input,
  textarea,
  button,
  .btn-primary,
  .btn-secondary {
    font-size: 16px;
  }

  .actions {
    justify-content: stretch;
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .actions button,
  .actions .btn-primary,
  .actions .btn-secondary {
    width: 100%;
  }

  .form-message {
    text-align: left;
  }

  .success-card-v2 {
    padding: 28px 20px 24px;
    border-radius: 22px;
  }

  .success-badge {
    width: 64px;
    height: 64px;
    margin-bottom: 18px;
  }

  .success-actions-v2 {
    flex-direction: column;
    align-items: stretch;
  }

  .success-link-btn,
  .success-link-secondary {
    width: 100%;
    min-width: 0;
  }

  .terms-card {
    padding: 22px 18px;
    border-radius: 18px;
  }

  .terms-back-link,
  .terms-language-links a {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .page {
    width: calc(100% - 16px);
  }

  .card {
    padding: 18px 14px;
  }

  .form-section {
    padding: 16px;
  }

  label {
    font-size: 0.93rem;
  }

  .checkbox-grid,
  .radio-group {
    padding: 14px;
    gap: 10px;
  }

  input,
  textarea {
    border-radius: 12px;
  }
}

.country-select {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
  padding: 14px;
}

.country-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.country-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
}

.country-chip button {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.country-chip button:hover {
  transform: none;
  color: var(--danger);
}

.country-search-wrap {
  position: relative;
}

.country-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
  display: none;
}

.country-suggestion {
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 600;
}

.country-suggestion:hover,
.country-suggestion.active {
  background: rgba(37, 99, 235, 0.08);
}

.country-empty {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* =========================
   FAQ MODAL
========================= */

.faq-modal[hidden] {
  display: none;
}

.faq-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.faq-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(8px);
}

.faq-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 860px);
  max-height: min(88vh, 820px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow: var(--shadow-strong);
}

.faq-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 252, 0.92);
}

.faq-modal__eyebrow {
  margin: 0 0 6px;
  color: var(--primary-dark);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.faq-modal__header h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.faq-modal__close {
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 999px;
  background: #e2e8f0;
  color: var(--text);
  font-size: 1.55rem;
  line-height: 1;
  flex: 0 0 auto;
}

.faq-modal__body {
  overflow-y: auto;
  padding: 24px 26px 28px;
}

.faq-modal__body h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  line-height: 1.3;
}

.faq-modal__body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  text-wrap: pretty;
}

.faq-modal__body a {
  color: var(--primary-dark);
  font-weight: 700;
}

.faq-intro,
.faq-requirements {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.82);
}

.faq-requirements {
  margin-top: 14px;
}

.faq-requirements ul {
  margin: 0 0 14px;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.6;
}

.faq-requirements li + li {
  margin-top: 6px;
}

.faq-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.faq-list details {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.faq-list summary {
  cursor: pointer;
  padding: 15px 18px;
  font-weight: 800;
  line-height: 1.45;
  color: var(--text);
}

.faq-list summary:hover {
  background: rgba(37, 99, 235, 0.06);
}

.faq-list details[open] summary {
  border-bottom: 1px solid var(--line);
  background: rgba(37, 99, 235, 0.08);
}

.faq-list details p {
  padding: 14px 18px 16px;
}

.faq-list details p + p {
  padding-top: 0;
}

@media (max-width: 768px) {
  .faq-modal {
    padding: 12px;
    align-items: end;
  }

  .faq-modal__panel {
    max-height: 92vh;
    border-radius: 18px;
  }

  .faq-modal__header,
  .faq-modal__body {
    padding-left: 18px;
    padding-right: 18px;
  }

  .faq-modal__header {
    padding-top: 20px;
  }
}
