/* ═══════════════════════════════════════════════════════════
   Scan2Return — THEME V3: "Fresh Found"
   Modern light SaaS — crisp white, emerald → teal.
   Green = found, good fortune. Rounded cards, soft shadows,
   pill buttons, tight sans typography. Zero JavaScript.
   ═══════════════════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
    --bg:          #f4faf8;
    --bg-deep:     #e8f3ef;
    --card:        #ffffff;
    --card-2:      #f2faf6;
    --ink:         #0f1f1c;
    --ink-soft:    #4c615b;
    --ink-faint:   #8ba19a;
    --line:        #ddeae6;
    --line-strong: #bfd4cd;
    --emerald:     #0e9f6e;
    --emerald-deep:#0b7f58;
    --teal:        #14b8a6;
    --emerald-soft: rgba(14, 159, 110, 0.10);
    --success:     #0e9f6e;
    --success-bg:  #e6f6f0;
    --error:       #d64545;
    --error-bg:    #fdeeee;
    --grad:        linear-gradient(135deg, #0e9f6e 0%, #14b8a6 100%);
    --radius:      16px;
    --radius-sm:   10px;
    --max-width:   780px;
    --shadow-card: 0 1px 2px rgba(15, 31, 28, 0.04), 0 10px 30px rgba(15, 31, 28, 0.06);
    --shadow-pop:  0 12px 34px rgba(14, 159, 110, 0.22);
    --shadow-btn:  0 4px 14px rgba(14, 159, 110, 0.28);
    --display: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'JetBrains Mono', monospace;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ── */
html { font-size: 17px; scroll-behavior: smooth; }
body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(900px 380px at 50% -8%, rgba(14, 159, 110, 0.10), transparent 65%),
        radial-gradient(700px 500px at 100% 100%, rgba(20, 184, 166, 0.07), transparent 60%),
        var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--emerald); text-decoration: none; }
a:hover { color: var(--emerald-deep); text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 5px; border: 2px solid var(--bg-deep); }
::-webkit-scrollbar-thumb:hover { background: var(--emerald); }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) var(--bg-deep); }

/* ── Masthead ── */
.masthead {
    position: sticky;
    top: 0;
    z-index: 500;
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    padding: 0 1rem;
}
.masthead-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand-icon {
    color: #fff;
    flex-shrink: 0;
    background: var(--grad);
    border-radius: 10px;
    padding: 5px;
    width: 32px;
    height: 32px;
    box-shadow: 0 4px 10px rgba(14, 159, 110, 0.3);
}
.brand-name {
    font-family: var(--display);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.brand-chip {
    font-family: var(--mono);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    background: var(--emerald-soft);
    color: var(--emerald-deep);
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 700;
    border: 1px solid rgba(14, 159, 110, 0.25);
}
.main-nav {
    display: flex;
    gap: 1.5rem;
}
.main-nav a {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink-soft);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 20px;
    transition: background 0.15s, color 0.15s;
}
.main-nav a:hover {
    color: var(--emerald);
    background: var(--emerald-soft);
    text-decoration: none;
}
.lang-switch {
    display: inline-flex;
    align-items: center;
    margin-left: 0.35rem;
    padding: 0.25rem 0.65rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1.1;
    white-space: nowrap;
    color: var(--emerald-deep);
    background: var(--emerald-soft);
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.lang-switch:hover {
    color: #fff;
    background: var(--emerald);
    border-color: var(--emerald);
    text-decoration: none;
}

/* ── Main Content ── */
main {
    flex: 1;
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 1rem 3.5rem;
}

/* ── Hero ── */
.hero {
    text-align: center;
    padding: 3rem 0 2.25rem;
}
.hero-eyebrow {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--emerald-deep);
    background: var(--emerald-soft);
    border: 1px solid rgba(14, 159, 110, 0.2);
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 1.1rem;
}
.hero h1 {
    font-family: var(--display);
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 0.9rem;
    letter-spacing: -0.03em;
    text-wrap: balance;
}
.hero h1::after {
    content: "";
    display: block;
    width: 64px;
    height: 4px;
    margin: 1rem auto 0;
    border-radius: 4px;
    background: var(--grad);
}
.lede {
    color: var(--ink-soft);
    font-size: 1.08rem;
    max-width: 580px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}
