:root {
  --bg: #f3f8f6;
  --ink: #1c2a24;
  --muted: #486057;
  --accent: #0d8a6a;
  --accent-2: #f5b700;
  --card: #ffffff;
  --ring: rgba(13, 138, 106, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 10% 10%, #dff8ef 0%, var(--bg) 42%), linear-gradient(180deg, #f8fcfb 0%, #eef5f2 100%);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.2rem 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: clamp(160px, 24vw, 240px);
  height: auto;
}

.nav-link {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hero {
  padding: 0 0 3rem 0;
}

.hero-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem 2rem;
}

.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

h1 {
  font-size: clamp(2rem, 4.6vw, 4.2rem);
  margin: 0;
  line-height: 1.05;
  max-width: 900px;
}

.subhead {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.1rem;
  margin-top: 1rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.hero-note {
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: 0.95rem;
}


.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.section-alt {
  margin-top: 0.8rem;
}

.section h2 {
  margin: 0 0 0.6rem 0;
  font-size: clamp(1.5rem, 3.6vw, 2.3rem);
}

.section-lead {
  color: var(--muted);
  margin-top: 0;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card,
.price-card {
  background: var(--card);
  border: 1px solid #d4e4dd;
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 8px 28px rgba(15, 48, 37, 0.06);
}

.price-card {
  display: flex;
  flex-direction: column;
}

.price-card.featured {
  border: 2px solid var(--accent);
  transform: translateY(-2px);
}

.price {
  font-size: 2rem;
  margin: 0.4rem 0;
  font-weight: 700;
}

.price span {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 500;
}

ul {
  padding-left: 1.2rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.price-card ul {
  flex: 1;
}

.price-card .btn {
  margin-top: auto;
}

li {
  margin-bottom: 0.35rem;
  color: #33473f;
}

.remap-list {
  margin-top: 0.45rem;
  margin-bottom: 0;
  padding-left: 1.25rem;
}

.remap-list li {
  margin-bottom: 0.45rem;
}

.remap-list li:last-child {
  margin-bottom: 0;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 0.72rem 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 16px rgba(13, 138, 106, 0.22);
}

.btn-outline {
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid #b7ccc3;
}

.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.7;
}

.btn[disabled]:hover {
  transform: none;
}

.btn-spinner {
  display: none;
  width: 1em;
  height: 1em;
  margin-right: 0.5rem;
  vertical-align: -0.15em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}

.btn.is-loading .btn-spinner {
  display: inline-block;
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

.fineprint {
  margin-top: 1.2rem;
  padding: 0.85rem 1rem;
  border: 1px solid #cfe3dc;
  border-radius: 12px;
  background: #f8fcfa;
  color: #284039;
  font-size: 0.94rem;
  line-height: 1.55;
}

.fineprint strong {
  display: block;
  margin-bottom: 0.15rem;
  color: #17372d;
  font-size: 0.98rem;
}

.fineprint-contact {
  display: block;
  margin-top: 0.25rem;
}

.fineprint a {
  color: var(--accent);
  font-weight: 600;
  text-underline-offset: 2px;
}

.manage-plan-cta {
  margin-top: 1.2rem;
  text-align: center;
  color: #284039;
  font-size: 0.95rem;
}

.manage-plan-cta a {
  color: var(--accent);
  font-weight: 600;
  text-underline-offset: 2px;
  margin-left: 0.25rem;
}

.dialog-manage-hint {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.9rem;
  color: #4a5d56;
}

.dialog-manage-hint a {
  color: var(--accent);
  font-weight: 600;
  text-underline-offset: 2px;
  margin-left: 0.2rem;
}

.modal {
  border: 1px solid #c3d7cf;
  border-radius: 16px;
  padding: 1rem;
  width: min(460px, 92vw);
}

.modal::backdrop {
  background: rgba(16, 28, 23, 0.35);
}

/* Floating (non-modal) dialogs: opened with dialog.show() so the reCAPTCHA
   challenge overlay can appear above them. A manual backdrop supplies the dim. */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 28, 23, 0.35);
  z-index: 1000;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-floating[open] {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  z-index: 1001;
  max-height: 90vh;
  overflow: auto;
}

.modal label {
  display: block;
  margin-top: 0.8rem;
  margin-bottom: 0.3rem;
  font-weight: 500;
}

.modal input {
  width: 100%;
  border: 1px solid #bfd2ca;
  border-radius: 10px;
  padding: 0.65rem;
  font: inherit;
}

.modal input:focus {
  outline: 2px solid var(--ring);
  border-color: var(--accent);
}

.required {
  color: #d32f2f;
  font-weight: 600;
}

.recaptcha-container {
  margin: 1rem 0;
  display: flex;
  justify-content: center;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1rem;
}

.dialog-message {
  margin: 0.75rem 0 0;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.dialog-message-error {
  background: #fff1f1;
  border: 1px solid #f2c5c5;
  color: #8f1d1d;
}

.success-modal {
  width: min(560px, 92vw);
}

.success-modal .success-alert {
  max-width: none;
  margin: 0;
}

.success-alert {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 1.5rem;
  background: linear-gradient(135deg, #0d8a6a 0%, #106a54 100%);
  border: 2px solid #0d8a6a;
  border-radius: 16px;
  color: white;
  box-shadow: 0 4px 16px rgba(13, 138, 106, 0.2);
}

.success-alert h2 {
  margin: 0 0 1.5rem 0;
  font-size: 1.5rem;
}

.success-alert h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.success-alert p {
  margin: 0 0 1rem 0;
  line-height: 1.6;
  font-size: 0.95rem;
}

.api-key-box {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 1.25rem;
  margin: 1rem 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.95rem;
  word-break: break-all;
}

.api-key-box button {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  background: white;
  color: #0d8a6a;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.api-key-box button:hover {
  background: #f0f0f0;
  transform: scale(1.02);
}

.api-key-activation-note {
  font-size: 0.85rem;
  opacity: 0.85;
  margin: 0.25rem 0 0 0;
}

.success-message {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-top: 1rem;
}

.feedback-alert {
  border-radius: 16px;
  padding: 1.25rem;
}

.feedback-alert h2 {
  margin: 0;
  font-size: 1.2rem;
}

.feedback-alert-error {
  background: linear-gradient(135deg, #fff4f2 0%, #ffe3de 100%);
  border: 2px solid #f0b8ae;
  color: #8f2d22;
}

.site-footer {
  margin-top: 1.2rem;
  border-top: 1px solid #d4e4dd;
  background: linear-gradient(180deg, #f6fbf9 0%, #eef6f2 100%);
}

.legal-hero {
  padding-bottom: 0.3rem;
}

.legal-main {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
}

.legal-card {
  background: #ffffff;
  border: 1px solid #d4e4dd;
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 8px 28px rgba(15, 48, 37, 0.06);
}

.legal-card h1 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: clamp(1.8rem, 3.8vw, 2.4rem);
}

.legal-card h2 {
  margin: 1.1rem 0 0.45rem;
  font-size: clamp(1.1rem, 2.4vw, 1.35rem);
}

.legal-card p {
  margin: 0.4rem 0;
  color: #2f453e;
  line-height: 1.65;
}

.legal-meta {
  margin-top: 0;
  margin-bottom: 0.9rem;
  font-size: 0.95rem;
  color: #4d665d;
}

.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem 1.35rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.footer-copy {
  margin: 0;
  color: #355046;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  align-items: center;
}

.footer-legal {
  color: #1b3a30;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.footer-legal:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-cta {
  text-decoration: none;
  border: 1px solid #c9ddd6;
  border-radius: 12px;
  background: #ffffff;
  padding: 0.42rem 0.7rem 0.5rem;
  display: inline-flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 160px;
  box-shadow: 0 4px 14px rgba(15, 48, 37, 0.06);
}

.footer-cta span {
  color: #17372d;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.2;
}

.footer-cta small {
  color: #4d665d;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  line-height: 1.2;
}

.footer-cta:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

@media (max-width: 760px) {
  .nav {
    padding-top: 1rem;
    padding-bottom: 0.7rem;
  }

  .nav-links {
    gap: 0.7rem;
    justify-content: flex-start;
  }

  .brand-logo {
    width: clamp(140px, 48vw, 190px);
  }

  .hero-content {
    padding-top: 0.4rem;
  }

  .site-footer-inner {
    align-items: flex-start;
  }

  .footer-cta {
    min-width: 0;
    width: 100%;
  }

  .legal-main {
    padding-top: 0;
  }
}

@media (max-width: 640px) {
  .price-card.featured {
    transform: none;
  }
}
