/* Family app — the button screen and the live alert. */

/* --- sign in -------------------------------------------------------------- */

#s-auth { justify-content: center; }
.auth-top { text-align: center; margin-bottom: 28px; }
.brand { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
#s-auth h1 { font-size: 26px; margin: 0 0 8px; }
.terms { margin-top: 24px; text-align: center; }

/* --- home ----------------------------------------------------------------- */

#s-home { padding-bottom: 0; }

.home-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 0 8px;
}
.home-title { font-size: 24px; font-weight: 650; }
.home-sub { color: var(--text-dim); font-size: 15px; margin-top: 4px; }
.icon-btn {
  margin-inline-start: auto; background: var(--bg-raised); border: 1px solid var(--line);
  color: var(--text); width: 44px; height: 44px; border-radius: 50%; font-size: 18px; cursor: pointer;
}

/*
 * The button. It is deliberately enormous: the person may be running, in the
 * dark, with the phone half out of a pocket. It fills the screen below the
 * header, so it can be hit without aiming.
 */
.panic {
  flex: 1;
  min-height: 300px;
  margin: 12px 0 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px;
  background: radial-gradient(circle at 50% 45%, #2a0d10 0%, var(--bg) 72%);
  border: 0; border-radius: 28px;
  color: var(--text); font: inherit; cursor: pointer;
  position: relative; overflow: hidden;
}

.panic-ring {
  width: min(58vw, 230px); aspect-ratio: 1; border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 0 rgba(255,59,48,.45), 0 18px 60px rgba(255,59,48,.35);
  display: block;
  transition: transform .12s ease;
  position: relative;
}
/* The fill that tracks the 5-second hold: the only progress indicator, and it
   is visible from the corner of an eye. */
.panic-ring::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--danger-deep) calc(var(--held, 0) * 1turn), transparent 0);
  transition: background .1s linear;
}
.panic.is-holding .panic-ring { transform: scale(1.06); }
.panic-label { font-size: 18px; font-weight: 600; color: var(--text-dim); text-align: center; padding: 0 24px; }
.panic:disabled { opacity: .6; }

.home-foot { padding-bottom: calc(12px + var(--safe-bottom)); }
.home-foot .card { margin-bottom: 8px; }

/* --- live alert ----------------------------------------------------------- */

.alert-screen { background: #150a0c; }
.alert-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 0 12px; font-size: 20px; font-weight: 650;
}
.alert-head .dot {
  width: 12px; height: 12px; border-radius: 50%; background: var(--danger);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .25; } }

.alert-code {
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; text-align: center;
}
.alert-code .label { color: var(--text-dim); font-size: 13px; }
.alert-code .code {
  font-size: 40px; font-weight: 700; letter-spacing: .15em;
  font-variant-numeric: tabular-nums; margin: 2px 0 6px;
}
.alert-code .hint { text-align: start; }

.alert-cats { margin: 14px 0 6px; }
.cats-label { color: var(--text-dim); font-size: 14px; margin-bottom: 8px; }
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cat {
  min-height: 52px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--bg-raised); color: var(--text); font: inherit; font-size: 15px; cursor: pointer;
}
.cat.is-on { border-color: var(--danger); background: rgba(255,59,48,.14); }

.alert-notified { margin: 12px 0; display: flex; flex-wrap: wrap; gap: 8px; }

/*
 * The actions are pinned to the bottom of the screen, not to the bottom of the
 * content. Cancelling was below the fold once a map, chips and pills had been
 * stacked above it — and the one screen where nobody scrolls to look for a
 * button is the one that is open because something is happening.
 *
 * The window to cancel is ten seconds; anything that costs a scroll costs most
 * of it.
 */
.alert-actions {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 14px 0 calc(6px + var(--safe-bottom));
  background: linear-gradient(transparent, #150a0c 22%);
  z-index: 4;
}
.alert-screen.is-over .alert-actions { background: linear-gradient(transparent, var(--bg) 22%); }
.alert-screen.is-unattended .alert-actions { background: linear-gradient(transparent, #1a1205 22%); }

/* The map gives way first: it is context, the buttons are the action. */
.alert-screen .map-big { min-height: 140px; }

/* The ten quiet seconds: nobody has been sent yet, and the screen says so
   without alarming — the alert IS running, it is simply still reversible. */
.alert-screen.is-holding .dot { background: var(--warn); }
.alert-screen.is-holding #b-cancel-alert { background: var(--warn); color: #10131a; font-weight: 700; }

/* Over, one way or another: the screen calms down. */
.alert-screen.is-over { background: var(--bg); }
.alert-screen.is-over .dot { animation: none; background: var(--text-dim); }
.alert-screen.is-unattended { background: #1a1205; }
.alert-screen.is-unattended .dot { background: var(--warn); }

/* --- lists ---------------------------------------------------------------- */

.member-role { color: var(--text-dim); font-size: 13px; }
.mini { background: none; border: 0; color: var(--text-dim); font-size: 22px; padding: 6px; cursor: pointer; }

/* The last seconds of the cancel window, without a word. */
#b-cancel-alert.is-urgent { color: var(--warn); border-color: var(--warn); }
