:root {
  --tt-paper: #f7f3ec;
  --tt-surface: #fffdf9;
  --tt-ink: #2a241c;
  --tt-muted: #6e6458;
  --tt-line: #d9cfc0;
  --tt-green: #3f6b5a;
  --tt-danger: #9b3d2e;
  --tt-serif: "Iowan Old Style", Palatino, Georgia, serif;
  --tt-sans: "Avenir Next", "Segoe UI", system-ui, sans-serif;
}

body.tt-modal-open { overflow: hidden; }

.tt-modal[hidden] { display: none !important; }
.tt-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  align-items: end;
  justify-items: center;
}
.tt-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(42, 36, 28, 0.45);
  cursor: pointer;
}
.tt-modal__panel {
  position: relative;
  width: min(440px, 100%);
  max-height: min(92vh, 760px);
  overflow: auto;
  background: var(--tt-surface);
  color: var(--tt-ink);
  border-radius: 22px 22px 0 0;
  padding: 28px 22px 32px;
  box-shadow: 0 24px 60px rgba(42, 36, 28, 0.18);
  font-family: var(--tt-sans);
}
.tt-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--tt-muted);
  font-size: 24px;
  cursor: pointer;
}
.tt-modal h2,
.tt-card h1,
.tt-account__brand {
  font-family: var(--tt-serif);
  font-weight: 500;
  letter-spacing: -0.02em;
}
.tt-modal h2 { margin: 0 0 16px; font-size: 1.7rem; line-height: 1.2; }
.tt-modal p,
.tt-card p { color: var(--tt-muted); line-height: 1.5; }
.tt-fields { display: grid; gap: 10px; margin: 14px 0; }
.tt-fields input::placeholder { color: var(--tt-muted); opacity: 1; }
.tt-fields label,
.tt-card label {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
  color: var(--tt-ink);
}
.tt-fields input,
.tt-card input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--tt-line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  /* Stay at or above 16px so iOS Safari doesn't zoom the page when the
     modal auto-focuses the first field. */
  font-size: max(1rem, 16px);
  color: var(--tt-ink);
}
.tt-btn,
.tt-card .tt-btn {
  display: inline-flex;
  justify-content: center;
  width: 100%;
  border: 0;
  border-radius: 999px;
  background: var(--tt-green);
  color: #fffdf9;
  font: inherit;
  font-weight: 600;
  padding: 13px 18px;
  cursor: pointer;
}
.tt-btn[disabled] { opacity: 0.6; cursor: progress; }
a.tt-btn { text-decoration: none; box-sizing: border-box; }
.tt-linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--tt-green);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.tt-switch { text-align: center; margin: 14px 0 0; }
.tt-error { color: var(--tt-danger); min-height: 1.2em; }

body.tt-account {
  margin: 0;
  min-height: 100vh;
  background: var(--tt-paper);
  color: var(--tt-ink);
  font-family: var(--tt-sans);
}
.tt-account__main {
  min-height: 100vh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  padding: 32px 16px;
}
.tt-account__brand {
  color: var(--tt-green);
  font-size: 1.8rem;
  text-decoration: none;
}
.tt-account__brand img { display: block; max-width: 180px; height: auto; }
.tt-card {
  width: min(440px, 100%);
  background: var(--tt-surface);
  border: 1px solid var(--tt-line);
  border-radius: 22px;
  padding: 28px 22px 32px;
  box-shadow: 0 10px 30px rgba(42, 36, 28, 0.06);
}
.tt-card h1 { margin: 0 0 16px; font-size: 2rem; line-height: 1.15; }
.tt-card form { display: grid; gap: 12px; }
/* Supporting line under the title, closer to the heading than to the form. */
.tt-lead { margin: -8px 0 16px; }
.tt-note {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #e5efe9;
  color: var(--tt-ink);
}
.tt-note--error { background: #f8ebe7; color: var(--tt-danger); }
.tt-form-error:not([hidden]) { color: var(--tt-danger); }

@media (min-width: 640px) {
  .tt-modal { align-items: center; }
  .tt-modal__panel { border-radius: 22px; padding: 32px 28px 36px; }
}
