/* KALTERA portal: sign-in, invite, reset and Terms screens.
   Ported from the approved prototype (docs/design/prototypes/kaltera-portal/index.html).
   One card centred over the clinic photo, the site's porcelain and teal language.
   The prototype's public-site stand-in, email preview and screen picker are not here. */

:root {
  color-scheme: light;
  --scrim: rgb(16 29 33 / 0.38);
  --card: #F4F7F6;
  --hair: 1px solid var(--rule);
}
html, body { min-height: 100%; }
body { background: var(--navy-deep); color: var(--ink); font-family: var(--f-body); font-size: 15px; }
h1, h2, h3, p { margin: 0; }
a { color: var(--teal); }

.stage { position: relative; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center;
  padding-block: 40px 80px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); overflow: hidden; }
.portal__auth { display: contents; }
/* A card is a grid, so the hidden attribute needs saying again. */
[hidden] { display: none !important; }
.stage__bg { position: fixed; inset: -40px; background: url("../img/how-room.jpg") center / cover no-repeat, var(--navy-lift); filter: blur(14px) saturate(0.85); transform: scale(1.04); z-index: 0; }
.stage__bg::after { content: ""; position: absolute; inset: 0; background: var(--scrim); }

.card { position: relative; z-index: 1; width: min(520px, 100%); background: var(--card); border-radius: 16px; padding: 36px 36px 28px;
  box-shadow: 0 30px 80px -30px rgb(0 0 0 / 0.55); display: grid; gap: 18px; }
.card--wide { width: min(720px, 100%); }
.mark { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--teal); }
.mark svg { width: 26px; height: 38px; }
.mark span { font-family: var(--f-display); font-weight: 300; font-size: 12px; letter-spacing: 0.5em; padding-left: 0.5em; color: var(--navy); }
.card h1 { font-family: var(--f-display); font-weight: 300; font-size: 32px; line-height: 1.12; color: var(--navy); text-align: center; text-wrap: balance; }
.card h1 em { font-style: normal; color: var(--teal); }
.lede { text-align: center; color: var(--ink-muted); font-size: 14px; line-height: 1.5; max-width: 42ch; margin: -6px auto 0; text-wrap: pretty; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 12.5px; color: var(--ink-muted); }
.inp { width: 100%; height: 50px; padding: 0 16px; border: 1px solid var(--rule-strong); border-radius: 10px; background: var(--white); font-size: 15px; }
.inp:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-wash); }
.inp::placeholder { color: var(--ink-faint); }
.inp.is-bad { border-color: var(--bad); }
.vh { position: absolute; left: -9999px; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

.checks { display: grid; gap: 8px; }
.chk { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: start; padding: 13px 14px; border: 1px solid var(--rule-strong); border-radius: 10px; background: var(--white); cursor: pointer; font-size: 14px; line-height: 1.45; }
.chk:hover { border-color: var(--teal-pale); }
.chk input { appearance: none; width: 20px; height: 20px; margin: 0; border: 1.5px solid var(--teal); border-radius: 50%; display: grid; place-items: center; cursor: pointer; background: var(--white); }
.chk input:checked { background: var(--teal); }
.chk input:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--white); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.chk input:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.chk b { font-weight: 500; }
.chk.is-bad { border-color: var(--bad); background: var(--bad-wash); }
.chk a { color: var(--teal); }

.btn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 54px; border: 0; border-radius: 10px; background: var(--teal); color: var(--porcelain); cursor: pointer;
  font-family: var(--f-display); font-size: 12px; letter-spacing: 0.26em; text-transform: uppercase; text-decoration: none; transition: background 200ms var(--ease); }
