:root {
  color-scheme: light;
  --background: #f5f3eb;
  --surface: #fffdf8;
  --ink: #20271f;
  --muted: #697267;
  --accent: #30553d;
  --accent-hover: #23442f;
  --border: #d8ddd2;
  --focus: #8ca797;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 255, 255, 0.82), transparent 38%),
    var(--background);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

.page {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  place-items: center;
  padding: clamp(20px, 4vw, 48px) 20px 64px;
}

.signup {
  display: flex;
  width: min(100%, 520px);
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.mila {
  display: block;
  width: clamp(132px, 22vh, 220px);
  height: clamp(132px, 22vh, 220px);
  border: 1px solid rgba(48, 85, 61, 0.1);
  border-radius: 50%;
  box-shadow: 0 18px 45px rgba(47, 57, 44, 0.1);
  object-fit: cover;
}

.brand {
  margin-top: clamp(18px, 3vh, 28px);
}

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

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.45rem, 8vw, 4.25rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.email-form {
  width: min(100%, 480px);
  margin-top: clamp(28px, 4vh, 38px);
}

.form-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 10px 30px rgba(50, 61, 48, 0.06);
}

input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  padding: 12px 10px 12px 14px;
  font-size: 0.94rem;
}

input::placeholder {
  color: #92998f;
}

button {
  cursor: pointer;
}

.form-controls button {
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: white;
  padding: 12px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  transition:
    background-color 150ms ease,
    transform 150ms ease;
}

.form-controls button:hover {
  background: var(--accent-hover);
}

.form-controls button:active {
  transform: translateY(1px);
}

.form-controls:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(140, 167, 151, 0.2);
}

.form-message {
  min-height: 20px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.email-form.is-complete .form-controls {
  display: none;
}

.email-form.is-complete .form-message {
  min-height: 0;
  margin: 0;
  padding: 15px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.92);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(50, 61, 48, 0.06);
}

.add-another {
  display: none;
  margin: 10px auto 0;
  border: 0;
  background: none;
  color: var(--muted);
  padding: 3px;
  font-size: 0.76rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.add-another:hover {
  color: var(--ink);
}

.email-form.is-complete .add-another {
  display: block;
}

.form-message.is-error {
  color: #9b3e34;
}

footer {
  position: absolute;
  right: 20px;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #92998f;
  font-size: 0.75rem;
}

.text-link {
  border: 0;
  background: none;
  color: var(--muted);
  padding: 4px 0;
  text-decoration: none;
}

.text-link:hover {
  color: var(--ink);
}

dialog {
  width: min(calc(100% - 32px), 520px);
  max-height: min(620px, calc(100svh - 48px));
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  padding: 0;
  box-shadow: 0 24px 80px rgba(32, 39, 31, 0.18);
}

dialog::backdrop {
  background: rgba(32, 39, 31, 0.28);
  backdrop-filter: blur(4px);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 14px;
}

.dialog-header h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 500;
}

.close-button {
  display: grid;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #ecece5;
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1;
  place-items: center;
}

.dialog-content {
  overflow-y: auto;
  padding: 0 22px 22px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.dialog-content p {
  margin: 0 0 12px;
}

.dialog-content p:last-child {
  margin-bottom: 0;
}

.dialog-content a {
  color: var(--accent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

:focus-visible {
  outline: 3px solid rgba(48, 85, 61, 0.3);
  outline-offset: 3px;
}

@media (max-width: 520px) {
  .page {
    padding-right: 16px;
    padding-left: 16px;
  }

  .form-controls {
    grid-template-columns: 1fr;
  }

  input {
    padding: 12px 12px 9px;
    text-align: center;
  }

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

@media (max-height: 620px) {
  .page {
    padding-bottom: 48px;
  }

  .mila {
    width: 112px;
    height: 112px;
  }

  .brand {
    margin-top: 14px;
  }

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

  .eyebrow {
    display: none;
  }

  h1 {
    font-size: 2.4rem;
  }

  footer {
    bottom: max(8px, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
