/* Admin pages. Builds on style.css (same tokens, pills, polaroid and welcome-screen styles). */

body.admin { background: var(--cream); }

/* ---------- login ---------- */

.a-login {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 2rem 1rem;
  background: #000;
  color: #fff;
}
.a-login h1 { margin: .75rem 0 1.25rem; font: 800 3rem/1 var(--he); }
.login-form { width: min(100%, 21rem); }
.login-form label { display: block; margin-bottom: .45rem; font-weight: 700; }
.login-form input {
  display: block;
  width: 100%;
  margin-bottom: 1rem;
  padding: .85rem 1rem;
  border: 0;
  border-radius: .9rem;
  font: 400 1.15rem var(--he);
}
.login-form .pill { width: 100%; }
.login-form .form-error { color: var(--yellow); }
.back-link { margin-top: 1.5rem; color: #bbb; font-size: .95rem; }

/* ---------- top bar ---------- */

.a-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: calc(var(--safe-top) + .9rem) 1.25rem .9rem;
  background: #000;
  color: #fff;
}
.a-login .logo { width: 13rem; }
.logo.small { width: 6.6rem; }
.a-bar-title {
  padding: .2rem .75rem;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  font: 700 .95rem var(--he);
}
.a-bar-link {
  margin-inline-start: auto;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font: 500 .95rem var(--he);
  text-decoration: underline;
  text-underline-offset: .2em;
}

/* ---------- layout ---------- */

.a-grid {
  display: grid;
  gap: 1.5rem;
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}
@media (min-width: 56rem) {
  .a-grid { padding-top: 2.25rem; }
  /* while creating or editing: the form, with the phone preview beside it */
  .a-grid.editing { max-width: 62rem; grid-template-columns: minmax(0, 1fr) 23.5rem; align-items: start; }
  .a-preview { position: sticky; top: 1.5rem; }
}

.card {
  margin-bottom: 1rem;
  padding: 1.5rem 1.25rem;
  border-radius: 1.4rem;
  background: #fff;
  box-shadow: 0 12px 30px -20px rgb(0 0 0 / .4);
}
.card h1 { margin: 0; font: 800 2rem/1.1 var(--he); }
.card-label { margin: 0 0 .6rem; color: var(--grey); font: 500 .95rem var(--he); }

.actions { display: grid; gap: .8rem; }
.actions .pill { width: 100%; text-decoration: none; }
.pill.dark { background: var(--ink); color: #fff; }
.pill.small {
  width: auto;
  min-height: 2.6rem;
  margin: 0;
  padding: .35rem 1.15rem;
  font-size: 1rem;
}

/* ---------- events list ---------- */

.list-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.list-head h1 { margin: 0; font: 800 2.2rem/1 var(--he); }
.visit-note {
  margin: 0 0 1rem;
  padding: .65rem .9rem;
  border-radius: .9rem;
  background: #fff;
  border-inline-start: 5px solid var(--yellow);
  font-weight: 500;
}

.event:not(.status-is-open) .event-title,
.event:not(.status-is-open) .stats b { opacity: .5; }

.event-head { margin-bottom: .9rem; }
.card .event-title { margin: 0; font: 800 clamp(1.8rem, 7vw, 2.3rem)/1.05 var(--he); }
.event-title .amp { font-size: .45em; margin: 0 .25em; vertical-align: .3em; }
.event-meta { margin: .35rem 0 0; color: var(--grey); font-size: .9rem; }

.status-row { display: flex; align-items: center; gap: .75rem; }
.status-title { font: 700 .95rem var(--he); }
.status-control {
  display: flex;
  flex: 1;
  gap: .25rem;
  padding: .25rem;
  border-radius: 999px;
  background: var(--cream);
}
.status-control button {
  flex: 1;
  padding: .5rem .4rem;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--grey);
  font: 700 .95rem var(--he);
}
.status-control button[aria-pressed='true'] { color: #fff; background: var(--ink); }
.status-control .status-open[aria-pressed='true'] { color: var(--ink); background: var(--yellow); }
.status-control .status-paused[aria-pressed='true'] { color: var(--ink); background: #d8d4c6; }
.status-control button:disabled { opacity: .6; }
.status-hint { margin: .4rem 0 1rem; color: var(--grey); font-size: .88rem; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1rem; }
.stats div { position: relative; padding: .8rem 1rem; border-radius: 1rem; background: var(--cream); }
.stats b { display: block; font: 800 2.4rem/1 var(--he); }
.stats span { color: var(--grey); font: 500 .95rem var(--he); }
.fresh {
  position: absolute;
  top: .6rem;
  inset-inline-end: .6rem;
  padding: .15rem .55rem;
  border-radius: 999px;
  background: var(--yellow);
  font: 700 .8rem var(--he);
  font-style: normal;
}

.event .link-row { margin-bottom: 1rem; }
.card-actions { display: flex; flex-wrap: wrap; gap: .6rem; }

/* ---------- no events yet ---------- */

.idle { text-align: center; padding-block: 2rem; cursor: default; }
.idle-icon { width: 6.4rem; height: 4.8rem; }
.idle h2 { margin: .5rem 0 .35rem; font: 800 1.8rem/1.1 var(--he); }
.idle p { margin: 0 0 1.5rem; color: var(--grey); }

/* ---------- event form ---------- */

.event-form h1 { margin-bottom: 1.25rem; }
.field { display: block; margin-bottom: 1.2rem; }
.field > span { display: block; margin-bottom: .4rem; font: 700 1.05rem var(--he); }
.field input {
  display: block;
  width: 100%;
  padding: .8rem 1rem;
  border: 2px solid #e4e0d4;
  border-radius: .9rem;
  background: #fff;
  font: 400 1.1rem var(--he);
}
.field input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--yellow); }
.field input.script-input { padding-block: .2rem; font: 400 1.9rem/1.3 var(--script); }
.field small { display: block; margin-top: .35rem; color: var(--grey); font-size: .88rem; }