.hero-cta { margin: 0 auto 2rem; }
.hero-cta .btn { font-size: 1.02rem; padding: 0.9rem 1.9rem; }
.register-card { max-width: 500px; }
.btn-google {
    background: #fff;
    color: #232019;
    border: 1px solid #d0d5dd;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    width: 100%;
}
.btn-google:hover {
    background: #f6f8fa;
    color: #232019;
    box-shadow: none;
    transform: none;
}
.google-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--ink-faint);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0.5rem 0;
}
.google-divider::before,
.google-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

/* ── Hero slideshow — native scroll-snap carousel ──
   Swiping is the browser's own horizontal scrolling (overflow-x + scroll-snap),
   so touch gets real momentum. No radio inputs and no arrow buttons: dots under
   the frame show position and jump to a slide, and the track is focusable so
   ←/→ work from a keyboard. */
.hero-slideshow {
    position: relative;
    max-width: 340px;
    margin: 0 auto 2rem;
    overflow: hidden;
    border-radius: 20px;
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: 0 20px 50px rgba(15, 31, 28, 0.14), 0 4px 12px rgba(15, 31, 28, 0.06);
}
.slides-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    cursor: grab;
}
.slides-track::-webkit-scrollbar { display: none; }
.slides-track:focus-visible {
    outline: 2px solid var(--emerald);
    outline-offset: -2px;
}
.slides-track.is-dragging {
    scroll-snap-type: none;
    scroll-behavior: auto;
    cursor: grabbing;
}
.slide {
    flex: 0 0 100%;
    min-width: 100%;
    position: relative;
    padding: 12px;
    background: #fff;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}
.slide img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    -webkit-user-drag: none;
    user-select: none;
}
.slide-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.45rem;
    padding: 0 0 0.85rem;
}
.slide-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--line-strong);
    opacity: 0.45;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}
.slide-dot:hover { opacity: 0.8; }
.slide-dot:focus-visible {
    outline: 2px solid var(--emerald);
    outline-offset: 2px;
}
.slide-dot[aria-current="true"] {
    background: var(--emerald);
    opacity: 1;
    transform: scale(1.25);
}
@media (prefers-reduced-motion: reduce) {
    .slides-track { scroll-behavior: auto; }
}

/* ── Stats ── */
.stats-row {
    display: flex;
    gap: 0.9rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}
.stat {
    text-align: center;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0.95rem 1.5rem;
    min-width: 130px;
    box-shadow: 0 1px 2px rgba(15, 31, 28, 0.04), 0 6px 18px rgba(15, 31, 28, 0.05);
}
.stat-num {
    display: block;
    font-family: var(--mono);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--emerald);
    line-height: 1.15;
}
.stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--ink-faint);
}

/* ── Cards ── */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.75rem;
    box-shadow: var(--shadow-card);
}
.card h2 {
    font-family: var(--display);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.card h2::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--grad);
    flex-shrink: 0;
}

/* ── Found Card (find.php) ── */
.found-card {
    text-align: center;
    max-width: 470px;
    margin: 1rem auto 1.75rem;
    padding: 2.5rem;
}
.found-header { margin-bottom: 1.5rem; }
.found-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 6px 12px rgba(14, 159, 110, 0.25));
}
.found-header h1 {
    font-family: var(--display);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}
.found-header h1::after {
    content: "";
    display: block;
    width: 48px;
    height: 4px;
    margin: 0.7rem auto 0;
    border-radius: 4px;
    background: var(--grad);
}
.found-subtitle {
    color: var(--ink-soft);
    font-size: 0.92rem;
    margin-top: 0.75rem;
}
.owner-info {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: 14px;
}
.owner-name {
    font-family: var(--display);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-bottom: 0.25rem;
}
.key-desc {
    font-size: 0.95rem;
    color: var(--ink-soft);
    margin-bottom: 0.6rem;
}
.reward-badge {
    display: inline-block;
    background: var(--grad);
    color: #fff;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 700;
    box-shadow: var(--shadow-pop);
}

