:root {
  --mcd-red: #DA291C;
  --mcd-red-dark: #B32217;
  --mcd-gold: #FFC72C;
  --ink: #241C15;
  --ink-soft: #5A5148;
  --paper: #FFFDF8;
  --line: #ECE4D6;
  --radius: 14px;
  --green: #1B8A3E;
  --green-bg: #E8F6EC;
  --red-bg: #FDE9E6;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

header.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; max-width: 1120px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 46px; width: auto; border-radius: 6px; }
.brand-text { font-weight: 800; font-size: 1.05rem; color: var(--ink); line-height: 1.1; }
.brand-text span { display: block; font-weight: 500; font-size: 0.72rem; color: var(--ink-soft); letter-spacing: 0.04em; text-transform: uppercase; }
.crumb { font-size: 0.85rem; color: var(--ink-soft); font-weight: 600; }
.crumb a { color: var(--mcd-red-dark); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px; font-weight: 700; font-size: 0.95rem;
  text-decoration: none; border: none; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease;
}
.btn-primary { background: var(--mcd-red); color: #fff; box-shadow: 0 6px 16px rgba(218,41,28,0.25); }
.btn-primary:hover { background: var(--mcd-red-dark); transform: translateY(-1px); }
.btn-primary:disabled { background: #CFC6B8; box-shadow: none; cursor: not-allowed; transform: none; }
.btn-secondary { background: var(--ink); color: #fff; }
.btn-secondary:hover { transform: translateY(-1px); }
.btn-ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--mcd-red); }
.btn-block { width: 100%; }

/* Portal landing */
.portal-hero {
  background: linear-gradient(180deg, #FFF7E4 0%, var(--paper) 100%);
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.eyebrow {
  display: inline-block; text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 0.78rem; font-weight: 700; color: var(--mcd-red-dark);
  background: #FDE9E6; padding: 6px 12px; border-radius: 999px; margin-bottom: 16px;
}
.portal-hero h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0 0 10px; }
.portal-hero p { color: var(--ink-soft); font-size: 1.05rem; max-width: 56ch; margin: 0 auto; }

.portal-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
  padding: 48px 0 64px;
}
.portal-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 24px; display: flex; flex-direction: column; gap: 14px;
  text-decoration: none; color: var(--ink); transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 2px 8px rgba(36,28,21,0.04);
}
.portal-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(36,28,21,0.10); }
.portal-card.disabled { opacity: 0.62; cursor: default; }
.portal-card.disabled:hover { transform: none; box-shadow: 0 2px 8px rgba(36,28,21,0.04); }
.portal-icon {
  width: 52px; height: 52px; border-radius: 14px; background: var(--red-bg);
  display: flex; align-items: center; justify-content: center; color: var(--mcd-red);
}
.portal-card h3 { margin: 0; font-size: 1.15rem; }
.portal-card p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; flex-grow: 1; }
.portal-card .tag { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--mcd-red-dark); }
.portal-card .tag.soon { color: var(--ink-soft); }
.portal-card .go { font-weight: 700; font-size: 0.9rem; color: var(--mcd-red-dark); }

/* Auth card */
.auth-wrap { max-width: 420px; margin: 0 auto; padding: 64px 24px 80px; }
.auth-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 34px 30px; box-shadow: 0 2px 8px rgba(36,28,21,0.05);
}
.auth-card h2 { margin: 0 0 6px; font-size: 1.4rem; }
.auth-card .sub { color: var(--ink-soft); font-size: 0.92rem; margin: 0 0 24px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 700; font-size: 0.85rem; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--line);
  font-size: 0.96rem; font-family: inherit; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--mcd-red); }
.auth-error {
  background: var(--red-bg); color: var(--mcd-red-dark); font-size: 0.88rem; font-weight: 600;
  padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; display: none;
}
.auth-error.show { display: block; }

/* Dashboard */
.dash-header { padding: 30px 0 10px; }
.dash-header .who { color: var(--ink-soft); font-size: 0.92rem; }
.dash-header .who strong { color: var(--ink); }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; padding: 24px 0 64px; }

