/* HAVENEST · formal sign-in pages (login, forgot, set password). Brown / cream. */
:root {
  color-scheme: light;
  --brown: #6f4320; --brown-2: #8a5a2f; --accent: #b5763a;
  --cream: #f7f1e8; --cream-2: #efe5d6; --line: #e4d6c3;
  --ink: #2b2118; --muted: #7a6a5a; --danger: #b42318; --ok: #2f6b3a;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center;
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  padding: max(20px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  background:
    radial-gradient(900px 480px at -10% -10%, #f3e3cc 0%, transparent 60%),
    radial-gradient(700px 420px at 110% 0%, #efe0cb 0%, transparent 55%),
    linear-gradient(180deg, #faf6f0 0%, var(--cream) 100%);
}
html[dir="rtl"] body { font-family: "Assistant", "IBM Plex Sans", -apple-system, sans-serif; }
.auth-card {
  width: min(430px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 22px;
  padding: 30px 26px 22px; box-shadow: 0 1px 2px rgba(60,40,20,.05), 0 24px 48px rgba(60,40,20,.10);
}
.auth-brand { text-align: center; margin-bottom: 14px; }
.auth-brand img { width: min(170px, 58vw); height: auto; display: block; margin: 0 auto 4px; }
.auth-eyebrow { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); font-weight: 650; }
.auth-rule { height: 1px; background: var(--line); margin: 16px 0 18px; border: 0; }
h1 { font-size: 22px; letter-spacing: -.01em; margin: 0 0 6px; text-align: center; font-weight: 650; }
.auth-sub { margin: 0 0 18px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.5; }
label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 7px; color: var(--ink); }
.field { margin-bottom: 15px; }
.input-wrap { position: relative; }
input[type=text], input[type=password], input[type=email] {
  width: 100%; font: inherit; font-size: 16px; padding: 13px 14px; border-radius: 12px;
  border: 1px solid #d9c9b3; background: #fffdfa; min-height: 50px; color: var(--ink);
}
input:focus { outline: 3px solid rgba(181,118,58,.25); border-color: var(--accent); }
.input-wrap input { padding-inline-end: 84px; }
.toggle-pw {
  position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: var(--cream-2); color: var(--brown); border-radius: 9px;
  padding: 8px 10px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; min-height: 36px;
}
.btn-primary {
  width: 100%; border: 0; border-radius: 12px; padding: 14px 16px; min-height: 50px; margin-top: 4px;
  background: var(--brown); color: #fff; font: inherit; font-size: 15.5px; font-weight: 650; cursor: pointer;
  letter-spacing: .01em;
}
.btn-primary:hover { background: var(--brown-2); }
.btn-primary[disabled] { opacity: .55; cursor: default; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; text-align: center; margin-top: 16px; font-size: 14px; }
.auth-links a { color: var(--brown); font-weight: 600; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }
.alert { border-radius: 12px; padding: 11px 13px; font-size: 13.5px; line-height: 1.45; margin: 0 0 14px; }
.alert:empty { display: none; }
.alert.err { background: #fdf0ee; color: var(--danger); border: 1px solid #f4cfc9; }
.alert.ok { background: #eef6ef; color: var(--ok); border: 1px solid #cfe5d3; }
.alert.info { background: var(--cream); color: var(--muted); border: 1px solid var(--line); }
.lang-switch { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 0 0 4px; }
.lang-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px;
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--muted);
}
.lang-btn.on { background: var(--brown); color: #fff; border-color: var(--brown); }
.auth-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); text-align: center;
  color: var(--muted); font-size: 12px; line-height: 1.5; }
.auth-foot a { color: var(--accent); text-decoration: none; }
.auth-foot .lock { display: inline-block; vertical-align: -2px; margin-inline-end: 4px; }
.rules { list-style: none; padding: 0; margin: 2px 0 14px; display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
.rules li::before { content: "○"; display: inline-block; width: 18px; color: #c2ad92; }
.rules li.met { color: var(--ok); }
.rules li.met::before { content: "✓"; color: var(--ok); font-weight: 700; }
.meter { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); margin: -6px 0 12px; }
.meter-bar { flex: 1; height: 6px; border-radius: 99px; background: var(--cream-2); overflow: hidden; }
.meter-bar span { display: block; height: 100%; width: 0; background: #c0392b; transition: width .2s, background .2s; }
.meter-bar span.s2 { background: #c98a2b; }
.meter-bar span.s3 { background: var(--ok); }
.who { text-align: center; font-size: 13.5px; color: var(--brown); background: var(--cream); border-radius: 10px;
  padding: 8px 10px; margin: -4px 0 16px; }
.auth-links .sep { display: none; }
.auth-h2 { font-size: 16px; margin: 6px 0 12px; color: var(--ink, #2b2118); }
.auth-note { font-size: 12.5px; color: var(--muted, #8a7a6a); text-align: center; margin: 10px 0 0; line-height: 1.45; }

/* 3-step activation / reset */
.auth-steps { display: flex; justify-content: center; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; }
.auth-steps li {
  flex: 1; text-align: center; font-size: 11px; font-weight: 650; color: var(--muted);
  letter-spacing: .02em; position: relative; padding: 0 2px;
}
.auth-steps li span {
  display: block; width: 26px; height: 26px; border-radius: 50%; margin: 0 auto 6px;
  line-height: 26px; background: var(--cream-2); color: var(--muted); border: 1px solid var(--line);
}
.auth-steps li.on { color: var(--brown); }
.auth-steps li.on span { background: var(--brown); color: #fff; border-color: var(--brown); }
.auth-steps li.done span { background: #c9a36a; color: #fff; border-color: #c9a36a; }
.otp-row { display: flex; justify-content: center; gap: 8px; margin: 8px 0 16px; direction: ltr; }
.otp-row input {
  width: 44px; height: 54px; min-height: 54px; text-align: center; font-size: 22px; font-weight: 700;
  padding: 0; border-radius: 12px; border: 1px solid #d9c9b3; background: #fffdfa; color: var(--ink);
  caret-color: var(--brown);
}
.otp-row input:focus { outline: 3px solid rgba(181,118,58,.25); border-color: var(--accent); }
.otp-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-size: 13px; color: var(--muted); margin: -6px 0 14px; flex-wrap: wrap; }
.otp-meta button, .linkish {
  border: 0; background: none; color: var(--brown); font: inherit; font-size: 13.5px; font-weight: 650;
  cursor: pointer; padding: 0; text-decoration: none;
}
.otp-meta button[disabled], .linkish[disabled] { color: #b5a598; cursor: default; text-decoration: none; }
.linkish { display: inline-block; margin-top: 8px; }
.btn-primary.lg { min-height: 54px; font-size: 16.5px; }
input[type=tel] {
  width: 100%; font: inherit; font-size: 16px; padding: 13px 14px; border-radius: 12px;
  border: 1px solid #d9c9b3; background: #fffdfa; min-height: 50px; color: var(--ink);
}
input[type=tel]:focus { outline: 3px solid rgba(181,118,58,.25); border-color: var(--accent); }

.spam-note { background: #fff7e0; border: 1px solid #f0d98a; color: #5c4400; border-radius: 12px; padding: 10px 12px; font-weight: 600; }
.spam-note[hidden] { display: none; }

/* ── Unified sign-in (/login): one question per step, quiet secondary links ───────── */
.lg-step[hidden], .lg-who[hidden], .lg-help[hidden], .lg-recent[hidden] { display: none !important; }
.auth-brand { margin-bottom: 8px; }
.auth-brand img { width: min(150px, 50vw); }
.lang-switch { margin: 0 0 14px; }
.auth-card h1 { margin-top: 4px; }
.auth-card .auth-sub:empty { display: none; }
.lg-note { margin: 12px 0 0; text-align: center; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.lg-note a { color: var(--brown); font-weight: 650; text-decoration: none; }
.lg-note a:hover { text-decoration: underline; }
.btn-primary.lg { margin-top: 2px; }
.lg-links { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 14px; }
.lg-links > a, .lg-linkbtn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 10px; border-radius: 10px;
  border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--brown);
  text-decoration: none; cursor: pointer;
}
.lg-links > a:hover, .lg-linkbtn:hover { background: var(--cream); }
.lg-links > a:focus-visible, .lg-linkbtn:focus-visible, .lg-opt:focus-visible { outline: 3px solid rgba(181,118,58,.35); }
.lg-links svg, .lg-linkbtn svg { width: 18px; height: 18px; flex: none; color: var(--accent); }
.lg-linkbtn[disabled] { color: #b5a598; cursor: default; background: none; }
.lg-linkbtn[disabled] svg { color: #c9bba9; }
.lg-center { display: flex; margin: 8px auto 0; }
.lg-who {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 16px;
  padding: 6px 6px 6px 14px; padding-inline: 14px 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--cream);
}
.lg-who-id { font-weight: 650; color: var(--brown); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.lg-opts { display: grid; gap: 12px; }
.lg-opt {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: start; padding: 14px 16px; min-height: 76px;
  border: 1.5px solid var(--line); border-radius: 18px; background: #fffdfa; color: var(--ink); font: inherit; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .05s;
}
.lg-opt:hover { border-color: var(--accent); box-shadow: 0 6px 18px rgba(111,67,32,.10); }
.lg-opt:active { transform: scale(.995); }
.lg-opt-ico {
  flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: var(--cream-2); color: var(--brown);
}
.lg-opt-ico svg { width: 26px; height: 26px; }
.lg-opt-tx { display: grid; gap: 2px; min-width: 0; }
.lg-opt-tx b { font-size: 16.5px; font-weight: 650; }
.lg-opt-tx small { font-size: 13px; color: var(--muted); line-height: 1.35; }
.lg-opt.primary { background: var(--brown); border-color: var(--brown); color: #fff; }
.lg-opt.primary:hover { background: var(--brown-2); border-color: var(--brown-2); }
.lg-opt.primary .lg-opt-ico { background: rgba(255,255,255,.18); color: #fff; }
.lg-opt.primary .lg-opt-tx small { color: rgba(255,255,255,.82); }
.lg-code { text-align: center; letter-spacing: .5em; font-size: 24px !important; font-weight: 700; }
.lg-help { margin: -4px 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--cream); text-align: center; font-size: 13.5px; color: var(--muted); }
.lg-help .lg-links { margin-top: 4px; }
.lg-recent { margin: 0 0 12px; }
.lg-recent .auth-sub { margin: 0 0 6px; }
.lg-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
#codeBox input[type=text], #codePw input[type=password] { width: 100%; }
#codeStep1 input { margin-bottom: 8px; }
.auth-foot { margin-top: 16px; padding-top: 12px; }
@media (min-width: 768px) {
  .auth-card { width: min(460px, 100%); padding: 34px 32px 24px; }
  h1 { font-size: 24px; }
}
@media (max-width: 380px) {
  .auth-card { padding: 22px 16px 16px; border-radius: 18px; }
  .lg-opt { padding: 12px; gap: 12px; }
  .lg-opt-ico { width: 42px; height: 42px; }
}
@media (prefers-reduced-motion: reduce) { .lg-opt { transition: none; } }

/* Forgot / first-time page: which of the two entry points am I on? */
.lg-tabs { display: flex; gap: 4px; padding: 4px; margin: 0 0 18px; background: var(--cream-2); border-radius: 14px; }
.lg-tabs[hidden] { display: none; }
.lg-tabs a { flex: 1; text-align: center; padding: 10px 8px; border-radius: 11px; font-size: 13.5px; font-weight: 650; color: var(--muted); text-decoration: none; line-height: 1.25; }
.lg-tabs a.on { background: #fff; color: var(--brown); box-shadow: 0 1px 3px rgba(60,40,20,.12); }
.lg-tabs a:focus-visible { outline: 3px solid rgba(181,118,58,.35); }
#f .auth-links[hidden], #f .auth-links a[hidden] { display: none; }
.auth-links { flex-direction: column; align-items: center; gap: 2px; }
.auth-links a { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 10px; border-radius: 10px; }
.auth-links a:hover { background: var(--cream); text-decoration: none; }