/* ── Contact action buttons ── */
.contact-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s, color 0.15s;
    line-height: 1.3;
    background: var(--grad);
    color: #fff;
    box-shadow: var(--shadow-btn);
}
.btn:hover {
    background: linear-gradient(135deg, var(--emerald-deep), var(--emerald));
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(14, 159, 110, 0.35);
}
.btn:active { transform: translateY(0); }
.btn-call {
    background: var(--grad);
    color: #fff;
}
.btn-call:hover { background: linear-gradient(135deg, var(--emerald-deep), var(--emerald)); }
.btn-email {
    background: var(--card);
    color: var(--emerald);
    border: 2px solid var(--emerald);
    box-shadow: none;
}
.btn-email:hover {
    background: var(--emerald-soft);
    color: var(--emerald-deep);
    box-shadow: none;
    border-color: var(--emerald-deep);
}
.btn-whatsapp {
    background: #25D366;
    color: #fff;
}
.btn-whatsapp:hover {
    background: #1da851;
    color: #fff;
}
.btn-telegram {
    background: #229ED9;
    color: #fff;
}
.btn-telegram:hover {
    background: #1c8bbd;
    color: #fff;
}
.btn-sm {
    font-size: 0.78rem;
    padding: 0.5rem 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: none;
}
.btn-ghost {
    background: var(--card);
    color: var(--ink-soft);
    border: 1px solid var(--line-strong);
    box-shadow: none;
}
.btn-ghost:hover {
    background: var(--bg-deep);
    color: var(--ink);
    box-shadow: none;
    transform: none;
}
.btn-disabled {
    opacity: 0.4;
    pointer-events: none;
    background: var(--bg-deep);
    color: var(--ink-faint);
    border: 1px solid var(--line);
    box-shadow: none;
}
.alt-phone {
    font-size: 0.9rem;
    color: var(--ink-soft);
    margin-bottom: 1rem;
}
.found-note {
    font-size: 0.8rem;
    color: var(--ink-faint);
    font-family: var(--mono);
}

/* ── Opt-in precise location share ── */
.js-only { display: none; }
html.js .js-only { display: inline-flex; }

/* ── /register: email form disclosed by a button ──
   Progressive enhancement: the email registration form is collapsed behind a
   button when JS is available. The toggle is .js-only, so without JS it stays
   hidden and the form is always visible (unchanged behaviour). A failed POST
   re-renders the form with .is-open so validation errors stay on screen. */
.btn-email-toggle {
    width: 100%;
    background: #fff;
    color: #232019;
    border: 1px solid #d0d5dd;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.btn-email-toggle:hover {
    background: #f6f8fa;
    color: #232019;
    box-shadow: none;
    transform: none;
}
html.js .btn-email-toggle[aria-expanded="true"] { display: none; }
html.js .email-form-wrap:not(.is-open) { display: none; }
.loc-share { margin-top: 0.75rem; }
/* Sentence case on purpose. .btn-sm forces text-transform:uppercase +
   letter-spacing, and on this button that made "SHARE PRECISE LOCATION" read
   like a system demand to a stranger who has just found someone's keys. The
   finder should feel asked, not instructed. Scoped to this button only. */
.btn-share-loc {
    text-transform: none;
    letter-spacing: 0;
    background: var(--card);
    color: var(--ink-soft);
    border: 1px solid var(--line-strong);
    box-shadow: none;
}
.btn-share-loc:hover {
    background: var(--bg-deep);
    color: var(--ink);
    box-shadow: none;
}
.loc-shared {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--success);
}

/* ── Message Cards (error/info) ── */
.message-card {
    max-width: 470px;
    margin: 2.5rem auto;
    text-align: center;
    padding: 2.75rem 2rem;
}
.message-card h2 {
    font-family: var(--display);
    font-weight: 800;
    margin-bottom: 0.75rem;
    justify-content: center;
}
.message-card p { color: var(--ink-soft); margin-bottom: 0.5rem; }
.message-card .btn { margin-top: 0.75rem; }

/* ── How It Works ── */
.how-list {
    list-style: none;
    counter-reset: how;
    display: grid;
    gap: 0.75rem;
}
.how-list li {
    counter-increment: how;
    display: flex;
    gap: 1.1rem;
    padding: 1.05rem 1.1rem;
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: 14px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.how-list li:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}
.how-list li::before {
    content: counter(how);
    font-family: var(--display);
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    width: 2.1rem;
    height: 2.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--grad);
    border-radius: 50%;
    line-height: 1;
    box-shadow: 0 4px 10px rgba(14, 159, 110, 0.3);
}
.how-list li strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}
.how-list li span {
    color: var(--ink-soft);
    font-size: 0.87rem;
}

