/* App pages (create, admin, guest, slideshow, cards). Visual language matches the landing page. */
:root {
  --bg: #f5f3ed;
  --surface: #fbfaf6;
  --ink: #202b26;
  --muted: #5d695f;
  --line: #dfdbd0;
  --accent: #263a31;
  --accent-hover: #354d41;
  --accent-ink: #ffffff;
  --accent-soft: #e6e9df;
  --clay: #b96f54;
  --warn: #a44739;
  --warn-soft: #f1e0d8;
  --radius: 6px;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img, video, svg { max-width: 100%; display: block; }
a { color: var(--accent); }
::selection { color: #fff; background: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.035em; }
h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); }
h3 { font-size: 1.25rem; }
h1 em, h2 em, h3 em { color: var(--clay); }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; color: #647168; font-size: .66rem; font-weight: 700; letter-spacing: .19em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--clay); box-shadow: 0 0 0 4px rgba(185, 111, 84, .12); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 640px; margin: 0 auto; padding: 0 16px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; }
.brand-symbol { display: inline-grid; place-items: center; width: 24px; height: 24px; color: var(--clay); }
.brand-symbol svg { width: 100%; height: 100%; }
.brand-name { font-size: 17px; font-weight: 600; letter-spacing: -.055em; line-height: 1; white-space: nowrap; }
.brand-name > span { color: var(--clay); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 10px 18px; border-radius: 4px;
  border: 1px solid rgba(32, 43, 38, .28); background: transparent; color: var(--ink);
  font: inherit; font-size: .9rem; font-weight: 700; letter-spacing: .01em; text-decoration: none; cursor: pointer;
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.btn:hover { background: #fffdf8; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px rgba(38, 58, 49, .1); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-lg { min-height: 56px; padding: 14px 24px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-danger { color: var(--warn); border-color: rgba(164, 71, 57, .5); }
.btn-danger:hover { background: var(--warn-soft); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card + .card { margin-top: 16px; }
.notice { border-radius: var(--radius); padding: 16px 18px; background: var(--accent-soft); }
.notice.warn { background: var(--warn-soft); }
.notice h3 { margin-bottom: .35em; }
.badge { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--accent); color: #f5f3ed; vertical-align: middle; }
.badge.free { background: #e7e7dd; color: #526357; }

label.field { display: block; margin-bottom: 16px; }
label.field > span { display: block; font-size: .8rem; font-weight: 700; margin-bottom: 7px; }
input[type=text], input[type=email], input[type=date], input[type=password], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 13px; border-radius: 3px;
  border: 1px solid #d9ddd4; background: #fffefa; color: var(--ink); font: inherit; font-size: 1rem;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: #788f7b; box-shadow: 0 0 0 3px rgba(120, 143, 123, .18); }
input:disabled, textarea:disabled { opacity: .6; cursor: not-allowed; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; }
.inline-form input { flex: 1 1 220px; width: auto; }

/* Guest page (Keepsake extras) */
.cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); margin: 0 0 22px; background: #e3e0d6; }
.welcome { white-space: pre-line; font-family: var(--serif); font-size: 1.15rem; line-height: 1.55; color: #3c4a42; }

.demo-banner { margin-bottom: 22px; }

/* Plans in the admin page */
.plans { display: grid; gap: 12px; margin-top: 14px; }
@media (min-width: 640px) { .plans.two { grid-template-columns: 1fr 1fr; } }
.plan-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fffefa; }
.plan-card.dark { background: var(--accent); border-color: var(--accent); color: #f5f3ed; }
.plan-card h3 { margin: 0; }
.plan-card .price { font-family: var(--serif); font-size: 2rem; line-height: 1; letter-spacing: -.03em; }
.plan-card ul { margin: 0; padding: 0 0 0 18px; font-size: .88rem; flex: 1; }
.plan-card li { margin: 3px 0; }
.plan-card.dark .btn { background: #f5f3ed; color: var(--accent); border-color: #f5f3ed; }
.plan-card.dark .btn:hover { background: #fff; }
.locked { position: relative; }
.locked > .lock-note { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 0 0 14px; padding: 12px 14px; border-radius: var(--radius); background: var(--accent-soft); font-size: .9rem; }
.locked .lock-body { opacity: .55; pointer-events: none; }
.sub { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.sub h3 { font-size: 1.05rem; margin-bottom: .4em; }
.cover-preview { width: 100%; max-width: 360px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; margin-bottom: 10px; }
.btn:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--clay); outline-offset: 3px; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); }
.switch:first-of-type { border-top: 0; }
.switch input { width: 46px; height: 26px; appearance: none; background: #d6d9cf; border-radius: 999px; position: relative; cursor: pointer; flex: none; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(20px); }

.progress { height: 6px; background: #e3e0d6; border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
.tile { position: relative; aspect-ratio: 1; border-radius: 3px; overflow: hidden; background: #e3e0d6; border: 0; padding: 0; cursor: pointer; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.tile:hover img { transform: scale(1.04); }
.tile .ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); font-size: .8rem; text-align: center; padding: 6px; }
.tile .play { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.6); color: #fff; border-radius: 999px; font-size: .72rem; padding: 2px 8px; }
.tile.is-hidden img { opacity: .35; }
.tile .flag { position: absolute; left: 6px; top: 6px; background: rgba(0,0,0,.65); color: #fff; border-radius: 4px; font-size: .7rem; padding: 1px 6px; }

.lightbox { position: fixed; inset: 0; background: #0f1411; z-index: 50; display: flex; flex-direction: column; }
.lightbox .lb-media { flex: 1; display: grid; place-items: center; min-height: 0; padding: 8px; }
.lightbox .lb-media img, .lightbox .lb-media video { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox .lb-bar { display: flex; gap: 8px; justify-content: space-between; align-items: center; padding: 10px 12px; color: #e8e4dc; flex-wrap: wrap; }
.lightbox .lb-bar .btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.22); color: #fff; min-height: 40px; padding: 8px 14px; }
.lightbox .lb-bar .btn:hover { background: rgba(255,255,255,.18); }
.lightbox .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.12); color: #fff; border: 0; width: 44px; height: 64px; border-radius: 4px; font-size: 1.6rem; cursor: pointer; }
.lightbox .lb-prev { left: 8px; } .lightbox .lb-next { right: 8px; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 4px; z-index: 60; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: calc(100% - 32px); }

.qr-box { background: #fffdf8; border-radius: 4px; padding: 12px; width: 200px; max-width: 100%; border: 1px solid var(--line); }
.qr-box svg { width: 100%; height: auto; }
.split { display: grid; gap: 20px; }
@media (min-width: 720px) { .split { grid-template-columns: 220px 1fr; align-items: start; } }
.stack > * + * { margin-top: 16px; }
.linkbox { display: flex; gap: 8px; align-items: center; background: #fffefa; border: 1px solid var(--line); border-radius: 3px; padding: 9px 11px; font-size: .86rem; word-break: break-all; }

.upload-list { list-style: none; margin: 16px 0 0; padding: 0; }
.upload-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.upload-list li .progress { grid-column: 1 / -1; }
.upload-list .st-ok { color: var(--accent); font-weight: 700; }
.upload-list .st-err { color: var(--warn); font-weight: 700; }

.footer { border-top: 1px solid var(--line); margin-top: 56px; padding: 22px 0 36px; font-size: .82rem; color: var(--muted); }
.footer a { color: var(--muted); margin-right: 14px; }
