/* Wedding photo app — large, high-contrast, easy for older guests. */

:root {
  --ink: #222222;
  --muted: #5a5a5a;
  --accent: #7a1f3d;
  --accent-dark: #5c1029;
  --bg: #faf7f2;
  --card: #ffffff;
  --ok: #1e7d43;
  --warn-bg: #fff6df;
  --warn-ink: #7a5b00;
  --err: #b3261e;
  --err-bg: #fdecea;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 18px; /* base — large by default */
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

/* ---------- Language switch (upper-right corner, every page) ---------- */

.lang-switch {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 100;
}

.lang-switch a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 2px solid #d9d1c3;
  border-radius: 999px;
  padding: 3px 10px 3px 8px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #555;
  text-decoration: none;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
  line-height: 1.5;
}

.lang-switch a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Cards ---------- */

.card {
  max-width: 42rem;
  margin: 2rem auto 3rem;
  padding: 2rem 1.75rem;
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.09);
}

@media (min-width: 700px) {
  .card {
    margin: 3.5rem auto;
  }
}

/* Keep the top of the guest card below the corner language switch */
.card {
  margin-top: 3.5rem;
}

h1 {
  font-size: 1.9rem;
  line-height: 1.25;
  margin: 0 0 0.4rem;
}

h2 {
  font-size: 1.4rem;
  margin: 1.5rem 0 0.5rem;
}

p {
  font-size: 1.15rem;
  margin: 0.5rem 0 1rem;
}

.lede {
  font-size: 1.35rem;
  color: var(--muted);
}

h1 + .lede,
p.lede {
  margin-bottom: 1.25rem;
}

a {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Big buttons (touch-friendly, min 56px) ---------- */

.big-btn,
button.big-btn,
input[type="submit"],
input[type="password"] + .btn {
  display: inline-block;
  width: 100%;
  min-height: 58px;
  padding: 0.8rem 1.2rem;
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  border-radius: 10px;
  border: 3px solid var(--accent);
  background: #fff;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  margin: 0.4rem 0;
}

.big-btn:hover,
button.big-btn:hover {
  background: var(--accent);
  color: #fff;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.big-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Notice banners ---------- */

.notice {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0.75rem 0 1rem;
}

.notice.error {
  background: var(--err-bg);
  color: var(--err);
}

.notice.ok {
  background: #e8f5ec;
  color: var(--ok);
}

/* ---------- Guest upload ---------- */

#photos-wrap {
  margin: 1rem 0;
}

input[type="file"].hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.selected-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
}

.selected-list li {
  background: #f3efe9;
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  margin: 0.3rem 0;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  overflow: hidden;
}

.selected-list img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.selected-list .fname {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Progress bar */

.progress-wrap {
  height: 22px;
  background: #e8e2d8;
  border-radius: 11px;
  overflow: hidden;
  margin: 0.9rem 0;
}

.progress-wrap .bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.25s ease;
}

.progress-label {
  font-size: 1.05rem;
  color: var(--muted);
  text-align: center;
  margin: -0.4rem 0 0.8rem;
}

.hint {
  font-size: 1.05rem;
  color: var(--muted);
  text-align: center;
  margin-top: 1.25rem;
}

/* ---------- Success page ---------- */

.thanks {
  text-align: center;
  padding: 1.5rem 0 0.5rem;
}

.thanks .big-icon {
  font-size: 4rem;
  line-height: 1;
}

.thanks h1 {
  font-size: 2.2rem;
}

/* ---------- Error page ---------- */

.error-page h1 {
  font-size: 2.1rem;
}

/* ---------- Admin ---------- */

.admin-header {
  background: var(--accent);
  color: #fff;
  padding: 0.8rem 4rem 0.8rem 1.25rem; /* right space for the corner language switch */
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 1.05rem;
}

.admin-header .brand {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
}

.admin-header a:not(.brand) {
  color: #fff;
}

.admin-body {
  max-width: 60rem;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
}

.admin-card {
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.05rem;
}

th {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 2px solid #e0dad0;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid #eee7dc;
}

code.link {
  word-break: break-all;
  font-size: 0.95rem;
  background: #f3efe9;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
}

.size-inline {
  width: auto;
  min-width: 11rem;
  min-height: 48px;
  font-size: 1.1rem;
  border: 2px solid #c9c2b6;
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  margin: 0.25rem 0;
}

textarea.size-inline {
  min-height: 120px;
  font-family: inherit;
  font-size: 1.1rem;
  resize: vertical;
}

.row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.95rem;
}

/* ---------- Gallery ---------- */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}

.photo-cell {
  background: #f3efe9;
  border-radius: 10px;
  overflow: hidden;
}

.photo-cell img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  background: #ddd;
}

.photo-cell .cap {
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-head {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
}

/* ---------- QR print page ---------- */

.qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.qr-card {
  border: 2px solid #222;
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  background: #fff;
}

.qr-card svg {
  width: 180px;
  height: 180px;
}

.qr-card .qname {
  font-size: 1.05rem;
  font-weight: 800;
  margin-top: 8px;
}

.qr-card .qurl {
  font-size: 0.8rem;
  color: var(--muted);
  word-break: break-all;
}

.qr-card.generic {
  border-style: dashed;
}

.noprint {
  margin: 1rem 0;
}

@media print {
  .admin-header,
  .noprint {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .admin-body {
    margin: 0;
    padding: 0;
  }
  .qr-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8mm;
  }
  .qr-card {
    break-inside: avoid;
  }
}
