/* Sign-in, sign-up, email and password pages: a form on the left, the product on the right. */
@font-face { font-family: "Instrument Serif"; src: url("/assets/fonts/instrument-serif.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("/assets/fonts/instrument-serif-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #fafafa;
  --surface: #fff;
  --surface-2: #f4f4f5;
  --border: #e4e4e7;
  --text: #09090b;
  --muted: #71717a;
  --faint: #a1a1aa;
  --accent: #3b5bfd;
  --accent-soft: #eef1ff;
  --accent-text: #2c45c9;
  --ink: #09090b;
  --on-ink: #fafafa;
  --sky-1: #dfe6ff;
  --sky-2: #b9c8ff;
  --sky-3: #f5f7ff;
  --danger: #dc2626;
  --ok: #15803d;
  --danger-bg: #fdecec;
  --ok-bg: #e8f6ee;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #09090b;
  --surface: #111113;
  --surface-2: #1c1c1f;
  --border: #27272a;
  --text: #fafafa;
  --muted: #a1a1aa;
  --faint: #71717a;
  --accent: #5b76ff;
  --accent-soft: rgba(91, 118, 255, 0.14);
  --accent-text: #a9b8ff;
  --ink: #fafafa;
  --on-ink: #09090b;
  --sky-1: #0c1024;
  --sky-2: #1a2a7a;
  --sky-3: #0a0c18;
  --danger: #f87171;
  --ok: #4ade80;
  --danger-bg: rgba(248, 113, 113, 0.12);
  --ok-bg: rgba(74, 222, 128, 0.12);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }

/* ---- Layout ---- */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
}
.auth-main {
  display: flex;
  flex-direction: column;
  padding: 28px 40px;
}
.auth-top { display: flex; align-items: center; justify-content: space-between; }
.home {
  display: inline-flex; align-items: center; gap: 10px;
  color: inherit; text-decoration: none; font-weight: 650; font-size: 17px; letter-spacing: -0.01em;
}
.home img { border-radius: 22%; }
.auth-body {
  flex: 1;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 0;
}
.auth-foot { font-size: 12.5px; color: var(--faint); text-align: center; }
.auth-foot a { color: inherit; }

/* ---- The product side ---- */
.auth-side {
  position: relative;
  margin: 12px;
  border-radius: 28px;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 34px;
  padding: 56px;
  background:
    radial-gradient(60% 50% at 80% 10%, var(--sky-2), transparent 70%),
    radial-gradient(60% 60% at 10% 90%, var(--sky-1), transparent 70%),
    linear-gradient(160deg, var(--sky-1), var(--sky-3));
}
.side-title {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(36px, 3.6vw, 54px);
  line-height: 1.02;
  letter-spacing: -0.01em;
}
.side-title em { font-style: italic; }
.mock {
  width: min(420px, 100%);
  padding: 14px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 30px 70px -30px rgba(15, 23, 42, 0.45);
  font-size: 13px;
}
.mock-head { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 10px; }
.mock-head img { border-radius: 22%; }
.mock-head span { margin-left: auto; font-size: 11px; font-weight: 500; color: var(--faint); }
.mock-text {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  line-height: 1.55;
  min-height: 62px;
}
.mock-text del { color: var(--faint); text-decoration-color: var(--danger); }
.mock-text ins { text-decoration: none; color: var(--accent-text); font-weight: 500; }
.mock-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin-top: 8px; }
.mock-tiles i {
  font-style: normal; text-align: center; padding: 8px 2px; border-radius: 10px;
  border: 1px solid var(--border); font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden;
}
.mock-tiles i.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.side-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.side-steps li { display: flex; align-items: center; gap: 12px; font-size: 15px; }
.side-steps b {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px;
  background: var(--surface); border: 1px solid var(--border);
}
kbd {
  display: inline-block; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--border);
  border-bottom-width: 2px; background: var(--surface); font: 600 12px "Inter", sans-serif;
}

/* ---- Forms ---- */
h1 {
  font-family: "Instrument Serif", Georgia, serif; font-weight: 400;
  font-size: 46px; line-height: 1.02; letter-spacing: -0.01em; margin: 0 0 10px;
}
h1 em { font-style: italic; }
p.lead { color: var(--muted); margin: 0 0 26px; font-size: 15px; }
label { display: block; font-size: 13px; font-weight: 600; margin: 16px 0 6px; }
input {
  width: 100%; height: 46px; padding: 0 14px; font: inherit; color: inherit;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
button.primary, a.button {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 48px; margin-top: 22px; padding: 0 16px;
  font: inherit; font-weight: 600; color: var(--on-ink); background: var(--ink); border: 0;
  border-radius: 14px; cursor: pointer; text-decoration: none;
  transition: transform 0.15s, opacity 0.15s;
}
button.primary:hover, a.button:hover { transform: translateY(-1px); }
button.primary:disabled { opacity: 0.55; cursor: default; transform: none; }
a.button.secondary, button.secondary {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
}
button.link { background: none; border: 0; color: var(--accent-text); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
button.link:disabled { color: var(--faint); cursor: default; }
.links { margin-top: 22px; font-size: 14px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.links a { color: var(--accent-text); text-decoration: none; font-weight: 600; }
.row-label { display: flex; justify-content: space-between; align-items: baseline; }
.row-label a { font-size: 13px; color: var(--accent-text); text-decoration: none; font-weight: 600; }
.msg { margin-top: 14px; font-size: 14px; padding: 10px 12px; border-radius: 10px; display: none; }
.msg.show { display: block; }
.msg.error { background: var(--danger-bg); color: var(--danger); }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* ---- Status screens (check email, verified, opening the app) ---- */
.badge {
  width: 56px; height: 56px; border-radius: 18px; margin-bottom: 22px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.badge svg { width: 26px; height: 26px; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.steps { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; counter-reset: step; }
.steps li {
  counter-increment: step; position: relative; padding: 14px 16px 14px 52px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface); font-size: 14px;
}
.steps li::before {
  content: counter(step); position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 700;
}
.steps li b { font-weight: 600; }
.note { margin-top: 18px; font-size: 13px; color: var(--muted); }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--accent) 25%, transparent); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-main { padding: 22px 20px; }
  .auth-body { padding: 28px 0; }
  h1 { font-size: 40px; }
}

/* 6-digit email code: one box per digit */
.otp {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.otp input {
  width: 100%;
  min-width: 0;
  height: 58px;
  padding: 0;
  text-align: center;
  font: 600 24px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  border-radius: 14px;
  caret-color: var(--accent);
}
.otp input:not(:placeholder-shown),
.otp input:valid:not([value=""]) {
  border-color: var(--border-strong, var(--border));
}
.otp-dash {
  flex: none;
  width: 10px;
  height: 2px;
  border-radius: 2px;
  background: var(--border-strong, var(--border));
}
.otp.bad {
  animation: otp-shake 0.4s;
}
.otp.bad input {
  border-color: var(--danger, #dc2626);
}
@keyframes otp-shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
@media (max-width: 420px) {
  .otp { gap: 6px; }
  .otp input { height: 50px; font-size: 20px; border-radius: 12px; }
}

/* Opt-in checkbox on sign-up */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 18px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--muted);
  cursor: pointer;
}
.check-row input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--accent);
  box-shadow: none;
}

/* Show / hide password */
.pw-field { position: relative; }
.pw-field input { padding-right: 48px; }
.pw-eye {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.pw-eye:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.pw-eye svg { width: 19px; height: 19px; }
