/* Log in and create account pages. Mobile first; desktop from 768px. The landing page uses landing.css. */

:root {
  --bg: #f4efe2;
  --card: #fdfbf6;
  --green-900: #1e3a2b;
  --sage: #3f6b45;
  --sage-tint: #e7efdf;
  --muted: #5c6b5e;
  --amber: #cf8f1e;
  --amber-ink: #3a2705;
  --amber-tint: #f7e8cb;
  --error: #b3441f;
  --error-bg: #f8e9e1;
  --field-border: #8c8676;
  --secondary-border: #cdc5b0;
  --divider: #e8e1cf;
  --shadow: 0 1px 2px rgba(30, 58, 43, 0.05), 0 10px 30px rgba(30, 58, 43, 0.07);
  --shadow-soft: 0 1px 2px rgba(30, 58, 43, 0.05), 0 6px 18px rgba(30, 58, 43, 0.05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--green-900);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

a, button, input { font-family: inherit; }

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

.hidden { display: none !important; }

h1, h2, h3, p { margin: 0; }

h1, h2 { font-weight: 800; }

/* ---------- Buttons ---------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 28px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}

.btn-primary {
  background: var(--amber);
  color: var(--amber-ink);
  box-shadow: 0 2px 6px rgba(120, 80, 10, 0.18);
}

.btn:disabled { cursor: not-allowed; }

.btn-primary:disabled { opacity: 0.6; }

/* ---------- Top bar ---------- */

.wordmark-text { font-family: Georgia, 'Times New Roman', serif; font-size: 22px; font-weight: 700; }

/* ---------- Log in / Create account ---------- */

.auth-page { padding: 12px 16px 40px; display: flex; flex-direction: column; align-items: center; }

.auth-wrap { width: 100%; display: flex; flex-direction: column; gap: 20px; }

.back-link {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--sage);
  font-weight: 600;
  text-decoration: none;
}

.auth-brand {
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  color: var(--green-900);
  text-decoration: none;
}

.auth-brand .wordmark-text { color: var(--green-900); }

.auth-card {
  background: var(--card);
  border-radius: 20px;
  padding: 24px 20px;
  box-shadow: 0 1px 2px rgba(30, 58, 43, 0.05), 0 12px 32px rgba(30, 58, 43, 0.08);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.auth-head { display: flex; flex-direction: column; gap: 6px; }

.auth-head h1 { font-size: 30px; line-height: 1.15; letter-spacing: -0.01em; }

.auth-head p { color: var(--muted); }

.stack { display: flex; flex-direction: column; gap: 12px; }

.stack-22 { display: flex; flex-direction: column; gap: 22px; }

.form { display: flex; flex-direction: column; gap: 18px; margin: 0; }

.field { display: flex; flex-direction: column; gap: 8px; }

.field label { font-weight: 700; font-size: 16px; }

.field input {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  font-size: 17px;
  color: var(--green-900);
  background: #fff;
  border: 1.5px solid var(--field-border);
  border-radius: 12px;
}

.field input[aria-invalid="true"] { border-color: var(--error); }

.pw-wrap { position: relative; display: flex; }

.pw-wrap input { padding-right: 76px; }

.pw-toggle {
  position: absolute;
  right: 4px;
  top: 4px;
  height: 44px;
  min-width: 64px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: var(--sage-tint);
  color: var(--green-900);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.hint { font-size: 15px; color: var(--muted); }

[data-screen="signup"] .hint,
[data-screen="signup"] .pw-toggle { font-size: 16px; }

.plan-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  background: var(--sage-tint);
  border-radius: 14px;
  color: var(--green-900);
  font-size: 16px;
  line-height: 1.45;
}

.plan-box p { margin: 0; }

.plan-box-title { font-weight: 700; font-size: 18px; }

.field-error { display: flex; gap: 8px; align-items: flex-start; color: var(--error); font-size: 16px; line-height: 1.4; }

.field-error svg { flex-shrink: 0; margin-top: 2px; }

.field-error a { color: var(--error); font-weight: 700; }

.form-error {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--error-bg);
  color: #8f3618;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.45;
}

.form-error svg { flex-shrink: 0; margin-top: 2px; }

.link-btn {
  align-self: center;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  background: none;
  color: var(--sage);
  font-size: 16px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.forgot-note { background: var(--sage-tint); border-radius: 14px; padding: 14px 16px; font-size: 16px; color: #2c4a35; }

.forgot-note a { color: #2c4a35; font-weight: 700; }

.divider { height: 1px; background: var(--divider); }

.auth-switch {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  column-gap: 6px;
  text-align: center;
  font-size: 16px;
  color: var(--muted);
}

.auth-switch a { display: inline-flex; align-items: center; min-height: 44px; color: var(--sage); font-weight: 700; }

/* ---------- Desktop ---------- */

@media (min-width: 768px) {
  .auth-page { padding: 32px 24px 64px; }

  .auth-wrap { max-width: 460px; }

  .auth-wrap.wide { max-width: 480px; }

  .auth-card { padding: 36px 36px 32px; }
}

/* Sign-up: the agreement to the Terms and the Privacy Notice */
.consent { display: flex; flex-direction: column; gap: 8px; }

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-height: 44px;
  padding: 6px 0;
  font-size: 16px;
  line-height: 1.45;
  cursor: pointer;
}

.consent-row input {
  flex: none;
  width: 26px;
  height: 26px;
  margin: 0;
  accent-color: var(--sage);
  cursor: pointer;
}

.consent-row input[aria-invalid="true"] { outline: 2px solid var(--error); outline-offset: 2px; }

.consent-text a { color: var(--sage); text-decoration: underline; text-underline-offset: 3px; }

/* A small footer with the two legal links (sign-up, log-in and the error pages) */
.legal-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 22px;
  margin-top: 22px;
  padding-bottom: 28px;
}

.legal-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