.btn:hover { background: var(--teal-deep); }
.btn[aria-disabled="true"], .btn:disabled { background: var(--mist); color: var(--ink-faint); cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
/* Google's own sign-in button, drawn by Google into this slot.
   The frame Google draws is as wide as it was told to be, so the slot may
   not be held open by it: the card has to shrink when the window does. */
.gsignin { display: flex; justify-content: center; margin: 16px 0; min-height: 44px; min-width: 0; overflow: hidden; }
.gsignin > div { width: 100%; min-width: 0; display: flex; justify-content: center; }
/* Google draws the button with a margin of its own; this one centres it. */
.gsignin iframe { margin: 0 !important; max-width: 100%; }
.btn--google { background: var(--white); color: var(--ink); border: 1px solid var(--rule-strong); font-family: var(--f-body); font-size: 15px; letter-spacing: 0; text-transform: none; }
.btn--google:hover { background: var(--paper); border-color: var(--ink-line); }
.btn--google svg { width: 18px; height: 18px; }

.err { color: var(--bad); font-size: 13px; text-align: center; }
.fine { text-align: center; font-size: 12px; line-height: 1.5; color: var(--ink-muted); }
.alt { text-align: center; font-size: 15px; }
.alt a, .alt button { color: var(--teal); font-weight: 500; text-underline-offset: 3px; background: none; border: 0; padding: 0; cursor: pointer; font-size: inherit; text-decoration: underline; }
.exit { text-align: center; font-size: 14px; color: var(--ink-muted); }
.or { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; font-family: var(--f-body); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.or::before, .or::after { content: ""; border-top: var(--hair); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13.5px; }
.note { background: var(--mist); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; color: var(--ink-muted); line-height: 1.5; }
.who { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: var(--hair); border-radius: 10px; background: var(--white); }
.who .av { width: 38px; height: 38px; border-radius: 50%; background: var(--teal); color: var(--porcelain); display: grid; place-items: center; font-family: var(--f-display); }
.who b { display: block; font-weight: 500; }
.who span { font-size: 13px; color: var(--ink-muted); }
.rules { display: grid; gap: 4px; font-size: 13px; color: var(--ink-muted); padding: 0; margin: 0; list-style: none; }
.rules li::before { content: "○ "; color: var(--ink-line); }
.rules li.ok { color: var(--ok); }
.rules li.ok::before { content: "● "; color: var(--ok); }
.done-ic { width: 54px; height: 54px; border-radius: 50%; background: var(--ok-wash); color: var(--ok); display: grid; place-items: center; margin: 0 auto; }
.done-ic svg { width: 24px; height: 24px; }

/* Terms text, shown on the Terms acceptance screen */
.terms { max-height: 52vh; overflow: auto; padding-right: 8px; display: grid; gap: 14px; font-size: 14px; line-height: 1.65; color: var(--ink); }
.terms h3 { font-family: var(--f-display); font-weight: 400; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--navy); margin-top: 6px; }
.stamp { font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-muted); text-align: center; }

/* iOS zooms the page when a field under 16px takes the focus, so every
   field is 16px on a small screen. */
@media (max-width: 900px) {
  .inp { font-size: 16px; }
}

@media (max-width: 560px) {
  .stage { padding-block: 16px 64px; align-items: start; }
  .card { padding: 26px 18px 22px; border-radius: 14px; gap: 16px; }
  .card h1 { font-size: 26px; }
  .grid2 { grid-template-columns: 1fr; }
}

/* "Was that you?": two buttons, each with one line under it. */
.owner { display: grid; gap: 8px; margin-top: 8px; }
.owner .fine { margin-bottom: 12px; }
.btn--quiet { background: var(--white); color: var(--ink); border: 1px solid var(--rule-strong); }
.btn--quiet:hover { background: var(--paper); border-color: var(--ink-line); }
/* What was set up before the email was confirmed: facts the owner can recognise. */
.owner__what { margin-top: 20px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 10px; background: var(--white); }
.owner__label { font-family: var(--f-display); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-muted); }
.owner__facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 10px 0 0; font-size: 14px; }
.owner__facts dt { color: var(--ink-muted); }
.owner__facts dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
