.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
}

@media (min-width: 720px) {
  .container {
    width: min(100% - 3rem, var(--container));
  }
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100%;
  z-index: 1000;
  padding: var(--space-3) var(--space-4);
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-4);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-height);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration) var(--ease-out), box-shadow var(--duration) var(--ease-out);
}

@supports (backdrop-filter: blur(12px)) {
  .site-header {
    backdrop-filter: blur(12px);
  }
}

/* With JS, keep a fixed bar height so the hamburger layout stays compact */
.js .site-header {
  height: var(--header-height);
}

.site-header.is-scrolled {
  border-bottom-color: var(--color-border);
  box-shadow: var(--shadow-header);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  min-height: var(--header-height);
}

.js .site-header__inner {
  flex-wrap: nowrap;
  height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
  flex-shrink: 0;
}

.brand__wordmark {
  display: block;
  height: var(--wordmark-header-height);
  width: auto;
  max-width: 100%;
  overflow: visible;
  flex-shrink: 0;
}

.brand:hover {
  opacity: 0.92;
}

.brand:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;
}

/* Progressive enhancement:
   - Without JS: links stay visible (stacked under the brand on small screens).
   - With JS on small screens: collapse into a toggle panel; keep primary CTA visible. */
.nav__list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  order: 3;
  width: 100%;
  padding-bottom: var(--space-3);
}

.nav__link {
  display: block;
  padding: var(--space-3) var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  color: var(--color-text-muted);
}

.nav__link:hover,
.nav__link[aria-current="page"] {
  color: var(--color-text);
}

.nav__cta-bar {
  display: none;
}

.nav__cta-item {
  padding-top: var(--space-2);
}

.nav__cta-item .nav__cta {
  width: 100%;
  text-align: center;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
}

.nav-toggle__bars {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

.js .nav-toggle {
  display: inline-flex;
}

.js .nav__cta-bar {
  display: inline-flex;
  flex-shrink: 0;
}

.js .nav__cta-item {
  display: none;
}

.js .nav-toggle {
  flex-shrink: 0;
}

/* Narrow phones: keep header CTA readable — move it into the menu panel */
@media (max-width: 379px) {
  .js .nav__cta-bar {
    display: none;
  }

  .js .nav__cta-item {
    display: list-item;
    padding-top: var(--space-2);
  }

  .brand__wordmark {
    height: 1.5rem;
  }
}

@media (min-width: 380px) and (max-width: 429px) {
  .js .nav__cta-bar {
    padding-inline: var(--space-4);
    min-height: 2.5rem;
  }

  .brand__wordmark {
    height: 1.55rem;
  }
}

.js .nav__list {
  display: none;
  order: initial;
  width: auto;
  padding-bottom: 0;
}

.js .nav--open .nav__list {
  display: flex;
  position: absolute;
  left: 0;
  right: 0;
  top: var(--header-height);
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: auto;
  padding: var(--space-4);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

@media (min-width: 860px) {
  .nav {
    flex-wrap: nowrap;
    flex: 0 1 auto;
  }

  .nav__list,
  .js .nav__list,
  .js .nav--open .nav__list {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    order: initial;
    width: auto;
    gap: var(--space-5);
    padding: 0;
    background: transparent;
    border: 0;
  }

  .nav__link {
    padding: 0;
  }

  .nav-toggle,
  .js .nav-toggle,
  .nav__cta-bar,
  .js .nav__cta-bar {
    display: none;
  }

  .nav__cta-item,
  .js .nav__cta-item {
    display: list-item;
    padding-top: 0;
  }

  .nav__cta-item .nav__cta {
    width: auto;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--duration) var(--ease-out), color var(--duration) var(--ease-out), border-color var(--duration) var(--ease-out), transform var(--duration) var(--ease-out);
}

.btn:active {
  transform: translateY(1px);
}

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

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

/* Brand CTA: single clean gradient fill (no stacked layers / filters — avoids edge artifacts) */
.btn--primary.btn--brand {
  background: var(--gradient-brand-cta);
  border-color: transparent;
  color: #fff;
}

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

.btn--secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: rgba(11, 71, 233, 0.28);
}

.btn--secondary:hover {
  background: rgba(11, 71, 233, 0.06);
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

@media (max-width: 379px) {
  .btn-group {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-group .btn {
    width: 100%;
  }
}

/* Sections */
.section {
  padding-block: var(--space-8);
}

.section--tight {
  padding-block: var(--space-7);
}

.section__eyebrow {
  margin-bottom: var(--space-3);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.section__title {
  margin-bottom: var(--space-4);
  font-size: var(--text-2xl);
  letter-spacing: -0.03em;
}

.section__lead {
  max-width: 40rem;
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
}

.section__header {
  margin-bottom: var(--space-6);
}

/* FAQ */
.faq {
  display: grid;
  gap: var(--space-3);
  max-width: 44rem;
}

.faq__item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  overflow: hidden;
}

.faq__question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border: 0;
  background: transparent;
  text-align: left;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
}

.faq__icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  position: relative;
}

.faq__icon::before,
.faq__icon::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 0.75rem;
  height: 2px;
  background: var(--color-text-muted);
  transform: translate(-50%, -50%);
  transition: transform var(--duration) var(--ease-out);
}

.faq__icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.faq__item.is-open .faq__icon::after {
  transform: translate(-50%, -50%) rotate(0deg);
}

/* Without JS: answers remain visible. With JS: collapsed until opened. */
.faq__panel {
  display: block;
  padding: 0 var(--space-5) var(--space-5);
  color: var(--color-text-muted);
}

.js .faq__item:not(.is-open) .faq__panel {
  display: none;
}

.js .faq__item.is-open .faq__panel {
  display: block;
}

/* Forms */
.form {
  display: grid;
  gap: var(--space-4);
  max-width: 28rem;
}

.form__label {
  display: grid;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.form__input {
  width: 100%;
  min-height: 2.75rem;
  padding: var(--space-3) 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
}

.form__input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.form__check {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.form__check input {
  margin-top: 0.3rem;
}

.form__error {
  font-size: var(--text-xs);
  color: var(--color-error);
}

.form__hint {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Footer */
.site-footer {
  padding-block: var(--space-7);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.site-footer__grid {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 720px) {
  .site-footer__grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.site-footer__title {
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  font-weight: 700;
}

.site-footer a {
  display: inline-block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--color-primary);
}

.site-footer__note {
  margin-top: var(--space-6);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Notice / pending */
.notice {
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: rgba(11, 71, 233, 0.04);
}

.prose a,
.trust-list a,
.notice a,
.interest-benefits a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.prose a:hover,
.trust-list a:hover,
.notice a:hover,
.interest-benefits a:hover {
  color: var(--color-primary-hover);
}

.notice__title {
  margin-bottom: var(--space-2);
  font-size: var(--text-lg);
  color: var(--color-text);
}

.legal-placeholder {
  margin-top: var(--space-5);
  padding: var(--space-5);
  border: 1px dashed rgba(138, 106, 31, 0.45);
  border-radius: var(--radius-lg);
  background: rgba(138, 106, 31, 0.06);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.legal-placeholder code {
  font-size: 0.9em;
}