/* Cleanliness form */
.form-topbar {
  background: #fff; border-bottom: 1px solid var(--line); padding: 18px 0;
  position: sticky; top: 65px; z-index: 40;
}
.progress-bar-track { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.progress-bar-fill { height: 100%; background: var(--mcd-red); width: 0%; transition: width .2s ease; }
.score-pill {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.85rem;
  background: var(--green-bg); color: var(--green); padding: 6px 14px; border-radius: 999px;
}

.section-block { padding: 32px 0 8px; border-top: 1px solid var(--line); margin-top: 24px; }
.section-block:first-of-type { border-top: none; margin-top: 0; }
.section-title-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.section-title-row h2 { margin: 0; font-size: 1.3rem; }
.section-pts { color: var(--ink-soft); font-size: 0.85rem; font-weight: 600; }

.check-item {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; margin-top: 12px;
}
.check-item .item-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.check-item .item-label { font-weight: 600; font-size: 0.96rem; flex: 1; }
.check-item .item-pts { color: var(--ink-soft); font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.pf-toggle { display: flex; gap: 8px; margin-top: 12px; }
.pf-btn {
  flex: 1; padding: 10px; border-radius: 10px; border: 1.5px solid var(--line);
  background: #fff; font-weight: 700; font-size: 0.88rem; cursor: pointer; text-align: center;
  color: var(--ink-soft);
}
.pf-btn.pass.active { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.pf-btn.fail.active { background: var(--red-bg); border-color: var(--mcd-red); color: var(--mcd-red-dark); }
.pf-btn.na.active { background: #F1EDE4; border-color: var(--ink-soft); color: var(--ink); }
.fail-extra { display: none; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.fail-extra.show { display: block; }
.fail-extra label { display: block; font-size: 0.82rem; font-weight: 700; margin-bottom: 6px; }
.photo-input-wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.photo-input-wrap input[type=file] { font-size: 0.85rem; }
.photo-preview { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; display: none; border: 1px solid var(--line); }
.photo-required-note { color: var(--mcd-red-dark); font-size: 0.78rem; font-weight: 700; margin-top: 4px; display: none; }
.photo-required-note.show { display: block; }
.photo-status { font-size: 0.78rem; font-weight: 600; margin-top: 4px; display: none; }
.photo-status.show { display: block; }
.photo-status.processing { color: var(--ink-soft); }
.photo-status.error { color: var(--mcd-red-dark); }

.playplace-toggle {
  display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 18px; margin: 20px 0;
}
.playplace-toggle input { width: 18px; height: 18px; }

.signoff-block {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; margin-top: 36px;
}
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.submit-bar { padding: 24px 0 72px; text-align: center; }
.submit-note { color: var(--ink-soft); font-size: 0.85rem; margin-top: 10px; }

.status-banner {
  display: none; padding: 14px 18px; border-radius: 12px; font-weight: 700; font-size: 0.9rem; margin-bottom: 18px;
}
.status-banner.show { display: block; }
.status-banner.info { background: #FFF7E4; color: var(--ink); }
.status-banner.error { background: var(--red-bg); color: var(--mcd-red-dark); }
.status-banner.success { background: var(--green-bg); color: var(--green); }

.site-footer-min {
  border-top: 1px solid var(--line); padding: 24px 0; text-align: center;
  color: var(--ink-soft); font-size: 0.82rem;
}

/* Admin dashboard */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding: 24px 0 8px; }
.stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px;
}
.stat-card .num { font-size: 1.7rem; font-weight: 800; color: var(--ink); }
.stat-card .lbl { color: var(--ink-soft); font-size: 0.82rem; font-weight: 600; margin-top: 2px; }

.filters-bar {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; margin: 24px 0;
}
.filters-bar .field { margin-bottom: 0; min-width: 160px; flex: 1; }
.filters-bar .field label { font-size: 0.76rem; margin-bottom: 4px; }
.filters-bar .field input, .filters-bar .field select { padding: 9px 11px; font-size: 0.88rem; }
.filters-bar .btn { padding: 10px 18px; font-size: 0.85rem; white-space: nowrap; }

.data-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.data-table th, table.data-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data-table th { background: #FBF7EF; font-weight: 700; cursor: pointer; user-select: none; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-soft); }
table.data-table th:hover { color: var(--mcd-red-dark); }
table.data-table tbody tr:hover { background: #FFFBF3; }
table.data-table td.score-cell { font-weight: 700; }
.score-good { color: var(--green); }
.score-warn { color: #B8860B; }
.score-bad { color: var(--mcd-red-dark); }
.row-actions a { color: var(--mcd-red-dark); font-weight: 700; text-decoration: none; margin-right: 12px; font-size: 0.85rem; }
.row-actions a:hover { text-decoration: underline; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-soft); }

@media (max-width: 760px) {
  .portal-grid, .form-grid { grid-template-columns: 1fr; }
  .form-row-2 { grid-template-columns: 1fr; }
  .form-topbar { top: 0; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}
