/* Diverged AI Solutions: newsletter signup. Brand tokens from brand/diverged-brand-guidelines.html */
:root {
  --teal-950: #061c1b;
  --teal-900: #0a2b2a;
  --teal-800: #0e3736;
  --teal-700: #17504d;
  --mint: #2ef2b0;
  --mint-dim: #1fbf8a;
  --paper: #f5f8f7;
  --text-2: #a9c4bf;       /* secondary text, tinted from the teal */
  --text-3: #86a8a2;       /* placeholder / hints, still above 4.5:1 on teal-800 */
  --danger: #ffa08f;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: "Montserrat", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--teal-700) var(--teal-950); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--teal-950); }
::-webkit-scrollbar-thumb { background: var(--teal-700); border-radius: 10px; }

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(70rem 40rem at 85% -10%, rgba(46, 242, 176, 0.09), transparent 60%),
    var(--teal-900);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  caret-color: var(--mint);
}

::selection { background: var(--mint); color: var(--teal-900); }

a { color: var(--mint); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--paper); }

:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--mint); color: var(--teal-900); padding: 0.6rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

/* Layout: logo, one heading, the form. Nothing else. */
.stage {
  width: min(100% - 2rem, 28rem);
  margin-inline: auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: clamp(1.75rem, 6vh, 3rem);
  padding-block: 2rem;
}
.brand { width: min(100%, 26rem); height: auto; display: block; margin-inline: auto; }

/* Form */
.panel {
  background: var(--teal-800);
  border: 1px solid rgba(245, 248, 247, 0.08);
  border-radius: 1.25rem;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  box-shadow: 0 1.5rem 3rem -1rem rgba(0, 0, 0, 0.45), 0 0.25rem 0.75rem rgba(0, 0, 0, 0.2);
}
.panel h2 { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 1.5rem; text-align: center; text-wrap: balance; }

.row { display: grid; gap: 1rem; }
@media (min-width: 30rem) { .row.two { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 0.4rem; margin-bottom: 1rem; }
.row .field { margin-bottom: 0; }
.row { margin-bottom: 1rem; }

label { font-size: 0.9rem; font-weight: 600; color: var(--paper); }

input[type="text"], input[type="email"] {
  width: 100%;
  font: inherit;
  color: var(--paper);
  background: var(--teal-950);
  border: 1px solid rgba(245, 248, 247, 0.16);
  border-radius: 0.65rem;
  padding: 0.85rem 0.95rem;
  min-height: 3rem;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
select {
  width: 100%;
  font: inherit;
  color: var(--paper);
  background-color: var(--teal-950);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none' stroke='%232ef2b0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  border: 1px solid rgba(245, 248, 247, 0.16);
  border-radius: 0.65rem;
  padding: 0.85rem 2.6rem 0.85rem 0.95rem;
  min-height: 3rem;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
select:invalid { color: var(--text-3); }
select option { color: var(--paper); background: var(--teal-900); }
select:hover { border-color: rgba(245, 248, 247, 0.3); }
select:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 3px rgba(46, 242, 176, 0.22); }
select[aria-invalid="true"] { border-color: var(--danger); }
input::placeholder { color: var(--text-3); }
input:hover { border-color: rgba(245, 248, 247, 0.3); }
input:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 3px rgba(46, 242, 176, 0.22); }
input[aria-invalid="true"] { border-color: var(--danger); }
input:-webkit-autofill { -webkit-text-fill-color: var(--paper); box-shadow: 0 0 0 100rem var(--teal-950) inset; caret-color: var(--mint); }

.check { display: grid; grid-template-columns: 1.4rem 1fr; gap: 0.75rem; align-items: start; margin: 0.25rem 0 1.25rem; }
.check input { appearance: none; width: 1.4rem; height: 1.4rem; margin: 0.1rem 0 0; border: 1.5px solid rgba(245, 248, 247, 0.4); border-radius: 0.4rem; background: var(--teal-950); display: grid; place-content: center; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.check input::after { content: ""; width: 0.7rem; height: 0.4rem; border-left: 2.5px solid var(--teal-900); border-bottom: 2.5px solid var(--teal-900); transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform 0.15s var(--ease-out); }
.check input:checked { background: var(--mint); border-color: var(--mint); }
.check input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.check input[aria-invalid="true"] { border-color: var(--danger); }
.check label { font-weight: 400; font-size: 0.95rem; color: var(--text-2); cursor: pointer; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn {
  width: 100%;
  font: inherit;
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--teal-900);
  background: var(--mint);
  border: 0;
  border-radius: 0.75rem;
  min-height: 3.25rem;
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s var(--ease-out), background 0.2s, box-shadow 0.2s var(--ease-out);
  box-shadow: 0 0.5rem 1.25rem -0.5rem rgba(46, 242, 176, 0.55);
}
.btn:hover { background: #5af6c3; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.7; cursor: progress; transform: none; }
.btn .spin { display: none; width: 1.1rem; height: 1.1rem; border: 2.5px solid rgba(10, 43, 42, 0.3); border-top-color: var(--teal-900); border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: -0.2em; margin-right: 0.6rem; }
.btn[disabled] .spin { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.err { color: var(--danger); font-size: 0.875rem; margin: 0; min-height: 0; }
.check .err { grid-column: 1 / -1; }
.err:empty { display: none; }
.form-error { margin: 0 0 1rem; padding: 0.75rem 0.95rem; border-radius: 0.65rem; background: rgba(255, 160, 143, 0.1); color: var(--danger); font-size: 0.95rem; }
.form-error:empty { display: none; }


/* Success */
.done { display: none; text-align: center; }
.panel.is-done form { display: none; }
.panel.is-done .intro { display: none; }
.panel.is-done .done { display: block; animation: rise 0.6s var(--ease-out) both; }
.done .tick { width: 3rem; height: 3rem; border-radius: 50%; background: var(--mint); display: grid; place-content: center; margin: 0 auto 1.25rem; }
.done .tick svg { width: 1.5rem; height: 1.5rem; stroke: var(--teal-900); fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.done h2 { font-size: 1.625rem; margin-bottom: 0.5rem; }
.done p { color: var(--text-2); margin: 0; }

/* The one authored moment: logo, then form rise in */
@keyframes rise { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.brand { animation: rise 0.8s var(--ease-out) both; }
.panel { animation: rise 0.8s var(--ease-out) 0.14s both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