/* ── FAQ ── */
.faq-card dl { margin: 0; }
.faq-card dt {
    font-weight: 700;
    font-size: 0.95rem;
    margin-top: 1.1rem;
    color: var(--ink);
    display: flex;
    gap: 0.6rem;
    align-items: baseline;
}
.faq-card dt::before {
    content: "Q";
    font-family: var(--display);
    font-size: 0.72rem;
    font-weight: 800;
    color: #fff;
    background: var(--grad);
    width: 1.35rem;
    height: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    transform: translateY(0.15rem);
}
.faq-card dd {
    color: var(--ink-soft);
    font-size: 0.87rem;
    margin-left: 1.95rem;
    margin-top: 0.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}
.faq-card dd:last-child { border-bottom: none; padding-bottom: 0; }

/* ── Quick Actions ── */
.action-grid {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.admin-quick { text-align: center; }

/* ── Admin Header ── */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.admin-header h1 {
    font-family: var(--display);
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.admin-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ── Stats Grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.4rem;
    text-align: center;
    box-shadow: var(--shadow-card);
}
.stat-card .stat-num {
    font-size: 2rem;
    display: block;
}
.stat-card .stat-label {
    display: block;
    margin-top: 0.3rem;
}
.stat-detail {
    display: block;
    font-size: 0.75rem;
    color: var(--ink-faint);
    margin-top: 0.25rem;
}

/* ── Tables ── */
.table-wrap {
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow-card);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: var(--card);
}
.data-table th {
    text-align: left;
    padding: 0.7rem 0.85rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-faint);
    background: var(--bg-deep);
    border-bottom: 2px solid var(--line-strong);
    white-space: nowrap;
}
.data-table td {
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--card-2); }
.mono {
    font-family: var(--mono);
    font-size: 0.78rem;
}

/* ── Badges ── */
.badge {
    display: inline-block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 12px;
    border-radius: 20px;
    font-weight: 700;
}
.badge-active {
    background: var(--success-bg);
    color: var(--success);
}
.badge-inactive {
    background: var(--error-bg);
    color: var(--error);
}

/* ── Flash Messages ── */
.flash {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border-left: 4px solid;
    box-shadow: var(--shadow-card);
}
.flash-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: var(--success);
}
.flash-error {
    background: var(--error-bg);
    color: var(--error);
    border-color: var(--error);
}
.flash-info {
    background: var(--emerald-soft);
    color: var(--ink-soft);
    border-color: var(--teal);
}

/* ── Forms ── */
.admin-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.form-row {
    display: flex;
    gap: 1rem;
}
.form-row .form-field { flex: 1; }
.form-field {
    display: flex;
    flex-direction: column;
}
.field-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-soft);
    margin-bottom: 0.35rem;
}
.field-input {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.68rem 0.85rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.field-input:focus {
    outline: none;
    border-color: var(--emerald);
    box-shadow: 0 0 0 3px var(--emerald-soft);
}
select.field-input { cursor: pointer; }
.field-help {
    font-size: 0.75rem;
    color: var(--ink-faint);
    margin-top: 0.25rem;
}
.form-help {
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-bottom: 0.25rem;
}
/* Google sign-in consent line: sits under the .btn-google, so give it
   breathing room above (the button itself has no bottom margin). */
.consent-note {
    margin-top: 0.75rem;
}
.form-field-checkbox {
    flex-direction: row;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0;
}
.form-field-checkbox input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.15rem;
    accent-color: var(--emerald);
    flex-shrink: 0;
}
.form-field-checkbox .field-help {
    display: block;
    margin-top: 0.15rem;
}

/* ── Auth Card ── */
.auth-card {
    max-width: 410px;
    margin: 3rem auto;
    text-align: center;
    padding: 2.75rem 2.25rem;
}
.auth-card h1 {
    font-family: var(--display);
    font-weight: 800;
    margin-bottom: 1.5rem;
    justify-content: center;
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}
.auth-form .btn { width: 100%; }

/* ── QR Generated Display ── */
.qr-generated h2 {
    font-family: var(--display);
    font-weight: 800;
    margin-bottom: 1rem;
}
.qr-display {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
}
.qr-display img {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    flex-shrink: 0;
    box-shadow: var(--shadow-card);
    background: #fff;
    padding: 8px;
}
.qr-details {
    flex: 1;
    min-width: 200px;
    font-size: 0.9rem;
    line-height: 1.8;
}
.qr-code-str {
    font-size: 0.7rem !important;
    word-break: break-all;
    color: var(--ink-faint);
    background: var(--card-2);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
}
.qr-url {
    font-size: 0.75rem;
    word-break: break-all;
    margin-top: 0.25rem;
}
.qr-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* ── Pagination ── */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.pg-note {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--ink-faint);
}
.scan-count {
    font-size: 0.8rem;
    color: var(--ink-faint);
    margin-bottom: 0.75rem;
}

