/* Sign-in and sign-up pages: one centred card on the page ground, in every theme. */

.auth-page { background: var(--grad-page); min-height: 100vh; }
.auth {
  min-height: 100vh;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 22px;
  padding: max(32px, env(safe-area-inset-top, 0px)) 16px 40px;
}
.auth-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 24px; letter-spacing: -0.06em; color: var(--ink); text-decoration: none; }
.auth-card {
  width: min(440px, 100%);
  display: grid;
  gap: 18px;
  padding: 34px 32px 28px;
  border-radius: var(--radius-lg, 24px);
  background: var(--card);
  box-shadow: var(--shadow-card);
}
.auth.wide .auth-card { width: min(620px, 100%); }
@media (max-width: 480px) { .auth-card { padding: 26px 20px 22px; } }
.auth-card h1 { margin: 0; font-size: clamp(28px, 6vw, 36px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.auth-card h1 .soft { font-weight: 300; font-style: italic; color: var(--ink-3); }
.auth-lead { margin: -8px 0 0; color: var(--ink-3); font-size: 15px; }
.auth-alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; color: var(--ink); background: var(--paper-hi); box-shadow: inset 3px 0 0 var(--loss); }
.auth-alert[hidden] { display: none; }
.auth-notice { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; color: var(--ink); background: var(--paper-hi); box-shadow: inset 3px 0 0 var(--ink); }
.auth-notice[hidden] { display: none; }
.auth-forgot { justify-self: end; align-self: end; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.auth-forgot:hover { color: var(--ink); }
.auth-card[hidden] { display: none; }
.auth-submit { width: 100%; justify-content: center; }
.auth-switch { margin: 0; text-align: center; font-size: 14px; color: var(--ink-3); }
.auth-switch a, .check-line a { color: var(--ink); font-weight: 600; }
.auth-foot { margin: 0; max-width: 440px; text-align: center; font-size: 12px; color: var(--muted); }
:root[data-theme="medium"] .auth-foot { color: #26262A; }

.password-field { position: relative; display: block; }
.password-field .input { padding-right: 64px; }
.password-field .reveal { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 600; }
.terms-error { margin-top: -10px; }

/* sign-up steps */
.steps { list-style: none; margin: 0 0 4px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; counter-reset: none; }
.steps li { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; font-weight: 600; color: var(--muted); padding-bottom: 10px; border-bottom: 2px solid var(--line); }
.steps li span { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--paper-lo); color: var(--ink-2); }
.steps li[aria-current="step"] { color: var(--ink); border-bottom-color: var(--ink); }
.steps li[aria-current="step"] span, .steps li.done span { background: var(--ink); color: var(--card); }
.steps li.done { color: var(--ink-2); border-bottom-color: var(--ink-3); }
@media (max-width: 420px) { .steps li { font-size: 0; gap: 0; justify-content: center; } }
.step { display: grid; gap: 18px; }
.step[hidden] { display: none; }
.step-actions { display: flex; align-items: center; gap: 10px; }
.step-actions .spacer { flex: 1; }


.meter { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.meter i { height: 4px; border-radius: 2px; background: var(--paper-lo); }
.meter[data-score="1"] i:nth-child(-n+1), .meter[data-score="2"] i:nth-child(-n+2),
.meter[data-score="3"] i:nth-child(-n+3), .meter[data-score="4"] i { background: var(--ink); }
.meter[data-score="0"] i:first-child { background: var(--ink-3); }

/* the password rules, ticked off while typing (monochrome: green and red belong to P&L) */
.pw-rules { list-style: none; margin: 2px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.pw-rules li { position: relative; padding-left: 22px; font-size: 12px; color: var(--muted); }
.pw-rules li::before { content: ""; position: absolute; left: 0; top: 2px; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line); box-sizing: border-box; }
.pw-rules li.met { color: var(--ink); font-weight: 600; }
.pw-rules li.met::before { border-color: var(--ink); background: var(--ink); }
.pw-rules li.met::after { content: ""; position: absolute; left: 4px; top: 5px; width: 6px; height: 3.5px; border-left: 1.8px solid var(--card); border-bottom: 1.8px solid var(--card); transform: rotate(-45deg); }
@media (max-width: 420px) { .pw-rules { grid-template-columns: minmax(0, 1fr); } }

.birth { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; }

/* consents: "I accept all" in bold on top, the separate consents under a hairline */
.consents { display: grid; gap: 10px; }
.check-line.accept-all { padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); font-weight: 800; color: var(--ink); }

/* survey */
.country-field { margin-bottom: 18px; }
.country-field > label { font-size: 14px; font-weight: 600; color: var(--ink); text-transform: none; letter-spacing: 0; }
.question { border: 0; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; min-width: 0; }
.question legend { padding: 0; margin-bottom: 10px; font-size: 14px; font-weight: 600; color: var(--ink); }
.question legend small { font-weight: 400; color: var(--muted); }
/* Answers are square tiles: a pictogram on a soft plate above the label; the chosen ones turn ink. */
.answers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.answer { position: relative; cursor: pointer; min-width: 0; }
.answer input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.answer span {
  display: grid; justify-items: center; align-content: center; gap: 8px; height: 100%; min-height: 104px;
  padding: 14px 8px 12px; border-radius: var(--radius-btn); border: 1.5px solid var(--line); background: var(--card);
  font-size: 13px; font-weight: 600; line-height: 1.25; text-align: center; color: var(--ink-2); overflow-wrap: anywhere;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}
.pictogram {
  width: 52px; height: 52px; padding: 10px; border-radius: var(--radius-btn); background: var(--paper-lo); color: var(--ink);
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  transition: background .15s ease, color .15s ease, transform .2s ease;
}
.pictogram .fill { fill: currentColor; fill-opacity: .18; }
.answer:hover span { border-color: var(--ink-3); color: var(--ink); }
.answer:hover .pictogram { transform: translateY(-2px); }
.answer input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--card); }
.answer input:checked + span .pictogram { background: color-mix(in srgb, var(--card) 16%, transparent); color: var(--card); }
.answer input:checked + span .pictogram .fill { fill-opacity: .45; }
.answer input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.question.invalid .answer span { border-color: var(--loss); }
@media (max-width: 480px) {
  .answers { gap: 6px; }
  .answer span { min-height: 92px; padding: 12px 4px 10px; font-size: 12px; }
  .pictogram { width: 44px; height: 44px; padding: 8px; }
}
@media (max-width: 340px) { .answers { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .answer span, .pictogram { transition: none; } .answer:hover .pictogram { transform: none; } }

/* moving here from the main page (or back): the same page change css/mainpage.css draws */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: page-out 240ms var(--ease-in-out) both; }
  ::view-transition-new(root) { animation: page-in 420ms var(--ease-out) both; }
  @keyframes page-out { to { opacity: 0; transform: scale(0.985); filter: blur(4px); } }
  @keyframes page-in { from { opacity: 0; transform: translateY(14px); } }
}
