/* Keepsie visitor page. Palette and sizes follow docs/screen/Keepsie.html
   ("What the babysitter sees"). */
:root {
  --bg: #0b1417;
  --card: #121e22;
  --card-2: #182a2f;
  --border: #223439;
  --text: #e9f1f0;
  --muted: #93a9aa;
  --teal: #2dd4bf;
  --teal-fill: #0f3a37;
  --gold: #e3b45f;
  --on-gold: #1a1204;
  --on-teal: #04201c;
  --error: #ff8a80;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-text-size-adjust: 100%;
}

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100vh;
}

button,
input,
a.button {
  font-family: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* Header */
.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}

h1 {
  margin: 6px 0 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.valid {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 4px 10px;
  border-radius: 999px;
}

.languages {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.languages button {
  min-width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.languages button[aria-pressed='true'] {
  border-color: var(--teal);
  background: var(--teal-fill);
  color: var(--teal);
}

/* Big buttons */
.alarm {
  min-height: 60px;
  border-radius: 16px;
  border: none;
  background: var(--gold);
  color: var(--on-gold);
  font-size: 17px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
  text-decoration: none;
}

.primary {
  height: 52px;
  border-radius: 16px;
  border: none;
  background: var(--teal);
  color: var(--on-teal);
  font-size: 16px;
  font-weight: 800;
}

.primary:disabled {
  opacity: 0.6;
}

.secondary {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

/* Cards */
.card {
  padding: 16px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.card.emergency {
  border-color: var(--gold);
}

.notes {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-line;
}

.divider {
  height: 1px;
  background: var(--border);
}

/* Steps */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.step-number {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--on-gold);
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-text {
  flex: 1;
  min-width: 0;
}

.step-title {
  font-weight: 700;
  font-size: 15px;
}

.step-detail {
  color: var(--muted);
  font-size: 14px;
  margin-top: 2px;
  white-space: pre-line;
}

/* Rows: contacts and hidden codes */
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 15px;
}

.row .label {
  color: var(--muted);
  display: block;
}

.row .value {
  font-weight: 700;
  word-break: break-word;
}

.row .value.masked {
  letter-spacing: 0.2em;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--teal);
  background: var(--teal-fill);
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-button svg,
.alarm svg {
  width: 22px;
  height: 22px;
}

/* Photos and videos */
.media-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.media-strip::-webkit-scrollbar {
  display: none;
}

.thumb {
  position: relative;
  flex-shrink: 0;
  width: 128px;
  height: 96px;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  padding: 0;
  background: var(--card-2);
}

.thumb.large {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
}

.thumb.step {
  width: 72px;
  height: 72px;
  margin-top: 8px;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.25);
  font-size: 26px;
}

.pinned {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

/* Drawn whole at its own shape, so pins (placed as fractions of the
   photo's width and height) land on their spot. */
.pinned img {
  display: block;
  width: 100%;
  height: auto;
}

.pinned-open {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
}

.viewer-frame {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: 100%;
}

.viewer-frame img {
  display: block;
  max-width: 100vw;
  max-height: 100vh;
}

.pin {
  position: absolute;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  background: var(--gold);
  color: var(--on-gold);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.pin.active,
.pin-labels li.active .step-number {
  background: var(--teal);
  color: var(--on-teal);
}

.pin-labels {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pin-labels li {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 15px;
}

/* PIN screen */
.gate {
  margin-top: 8vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pin-input {
  height: 64px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.4em;
  text-align: center;
  padding: 0 0 0 0.4em;
}

.pin-input:focus {
  border-color: var(--teal);
  outline: none;
}

.message {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
}

.message.error {
  color: var(--error);
}

.footer {
  margin-top: auto;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* Full-screen viewer */
.viewer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.viewer[hidden] {
  display: none;
}

.viewer img,
.viewer video {
  max-width: 100%;
  max-height: 100%;
}

.viewer .close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 22px;
}

@media print {
  .languages,
  .alarm,
  .row-actions {
    display: none;
  }
}