/* ── Empty State ── */
.empty-card {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--ink-faint);
}
.empty-card p {
    font-size: 0.95rem;
}

/* ── Back Link ── */
.back-link {
    margin-top: 1rem;
    font-size: 0.85rem;
}

/* ── Footer ── */
/* ── Footer legal links (privacy / terms / disclaimer) ── */
.footer-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.4rem 0.7rem;
    margin: 0.35rem 0 0;
    font-family: var(--mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.footer-legal a {
    color: var(--ink-faint);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    padding-bottom: 1px;
}
.footer-legal a:hover {
    color: var(--ink);
    border-bottom-color: var(--line-strong);
}
.footer-legal a[aria-current="page"] { color: var(--ink); }
.footer-legal .sep { color: var(--line-strong); }

/* ── Legal pages ── */
.legal-card { max-width: 760px; }
.legal-updated {
    margin: 0 0 1.6rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-faint);
}
.legal-body {
    font-size: 0.95rem;
    line-height: 1.78;
    color: var(--ink-soft);
}
.legal-body h2 {
    margin: 2rem 0 0.65rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--line);
    font-size: 1.02rem;
    color: var(--ink);
}
.legal-body h3 {
    margin: 1.35rem 0 0.45rem;
    font-size: 0.92rem;
    color: var(--ink);
}
.legal-body p { margin: 0 0 0.9rem; }
.legal-body ul { margin: 0 0 0.95rem; padding-left: 1.15rem; }
.legal-body li { margin-bottom: 0.45rem; }
.legal-body strong { color: var(--ink); }
.legal-body a {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.legal-body a:hover { color: var(--ink-soft); }

/* ── Contact form ── */
.field-textarea {
    min-height: 9rem;
    resize: vertical;
    font: inherit;
    line-height: 1.6;
}

.site-footer {
    text-align: center;
    padding: 2.25rem 1rem;
    border-top: 1px solid var(--line);
    background: var(--card);
}
.site-footer p {
    color: var(--ink-soft);
    font-size: 0.85rem;
    line-height: 1.6;
}
.site-footer .footer-copyright {
    color: var(--ink-faint);
    font-size: 0.75rem;
    line-height: 1.5;
    margin-top: 0.9rem;
}
.footer-meta {
    font-family: var(--mono);
    font-size: 0.7rem !important;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-faint) !important;
    margin-top: 0.25rem;
}