.hero-field { display: flex; align-items: center; gap: 1rem; }
.hero-thumb {
  flex: none;
  width: 4.5rem;
  height: 6rem;
  border-radius: .7rem;
  border: 2px solid #e4e0d4;
  background: radial-gradient(circle at 30% 25%, #ffe7a8 0 2px, transparent 6px),
              radial-gradient(circle at 70% 20%, #ffe7a8 0 2px, transparent 6px),
              radial-gradient(ellipse at 50% 20%, #3b2a14, #0b0704);
  background-size: cover;
  background-position: center;
}
.hero-buttons { display: flex; flex-direction: column; align-items: flex-start; gap: .55rem; }
.text-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--grey);
  text-decoration: underline;
  text-underline-offset: .2em;
}

.form-error { margin: 0 0 1rem; color: #b3261e; font-weight: 600; }

/* ---------- guest link ---------- */

.link-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.url {
  direction: ltr;
  unicode-bidi: isolate;
  color: var(--ink);
  font-weight: 700;
  word-break: break-all;
}

/* ---------- live preview ---------- */

.previews { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 1rem; }

.phone {
  --s: .56;
  position: relative;
  flex: none;
  width: calc(375px * var(--s) + 16px);
  height: calc(812px * var(--s) + 16px);
  overflow: hidden;
  border: 8px solid #111;
  border-radius: 2.3rem;
  background: #000;
  box-shadow: 0 18px 36px -18px rgb(0 0 0 / .6);
  pointer-events: none;
}
.phone-screen.screen {
  position: absolute;
  top: 0;
  right: 0;
  width: 375px;
  height: 812px;
  min-height: 812px;
  transform: scale(var(--s));
  transform-origin: top right;
}
/* sizes on the guest page scale with the phone's width (vw); pin them to a 375px phone here */
.phone-screen .title { font-size: 58px; }

.mini-polaroid {
  width: 7.5rem;
  transform: rotate(4deg);
  box-shadow: 0 10px 22px -8px rgb(0 0 0 / .4);
}
.mini-polaroid .photo { background: #2a2a2a center / cover; }
.mini-polaroid .caption { font-size: 1.15rem; }

/* ---------- photo limit stepper ---------- */

.stepper { display: inline-flex; align-items: center; gap: .5rem; }
.stepper button {
  width: 2.8rem;
  height: 2.8rem;
  border: 0;
  border-radius: 50%;
  background: var(--yellow);
  font: 700 1.5rem/1 var(--he);
}
.field .stepper input {
  width: 4.5rem;
  text-align: center;
  font-weight: 700;
  -moz-appearance: textfield;
}
.stepper input::-webkit-inner-spin-button,
.stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- QR dialog ---------- */

.qr-dialog {
  width: min(100% - 2rem, 24rem);
  padding: 1.5rem 1.25rem 1.25rem;
  border: 0;
  border-radius: 1.4rem;
  text-align: center;
  font-family: var(--he);
}
.qr-dialog::backdrop { background: rgb(0 0 0 / .6); }
.qr-dialog h2 { margin: 0 0 1rem; font: 800 1.8rem/1.1 var(--he); }
.qr-dialog h2 .amp { font-size: .45em; margin: 0 .25em; vertical-align: .3em; }
.qr-dialog img { display: block; width: 100%; max-width: 16rem; margin: 0 auto .75rem; image-rendering: pixelated; }
.qr-dialog .url { display: block; margin-bottom: 1.25rem; }
.qr-dialog .actions .pill { text-decoration: none; }

/* ---------- delete ---------- */

.delete-zone { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid #ece8dc; text-align: center; }
.delete-zone small { display: block; margin-top: .3rem; color: var(--grey); font-size: .85rem; }
.text-btn.danger { color: #b3261e; font-weight: 700; }
