/*
 * Dish List shared styles for the redesigned pages.
 * Brand tokens, navbar, buttons, checklist rows, toast and footer.
 * Pages add their own layout in a <style> block. Plain CSS, not part of the Tailwind build.
 */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --ink: #1c1814;
    --cream: #faf7f2;
    --paper: #f5f0e8;
    --paper-deep: #f0ebe3;
    --line: rgba(28, 24, 20, 0.1);
    --muted: #6f645c;
    --orange: #e85d04;
    --orange-dark: #c94d00;
    --orange-wash: rgba(232, 93, 4, 0.08);
    --sage: #5c7a4e;
    --tan: #c8a87a;
    --serif: "DM Serif Display", Georgia, serif;
    --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --gutter: clamp(16px, 5vw, 48px);
}

html { background: var(--paper); }
body { min-height: 100vh; background: var(--paper); color: var(--ink); font-family: var(--sans); line-height: 1.5; }
main { overflow-x: clip; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 4px; }

/* Nav (shared _navbar.html) */
.site-nav {
    position: sticky; top: 0; z-index: 50; min-height: 64px;
    padding: 0 var(--gutter);
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    background: rgba(250, 247, 242, 0.94);
    border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; min-height: 44px; }
.brand-mark { width: 36px; height: 36px; background: var(--orange); border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.brand-name { font-family: var(--serif); font-size: 21px; letter-spacing: -0.01em; white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-link { font-size: 14px; color: var(--muted); transition: color 0.15s ease; display: inline-flex; align-items: center; min-height: 44px; }
.nav-link:hover { color: var(--ink); }
.nav-action { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; background: var(--orange); color: #fff; border: 0; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.nav-action:hover { background: var(--orange-dark); }
.logout-form { display: inline; }

/* Parse form (shared by every layout) */
.url-box {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1.5px solid var(--line); border-radius: 14px;
    padding: 6px 6px 6px 16px;
    box-shadow: 0 1px 2px rgba(28, 24, 20, 0.04), 0 8px 24px rgba(28, 24, 20, 0.06);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.url-box.is-focused { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.18); }
.url-icon { flex-shrink: 0; color: var(--muted); }
.url-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; padding: 10px 4px; min-height: 44px; }
.url-input::placeholder { color: #a39890; }
.submit-btn {
    min-height: 44px; padding: 0 22px; border: 0; border-radius: 10px;
    background: var(--orange); color: #fff; font-size: 15px; font-weight: 600;
    white-space: nowrap; flex-shrink: 0; cursor: pointer; transition: background 0.15s ease;
}
.submit-btn:hover { background: var(--orange-dark); }
.submit-btn:disabled { opacity: 0.8; cursor: wait; }
.submit-loading { display: none; align-items: center; gap: 8px; }
.is-submitting .submit-text { display: none; }
.is-submitting .submit-loading { display: flex; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; border-radius: 999px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-note { margin-top: 10px; font-size: 13px; color: var(--muted); }
.url-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.text-link { color: var(--orange-dark); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; min-height: 44px; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-dark); }
.btn-secondary { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-secondary:hover { border-color: var(--ink); }

/* Footer */
.site-footer { background: var(--paper-deep); border-top: 1px solid var(--line); padding: 28px var(--gutter); }
.footer-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 16px; }
.footer-mark { width: 28px; height: 28px; background: var(--orange); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.footer-copy { font-size: 13px; color: var(--muted); }

@media (max-width: 760px) {
    .site-nav { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
    .nav-links { gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
    .nav-link { font-size: 13px; }
}
@media (max-width: 520px) {
    .url-box { flex-direction: column; align-items: stretch; padding: 8px; }
    .url-icon { display: none; }
    .url-input { padding: 8px; }
    .submit-btn { width: 100%; }
    .nav-link[href*="shopping-list"] { display: none; }
    .nav-action { padding: 0 14px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation-duration: 0.01ms !important; }
}

/* Shared app-page pieces (layered on the homepage's common styles) */
[hidden] { display: none !important; }
.wrap { max-width: 1100px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.page { padding-block: 28px 56px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 4vw, 40px); line-height: 1.1; letter-spacing: -0.01em; }
.page-sub { margin-top: 4px; color: var(--muted); font-size: 15px; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 14px; color: var(--muted); }
.back:hover { color: var(--ink); }
.sec-title { font-family: var(--serif); font-weight: 400; font-size: 22px; }
.eyebrow-sm { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--cream); color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; }
.icon-btn:hover { border-color: var(--ink); }
.icon-btn.is-on { background: var(--orange-wash); border-color: rgba(232, 93, 4, 0.4); color: var(--orange-dark); }
.btn { cursor: pointer; gap: 8px; }
.btn:not(.btn-secondary):not(.btn-danger) { border: 0; }
.btn-danger { background: transparent; color: #b42318; border: 1.5px solid rgba(180, 35, 24, 0.3); }
.btn-danger:hover { background: rgba(180, 35, 24, 0.06); }
.btn-block { width: 100%; }

/* Checkable rows: whole row is the tap target (48px+) */
.checks { list-style: none; }
.check { display: flex; align-items: flex-start; gap: 12px; padding: 12px 4px; min-height: 48px; border-bottom: 1px solid var(--line); cursor: pointer; }
.check input { -webkit-appearance: none; appearance: none; flex-shrink: 0; width: 24px; height: 24px; margin-top: 1px; border: 2px solid var(--tan); border-radius: 7px; background: #fff; display: grid; place-content: center; cursor: pointer; }
.check input::after { content: ""; width: 12px; height: 7px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.check input:checked { background: var(--sage); border-color: var(--sage); }
.check input:checked::after { opacity: 1; }
.check input:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.check-text { flex: 1; min-width: 0; font-size: 16px; line-height: 1.45; }
.check-meta { display: block; font-size: 13px; color: var(--muted); }
.check:has(input:checked) .check-text > span:first-child { text-decoration: line-through; text-decoration-color: rgba(28, 24, 20, 0.35); color: var(--muted); }

.row-list { list-style: none; border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.row-link { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 12px 4px; min-height: 56px; justify-content: center; }
.row-link:hover .row-title { color: var(--orange-dark); }
.row-title { font-weight: 500; font-size: 16px; line-height: 1.35; }
.row-meta { font-size: 13px; color: var(--muted); }

.flash { border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-bottom: 16px; background: rgba(92, 122, 78, 0.12); color: #3e5534; border: 1px solid rgba(92, 122, 78, 0.25); }
.flash.error { background: rgba(180, 35, 24, 0.08); color: #8a1c12; border-color: rgba(180, 35, 24, 0.25); }
.empty { padding: 32px 20px; text-align: center; border: 1.5px dashed var(--line); border-radius: 12px; color: var(--muted); display: grid; gap: 12px; justify-items: center; }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--cream); padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 60; }
.toast[hidden] { display: none; }

.bottom-bar { position: sticky; bottom: 0; z-index: 40; background: rgba(250, 247, 242, 0.96); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom, 0px)); }
.bottom-bar-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.search-field { display: flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 12px; min-height: 44px; }
.search-field:focus-within { border-color: var(--orange); }
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; min-height: 42px; }
.search-field svg { color: var(--muted); flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Auth pages (log in, sign up): a single narrow card */
.auth-wrap { max-width: 440px; margin: 0 auto; padding: clamp(28px, 6vh, 56px) var(--gutter) 56px; }
.auth-card { background: var(--cream); border: 1px solid var(--line); border-radius: 16px; padding: clamp(20px, 5vw, 32px); display: grid; gap: 18px; }
.auth-card h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 6vw, 38px); line-height: 1.1; letter-spacing: -0.01em; }
.auth-sub { margin-top: 6px; color: var(--muted); font-size: 15px; }
.auth-form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.field-input { width: 100%; min-height: 48px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 14px; font-size: 16px; background: #fff; color: var(--ink); }
.field-input:focus { outline: 0; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.18); }
.field-input[aria-invalid="true"] { border-color: #b42318; }
.field-hint { font-size: 13px; color: var(--muted); }
.field-error { font-size: 13px; color: #8a1c12; font-weight: 500; }
.pw { position: relative; }
.pw .field-input { padding-right: 76px; }
.pw-toggle { position: absolute; top: 2px; right: 2px; min-height: 44px; min-width: 64px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--orange-dark); font-size: 13px; font-weight: 600; cursor: pointer; }
.pw-toggle:hover { background: var(--paper-deep); }
.pw-toggle:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.auth-form .check { border-bottom: 0; padding: 4px 0; min-height: 44px; align-items: center; }
.auth-form .check-text { font-size: 15px; }
.auth-form .btn { width: 100%; min-height: 48px; font-size: 15px; }
.auth-alt { text-align: center; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }
.auth-alt a { color: var(--orange-dark); font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
.auth-perks { list-style: none; display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.auth-perks li { display: flex; gap: 8px; align-items: baseline; }
.auth-perks li::before { content: "\2713"; color: var(--sage); font-weight: 700; }