/* ── Focus ── */
:focus-visible {
    outline: 2px solid var(--emerald);
    outline-offset: 2px;
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── Mobile ── */
@media (max-width: 768px) {
    html { font-size: 16px; }
    .masthead-inner { flex-direction: column; gap: 0.5rem; }
    .main-nav { gap: 1rem; }
    .hero { padding: 2.25rem 0 1.75rem; }
    .hero h1 { font-size: 1.8rem; }
    .card { padding: 1.4rem; }
    .form-row { flex-direction: column; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .admin-header { flex-direction: column; }
    .qr-display { flex-direction: column; align-items: center; }
    .contact-actions .btn { font-size: 1rem; padding: 0.85rem 1rem; }
    .data-table { font-size: 0.75rem; }
    .data-table th, .data-table td { padding: 0.4rem 0.5rem; }
    .stats-row { gap: 0.6rem; }
    .stat { min-width: 100px; padding: 0.8rem 1rem; }

    /* Footer legal nav — quiet single-line treatment. On phones the uppercase
       mono + 0.08em tracking read as oversized/bold next to the tagline, and the
       separate .sep flex item stranded a lone "·" at the end of a wrapped row.
       Mixed case, body font, no separators: one clean row. Desktop untouched. */
    .footer-legal {
        font-family: inherit;
        font-size: 0.78rem;
        text-transform: none;
        letter-spacing: 0;
        gap: 0.35rem 1.1rem;
        margin-top: 0.5rem;
    }
    .footer-legal .sep { display: none; }
}

/* ── Manage Listing (magic token page) — theme-agnostic ── */
.manage-card {
    max-width: 560px;
    margin: 2.5rem auto;
    padding: 2.25rem 2rem;
    text-align: left;
}
.manage-card .found-header { margin-bottom: 1.25rem; }
.manage-section {
    font-weight: 800;
    font-size: 1.02rem;
    margin: 1.75rem 0 0.6rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}
.manage-danger { color: var(--error); }
.status-badge {
    display: inline-block;
    padding: 0.18rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.status-badge.active { background: var(--success-bg); color: var(--success); border: 1px solid var(--success); }
.status-badge.off { background: var(--error-bg); color: var(--error); border: 1px solid var(--error); }
.manage-link {
    font-family: var(--mono);
    font-size: 0.8rem;
    background: var(--card-2, var(--bg-deep, #f2f2f2));
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.9rem;
    word-break: break-all;
    margin: 0.6rem 0 0.9rem;
}
.manage-box {
    margin-top: 1.25rem;
    padding: 1rem 1.1rem;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--card-2, transparent);
    text-align: left;
}
.manage-box h2 { font-size: 0.95rem; margin-bottom: 0.4rem; }
.precise-badge {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.08rem 0.45rem;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 999px;
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success);
    white-space: nowrap;
}
.confirm-line {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-bottom: 0.85rem;
}
.confirm-line input[type="checkbox"] {
    width: 1.05rem;
    height: 1.05rem;
    margin-top: 0.18rem;
    accent-color: var(--success);
    flex-shrink: 0;
}
.btn-danger {
    background: var(--error);
    color: #fff;
}
.btn-danger:hover { background: var(--error); filter: brightness(0.92); }

/* ── Hamburger dropdown nav (pure CSS, zero JS) ── */
/* Wrapper: anchors the dropdown panel to the burger's exact position.
   position:relative makes it the containing block for the absolute
   .main-nav, so the panel's left edge always matches the burger's —
   on every screen size. (Previously the panel was position:fixed;
   left:1rem, glued to the viewport edge — fine on mobile where the
   burger sits at 1rem, but ~230px off on desktop where the centered
   780px masthead pushes the burger inward.) */
.nav-wrap {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}
.nav-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.nav-burger {
    display: inline-flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    margin-right: 0.5rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: transparent;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.nav-burger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-burger:hover { background: var(--emerald-soft); border-color: var(--emerald); }
.nav-toggle:checked ~ .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle:checked ~ .nav-burger span:nth-child(2) { opacity: 0; }
.nav-toggle:checked ~ .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Backdrop: dims the page, click to close.
   NOTE: use vw/vh units, NOT inset:0 — the .masthead's backdrop-filter
   makes it the containing block for position:fixed children, so inset:0
   would clamp to the masthead's 61px height instead of the viewport. */
.nav-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(15, 31, 28, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
    z-index: 900;
    cursor: pointer;
}
.nav-toggle:checked ~ .nav-backdrop {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease;
}

/* Dropdown panel: compact, sized to its items, drops below the burger.
   Anchored to .nav-wrap (position:relative), so its left edge always
   lines up with the burger's left edge at every viewport width.
   Animation: slides in from the LEFT edge (translateX -110% → 0) with a
   springy back-out overshoot; closes with a quick ease-out. */
.main-nav {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    width: 250px;
    max-width: calc(100vw - 1rem);
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    background: var(--card, #fff);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 14px 34px rgba(15, 31, 28, 0.18), 0 4px 10px rgba(15, 31, 28, 0.08);
    transform: translateX(-110%) translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.18s ease, visibility 0s linear 0.24s;
    z-index: 910;
    overflow-y: auto;
    max-height: calc(100dvh - 5rem);
}
.nav-toggle:checked ~ .main-nav {
    transform: translateX(0) translateY(0);
    opacity: 1;
    visibility: visible;
    transition: transform 0.34s cubic-bezier(0.34, 1.3, 0.64, 1), opacity 0.22s ease;
}
.main-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.72rem 0.85rem;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.main-nav .nav-item + .nav-item {
    margin-top: 2px;
    border-top: 1px solid var(--line);
    padding-top: 0.72rem;
}
.main-nav .nav-item:hover {
    background: var(--emerald-soft);
    color: var(--emerald-deep);
    text-decoration: none;
}
.main-nav .nav-item.active {
    background: var(--emerald-soft);
    color: var(--emerald-deep);
}
.main-nav .nav-ico {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--emerald);
    opacity: 0.85;
}
.main-nav .nav-item:hover .nav-ico,
.main-nav .nav-item.active .nav-ico { opacity: 1; }
.main-nav .nav-logout { color: var(--ink-soft); }
.main-nav .nav-logout .nav-ico { color: var(--error, #c0392b); }
.main-nav .nav-logout:hover { background: var(--error-bg, #fdecea); color: var(--error, #c0392b); }
.main-nav .nav-logout:hover .nav-ico { color: var(--error, #c0392b); }

/* Keep the masthead a single row on mobile (burger | brand | lang) */
.masthead-inner { flex-direction: row; }

/* ── Desktop (≥900px): inline nav, no burger ──
   The burger/backdrop/checkbox disappear and the same .main-nav items
   render as a horizontal row in the masthead. Flex `order` re-arranges
   the masthead from [burger | brand | lang] to [brand | links | lang].
   Everything below 900px keeps the dropdown behaviour untouched. */
@media (min-width: 900px) {
    .nav-toggle,
    .nav-burger,
    .nav-backdrop { display: none; }

    .masthead-inner > .brand { order: 1; }
    .nav-wrap { order: 2; display: flex; align-items: center; }
    .lang-switch { order: 3; }

    .main-nav,
    .nav-toggle:checked ~ .main-nav {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        flex-direction: row;
        gap: 0.15rem;
        padding: 0;
        width: auto;
        max-width: none;
        max-height: none;
        overflow: visible;
        background: none;
        border: none;
        border-radius: 0;
        box-shadow: none;
        transition: none;
        z-index: auto;
    }
    .main-nav .nav-item { padding: 0.42rem 0.7rem; font-size: 0.9rem; }
    .main-nav .nav-item + .nav-item {
        margin-top: 0;
        border-top: none;
        padding-top: 0.42rem;
    }
    /* Text-only links on desktop; icons stay in the mobile dropdown */
    .main-nav .nav-ico { display: none; }
}

/* ── OTP resend block ──
   Visually separates "resend code" from OTP verification so the
   hCaptcha clearly belongs to the resend action, not the verify step. */
.otp-resend {
    margin-top: 1.75rem;
    padding-top: 1.1rem;
    border-top: 1px dashed var(--line-strong);
}
.otp-resend-hint {
    margin: 0 0 0.6rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ink-soft);
}


/* ══════════════════════════════════════════════════════════════════
   QR code delivery, the print sheet, and the admin charity line
   (added 2026-09-26)

   Every value here uses only variables COMMON to all three themes —
   --ink / --ink-soft / --ink-faint / --line / --line-strong / --card /
   --success / --success-bg / --radius* / --mono. v1 has --terra, v2 --gold*,
   v3 --emerald*/--teal, and no accent variable is shared, so reaching for
   one of those would break the other two themes. Check with
   `sed -n '/^:root/,/^}/p'` per theme before adding anything here.
   ══════════════════════════════════════════════════════════════════ */

/* The block that SURVIVES printing. On screen: centred and modest. */
.qr-print-area {
    text-align: center;
    margin: 0 auto 1.25rem;
    max-width: 340px;
}
.qr-card-page .qr-print-area { max-width: 400px; }

.qr-img {
    display: block;
    margin: 0 auto;
    background: #fff;            /* always white behind the code, in any theme */
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    /* content-box so the padding sits AROUND the code instead of shrinking it */
    box-sizing: content-box;
    padding: 10px;
}
.qr-print-name {
    margin: 0.75rem 0 0.25rem;
    font-weight: 700;
    color: var(--ink);
}
.qr-print-hint {
    margin: 0;
    font-size: 0.9rem;
    color: var(--ink-soft);
}
.qr-print-url {
    margin: 0.4rem 0 0;
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--ink-faint);
    word-break: break-all;       /* the URL is long and must not widen the page */
}

/* Extends the existing .qr-actions rule (which only set display/gap/margin) */
.qr-actions { flex-wrap: wrap; }

/* Owner dashboard: a small "your code" panel.
   Stacked and centred rather than QR-beside-text: at the width this card
   allows, a side-by-side layout would force the thumbnail under ~140px, where
   a 49-module code is ~2.3px per module and reads as grey noise. Stacked it
   can be 170px (~3px per module) and stay legible. */
.qr-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    padding: 1rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--card);
}
.qr-panel .found-note { margin: 0; text-align: center; }
.qr-img-thumb { margin: 0; padding: 6px; }
/* Inside the owner-facing cards the action row is the focal point, so centre
   it. Scoped: the admin page's .qr-actions sits beside QR details and stays
   left-aligned. */
.qr-card-page .qr-actions,
.register-card .qr-actions { justify-content: center; }

/* Read-only "In support of" on the owner's own listing page. Dashed border and
   muted ink say "not yours to edit" without disabling the field, which would
   stop a screen reader announcing it and stop anyone selecting the text. */
.field-input.is-locked {
    background: var(--card);
    color: var(--ink-soft);
    border-style: dashed;
}

/* Admin: charity page — a wrapping flex list, NOT a table. As a 5-column
   table the inline editor was pushed past the page width and the input got
   clipped; a list that wraps cannot overflow at any viewport. */
.charity-list { margin-top: 0.5rem; }
.charity-item {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 0.9rem 0.25rem;
    border-bottom: 1px solid var(--line);
}
.charity-item:last-child { border-bottom: none; }
.charity-who {
    flex: 1 1 250px;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.85rem;
    color: var(--ink-soft);
}
.charity-id { font-size: 0.78rem; }
.charity-key { color: var(--ink); font-weight: 700; }
.charity-edit { flex: 1 1 300px; }
.charity-item-form { display: flex; flex-direction: column; gap: 0.35rem; }
.charity-row-actions { display: flex; gap: 0.35rem; }

/* The charity line as the FINDER sees it, under the reward badge.
   Previously the column rendered with no rule at all in the live theme (the
   only .support-cause rule lived in assets/css/style.css, which nothing loads),
   so this is both new styling and a fix for an unstyled element. */
.support-cause {
    margin: 0.75rem 0 0;
    padding: 0.5rem 0.8rem;
    border-left: 3px solid var(--success);
    background: var(--success-bg);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.92rem;
    color: var(--ink);
}

/* ── Print ────────────────────────────────────────────────────────────
   Printing /my-qr or the registration success screen must produce a clean
   sheet: the code, its name, the finder hint, the URL. Nothing else.
   The old behaviour printed the whole page — nav, footer, buttons, flashes.
   bulk_print.php is unaffected: it ships its own <style> and never loads a
   theme stylesheet. */
@media print {
    @page { margin: 12mm; }

    .masthead, .main-nav, .nav-burger, .nav-backdrop, .lang-switch,
    .site-footer, .no-print {
        display: none !important;
    }

    html, body {
        background: #fff !important;
        color: #000 !important;
    }
    main, .card, .auth-card, .qr-card-page {
        background: #fff !important;
        border: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        max-width: none !important;
    }

    /* The code is the whole point: roughly 45mm across, comfortably above the
       ~30mm floor where a phone camera starts to struggle. The quiet zone is
       inside the image, so it scales with it. */
    .qr-print-area { max-width: none !important; margin: 0 !important; }
    .qr-img {
        width: 45mm !important;
        height: 45mm !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
    }
    .qr-print-name { font-size: 13pt !important; margin: 7mm 0 1mm !important; }
    .qr-print-hint { font-size: 10pt !important; }
    .qr-print-url  { font-size: 7pt !important; }
}

/* ── How It Works page (how-it-works.php) ──
   Scoped to .hiw-* hooks so nothing else on the site is affected. Reuses the
   existing palette variables and card container for a native look. */
.hiw-card h1 {
    margin-top: 0;
}
.hiw-lede {
    color: var(--ink-soft);
    font-size: 1.05rem;
    margin-top: -0.25rem;
}
.hiw-video {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 1.5rem 0 2rem;
    background: var(--bg-deep);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.hiw-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.hiw-card h2 {
    font-size: 1.25rem;
    margin: 1.75rem 0 0.5rem;
}
.hiw-card p,
.hiw-card li {
    color: var(--ink-soft);
    line-height: 1.7;
}
.hiw-card ul {
    margin: 0.5rem 0 0 1.15rem;
    padding: 0;
}
.hiw-card li {
    margin-bottom: 0.4rem;
}
.hiw-dev {
    color: var(--ink-faint);
}
.hiw-card a {
    color: var(--emerald-deep);
}
