:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #17191f;
  --muted: #5f6673;
  --line: #d9dde5;
  --accent: #12715b;
  --accent-dark: #0d5948;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background:
    linear-gradient(180deg, rgba(18, 113, 91, 0.08), rgba(18, 113, 91, 0) 38%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.page-shell {
  display: flex;
  flex-direction: column;
  height: 100svh;
  min-height: 0;
  padding: clamp(14px, 3.5vh, 32px);
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2.2vh, 20px);
  position: relative;
}

.login-button {
  position: absolute;
  top: clamp(14px, 3.5vh, 28px);
  right: clamp(14px, 3.5vw, 32px);
  z-index: 2;
  min-height: 42px;
  padding: 0 18px;
  background: #fff;
  color: var(--accent);
  border: 1px solid rgba(18, 113, 91, 0.22);
  box-shadow: 0 12px 30px rgba(23, 25, 31, 0.08);
}

.login-button:hover {
  background: rgba(18, 113, 91, 0.08);
}

.waitlist-panel {
  width: min(100%, 760px);
  max-height: calc(100svh - 28px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: clamp(24px, 5vw, 54px);
  box-shadow: 0 24px 70px rgba(23, 25, 31, 0.08);
  overflow: hidden;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 680px;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1;
  letter-spacing: 0;
}

.subtitle {
  max-width: 38rem;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

.waitlist-form {
  margin-top: 26px;
}

.input-label {
  display: block;
  margin-bottom: 9px;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
}

.waitlist-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input,
button {
  font: inherit;
}

input[type="email"] {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 15px;
  color: var(--text);
  background: #fff;
  outline: none;
}

input[type="email"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(18, 113, 91, 0.14);
}

button {
  min-height: 48px;
  border: none;
  border-radius: 8px;
  padding: 0 20px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s, transform 0.18s;
}

button:hover {
  background: var(--accent-dark);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.form-status {
  min-height: 22px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.35;
}

.waitlist-note {
  margin: 20px 0 0;
  color: rgba(95, 102, 115, 0.72);
  font-size: 0.94rem;
  font-style: italic;
  line-height: 1.45;
}

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

.site-footer {
  position: absolute;
  left: 50%;
  bottom: clamp(8px, 1.7vh, 18px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: min(100% - 24px, 520px);
  color: rgba(95, 102, 115, 0.42);
  font-size: 0.82rem;
  line-height: 1.3;
  white-space: nowrap;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: rgba(95, 102, 115, 0.72);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(23, 25, 31, 0.58);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  width: min(100%, 440px);
  max-height: calc(100svh - 32px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: clamp(24px, 5vh, 34px);
  text-align: center;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.modal-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.modal h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.modal p:not(.modal-kicker) {
  margin: 14px 0 24px;
  color: var(--muted);
  line-height: 1.55;
}

.login-form {
  display: grid;
  gap: 10px;
  margin-top: 28px;
  text-align: left;
}

.login-form button {
  width: 100%;
}

.login-form .form-status {
  margin: 0;
  text-align: center;
}

#login-modal .modal {
  position: relative;
  width: min(100%, 420px);
  min-height: 380px;
  padding: 34px 33px 40px;
  border-color: #d1d5db;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(23, 25, 31, 0.22);
}

#login-modal .modal-kicker {
  margin-bottom: 8px;
  color: #00745f;
  font-size: 0.78rem;
  line-height: 1.2;
}

#login-modal h2 {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
}

#login-modal .modal p:not(.modal-kicker) {
  margin: 18px 0 0;
  color: #4f5a6f;
  font-size: 1rem;
  line-height: 1.45;
}

#login-modal .input-label {
  margin-bottom: 0;
  color: #1b1f27;
  font-size: 0.88rem;
}

#login-modal input[type="email"] {
  min-height: 50px;
  border-color: #047967;
  font-size: 1rem;
}

#login-modal input[type="email"]:focus {
  border-color: #047967;
  box-shadow: 0 0 0 4px rgba(4, 121, 103, 0.16);
}

#login-modal button[type="submit"] {
  min-height: 48px;
  margin-top: 0;
  background: #147f68;
  font-size: 1rem;
}

#login-modal button[type="submit"]:hover {
  background: #0f6957;
}

.modal-close-button {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  background: transparent;
  color: #6b7280;
  font-size: 1.7rem;
  font-weight: 400;
  line-height: 1;
  box-shadow: none;
}

.modal-close-button:hover {
  background: transparent;
  color: #1f2937;
}

.loading-dots::after {
  display: inline-block;
  width: 1.25em;
  text-align: left;
  content: "";
  animation: dancing-dots 1s steps(4, end) infinite;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: clamp(72px, 12vh, 112px);
  z-index: 1100;
  max-width: calc(100vw - 32px);
  border: 1px solid rgba(18, 113, 91, 0.22);
  border-radius: 8px;
  padding: 13px 18px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 18px 48px rgba(23, 25, 31, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity 0.2s, transform 0.2s;
}

.toast.active {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes dancing-dots {
  0% {
    content: "";
  }

  25% {
    content: ".";
  }

  50% {
    content: "..";
  }

  75%,
  100% {
    content: "...";
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 12px;
    gap: 10px;
  }

  .waitlist-panel {
    max-height: calc(100svh - 24px);
    padding: 22px;
  }

  .eyebrow {
    margin-bottom: 10px;
    font-size: 0.76rem;
  }

  h1 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .subtitle {
    margin-top: 14px;
    font-size: 0.98rem;
    line-height: 1.45;
  }

  .waitlist-form {
    margin-top: 20px;
  }

  .waitlist-note {
    margin-top: 16px;
    font-size: 0.9rem;
  }

  .waitlist-input-row {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }

  .login-button {
    position: static;
    width: min(100%, 760px);
    flex: 0 0 auto;
  }
}

@media (max-height: 560px) {
  .waitlist-panel {
    padding: 18px;
  }

  .eyebrow {
    margin-bottom: 8px;
  }

  h1 {
    font-size: clamp(1.8rem, 8vh, 3rem);
  }

  .subtitle {
    margin-top: 10px;
    font-size: 0.95rem;
    line-height: 1.35;
  }

  .waitlist-form {
    margin-top: 16px;
  }

  input[type="email"],
  button {
    min-height: 42px;
  }

  .form-status {
    min-height: 18px;
    margin-top: 8px;
  }

  .waitlist-note {
    margin-top: 12px;
    font-size: 0.86rem;
    line-height: 1.35;
  }

  .site-footer {
    bottom: 7px;
    font-size: 0.75rem;
  }
}
