/* remote/login.css - the standalone remote login page (remote/login.html). It cannot use /css/app.css: until somebody has signed in the
   server hands out only the files in /remote/, so the handful of tokens and components this one screen needs are repeated here
   (same "sticker book" look as the app: cream paper, ink outlines, hard offset shadows, tangerine primary button).
   House rules still apply: Chrome 90 features only, nothing under 0.8rem, animations touch transform / opacity only. */

:root {
  color-scheme: light;
  --paper: #FFF7E8;
  --paper-deep: #FFEFD3;
  --ink: #1F2347;
  --ink-soft: #4A4E73;
  --ink-faint: #8B8FAE;
  --tangerine: #FF9F1C;
  --sunflower: #FFC93C;
  --sunflower-tint: #FFF1BF;
  --sky: #4DABF7;
  --sky-tint: #D9ECFF;
  --danger: #E5484D;
  --danger-tint: #FFE1E2;
  --success-tint: #D8F5E4;
  --outline: 3px;
  --r-card: 24px;
  --r-btn: 16px;
  --tap: max(56px, 3.2rem);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Baloo 2", "Fredoka", "Segoe UI", Roboto, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: clamp(15px, 2.9vw, 21px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
  background-color: var(--paper);
  /* the same faint halftone dots as the app */
  background-image: radial-gradient(rgba(31, 35, 71, .075) 1.4px, transparent 1.6px);
  background-size: 22px 22px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, p { margin: 0; }
h1 { font-size: 2rem; font-weight: 900; line-height: 1.1; letter-spacing: -.01em; }
button, input { font: inherit; color: inherit; margin: 0; }
button { -webkit-appearance: none; appearance: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; flex: none; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 4px solid var(--sky); outline-offset: 3px; }
input:focus-visible { outline-offset: 1px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- layout -------------------------------------------------------------------------------- */
.wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.card {
  width: 100%;
  max-width: 30rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem 1.25rem 1.25rem;
  background: #fff;
  border: var(--outline) solid var(--ink);
  border-radius: var(--r-card);
  box-shadow: 0 6px 0 var(--ink);
  animation: rise-in .35s cubic-bezier(.2, .8, .2, 1) both;
}
.card.shake { animation: shake .4s ease-in-out; }

.brand { display: flex; align-items: center; gap: .75rem; }
.logo { width: 3.6rem; height: 3.6rem; transform: rotate(-6deg); filter: drop-shadow(0 3px 0 rgba(31, 35, 71, .9)); }
.wordmark { font-size: 1.6rem; font-weight: 900; letter-spacing: -.01em; }
.lead { color: var(--ink-soft); font-size: 1.05rem; }
.fine { color: var(--ink-soft); font-size: .9rem; }

/* ---- form ----------------------------------------------------------------------------------- */
form { display: flex; flex-direction: column; gap: .5rem; }
.label { display: block; font-size: 1.05rem; font-weight: 900; }

.input {
  display: block;
  width: 100%;
  min-height: var(--tap);
  padding: .55em 3.6rem .55em .9em;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  background: #fff;
  border: var(--outline) solid var(--ink);
  border-radius: var(--r-btn);
  box-shadow: inset 0 3px 0 rgba(31, 35, 71, .09);
  -webkit-appearance: none;
  appearance: none;
}
.input:focus { background: #FFFEF8; outline: 4px solid var(--sky); outline-offset: 1px; }
.input:disabled { color: var(--ink-faint); background: #EFE9DA; border-style: dashed; }
.input::-ms-reveal, .input::-ms-clear { display: none; }
.input-group { position: relative; }
.input-trailing {
  position: absolute; top: 50%; right: 5px;
  width: 48px; height: 48px; margin-top: -24px;
  display: grid; place-items: center;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 12px;
}
.input-trailing:active { background: rgba(31, 35, 71, .12); }
.input-trailing:disabled { color: var(--ink-faint); }
.input-trailing svg { width: 1.6rem; height: 1.6rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.error {
  display: flex; align-items: flex-start; gap: .5em;
  font-size: .95rem; font-weight: 900; color: #B3231F;
  animation: rise-in .2s ease-out both;
}
.error::before {
  content: "!";
  flex: none;
  display: inline-grid; place-items: center;
  width: 1.4em; height: 1.4em;
  font-size: .95em; line-height: 1;
  color: #fff;
  background: var(--danger);
  border-radius: 50%;
}

/* ---- buttons -------------------------------------------------------------------------------- */
.btn {
  --lift: 4px;
  --btn-bg: #fff;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5em;
  min-height: var(--tap);
  padding: .5em 1.25em;
  font-size: 1.1rem; font-weight: 900; line-height: 1.1; text-align: center;
  color: var(--ink);
  background: var(--btn-bg);
  border: var(--outline) solid var(--ink);
  border-radius: var(--r-btn);
  box-shadow: 0 var(--lift) 0 var(--ink);
  transition: transform .35s var(--spring);
}
.btn svg { width: 1.3em; height: 1.3em; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.btn:active { transform: translateY(calc(var(--lift) - 1px)); box-shadow: 0 1px 0 var(--ink); transition-duration: 50ms; }
.btn-primary { --btn-bg: var(--tangerine); }
.btn-secondary { --btn-bg: #fff; }
.btn-lg { --lift: 6px; margin-top: .5rem; min-height: max(68px, 4.2rem); font-size: 1.4rem; border-radius: 20px; }
.btn-sm { --lift: 3px; min-height: 48px; padding: .3em 1em; font-size: 1rem; }
.btn:disabled {
  --btn-bg: #EFE9DA;
  color: var(--ink-faint);
  border-style: dashed;
  border-color: var(--ink-faint);
  box-shadow: none;
  transform: translateY(2px);
}
.btn.is-busy { pointer-events: none; }
.btn.is-busy svg { display: none; }
.btn.is-busy::after {
  content: "";
  width: 1em; height: 1em;
  border: 3px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ---- notice (not set up / off / at home) -------------------------------------------------------- */
.notice {
  display: flex; flex-direction: column; gap: .75rem;
  padding: .85rem 1rem;
  background: var(--sunflower-tint);
  border: var(--outline) solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 3px 0 var(--ink);
}
.notice.is-info { background: var(--sky-tint); }
.notice-text { font-weight: 800; }
.notice-actions { display: flex; flex-wrap: wrap; gap: .6rem; }

/* ---- motion --------------------------------------------------------------------------------- */
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(9px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(4px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .card, .card.shake, .error { animation: none; }
  .btn { transition: none; }
}

.noscript { max-width: 30rem; margin: 1rem auto; padding: 1rem; background: var(--danger-tint); border: var(--outline) solid var(--ink); border-radius: 20px; }

@media (min-width: 600px) {
  .card { padding: 2rem 2rem 1.5rem; gap: 1.1rem; }
}
