/* ============================================================
   LibConnect — standalone brand styles.
   Palette: deep navy, warm red, gold, cream.
   Mobile-first, no frameworks.
   ============================================================ */

:root {
    --navy: #16283f;
    --navy-dark: #0e1a2b;
    --red: #c1272d;
    --red-dark: #9c1f24;
    --gold: #e3a72f;
    --gold-soft: #f6c453;
    --cream: #fff9f1;
    --ink: #22303f;
    --muted: #5b6773;
    --line: #e7ddcd;
    --ok-bg: #e5f4e3;
    --ok-ink: #256b1e;
    --err-bg: #fdeaea;
    --err-ink: #8f1d22;
    --info-bg: #e8effa;
    --info-ink: #274b7a;
    --radius: 14px;
}

* { box-sizing: border-box; }

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

.wrap { max-width: 1020px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 20px; padding-bottom: 40px; }

a { color: var(--red); }
img { max-width: 100%; display: block; }

h1 { font-size: 1.7rem; margin: 0.4em 0 0.5em; }
h2 { font-size: 1.2rem; margin: 0.8em 0 0.4em; }
.small { font-size: 0.88rem; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* --- Header / footer --- */
.site-header {
    background: var(--navy);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap;
}
.brand { text-decoration: none; font-size: 1.45rem; font-weight: 800; letter-spacing: 0.2px; }
.brand-mark { color: var(--gold-soft); }
.brand-rest { color: #fff; }
.main-nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.main-nav a { color: #f3e9d2; text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.main-nav a:hover { color: var(--gold-soft); }

.site-footer {
    background: var(--navy-dark); color: #cfd8e3; margin-top: 30px; padding: 26px 0 34px;
    font-size: 0.92rem;
}
.site-footer a { color: var(--gold-soft); }
.footer-brand { font-weight: 800; color: #fff; font-size: 1.1rem; margin: 0 0 4px; }
.footer-note { color: var(--gold-soft); }

/* --- Buttons --- */
.btn {
    display: inline-block; background: var(--red); color: #fff; border: none;
    padding: 10px 20px; border-radius: 999px; font-weight: 700; font-size: 0.98rem;
    cursor: pointer; text-decoration: none; text-align: center;
}
.btn:hover { background: var(--red-dark); }
.btn-large { padding: 13px 28px; font-size: 1.05rem; }
.btn-small { padding: 6px 14px; font-size: 0.88rem; }
.btn-ghost {
    background: transparent; color: var(--navy); border: 2px solid var(--navy);
}
.btn-ghost:hover { background: var(--navy); color: #fff; }
.btn-like { background: var(--red); }
.btn-pass { background: #fff; color: var(--navy); border: 2px solid var(--navy); }
.btn-pass:hover { background: var(--navy); color: #fff; }

.link-btn {
    background: none; border: none; padding: 0; color: var(--red);
    font: inherit; cursor: pointer; text-decoration: underline;
}
.link-btn.danger { color: var(--red-dark); font-weight: 700; }
.inline-form { display: inline; }

/* --- Cards / layout --- */
.card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px; margin: 16px 0; box-shadow: 0 1px 4px rgba(22,40,63,0.05);
}
.card.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.grid { display: grid; gap: 16px; }
@media (min-width: 760px) {
    .grid { grid-template-columns: 1fr 1fr; }
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

/* --- Hero --- */
.hero {
    text-align: center; padding: 42px 18px 30px;
    background: linear-gradient(160deg, var(--navy) 0%, #274b63 70%, var(--red-dark) 130%);
    color: #fff; border-radius: 0 0 var(--radius) var(--radius);
    margin: -20px -16px 10px;
}
.hero h1 { font-size: 2.2rem; margin: 0 0 10px; }
.hero-sub { max-width: 640px; margin: 0 auto 20px; font-size: 1.05rem; color: #f3e9d2; }
.hero .btn-ghost { border-color: #fff; color: #fff; margin-left: 8px; }
.hero .btn-ghost:hover { background: #fff; color: var(--navy); }
.hero-note { color: var(--gold-soft); font-weight: 600; margin-top: 14px; }

/* --- Flashes --- */
.flash { border-radius: 10px; padding: 12px 16px; margin: 12px 0; font-weight: 600; }
.flash-success { background: var(--ok-bg); color: var(--ok-ink); }
.flash-error { background: var(--err-bg); color: var(--err-ink); }
.flash-info { background: var(--info-bg); color: var(--info-ink); }

/* --- Forms --- */
label { display: block; font-weight: 600; margin: 14px 0 6px; }
label.check { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="date"], input[type="number"], select, textarea {
    width: 100%; padding: 11px 12px; border: 1.5px solid var(--line);
    border-radius: 10px; font: inherit; background: #fff; margin-top: 4px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
form .btn { margin-top: 16px; }
.upload-form { border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 14px; }

.rule-box {
    background: #fdf3e0; border: 1.5px solid var(--gold); border-radius: 10px;
    padding: 12px 16px; margin: 16px 0;
}
.rule-box.small { font-size: 0.88rem; }

.steps li, .ticks li { margin: 8px 0; }
.ticks { list-style: none; padding-left: 0; }
.ticks li::before { content: "✓ "; color: var(--red); font-weight: 800; }

/* --- Discovery --- */
.filters .filter-row { display: grid; gap: 10px; }
@media (min-width: 760px) {
    .filters .filter-row { grid-template-columns: repeat(3, 1fr); }
}
.filters label { margin: 6px 0; }

.people-grid { display: grid; gap: 16px; margin-top: 16px; }
@media (min-width: 620px) { .people-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 940px) { .people-grid { grid-template-columns: 1fr 1fr 1fr; } }

.person-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; box-shadow: 0 1px 4px rgba(22,40,63,0.06);
}
.person-photo { width: 100%; height: 300px; object-fit: cover; }
.person-photo-empty {
    display: flex; align-items: center; justify-content: center;
    background: #efe6d4; color: var(--muted); font-weight: 600;
}
.person-body { padding: 14px 16px 16px; }
.person-body h3 { margin: 0 0 2px; font-size: 1.15rem; }
.person-body h3 a { color: var(--ink); text-decoration: none; }
.person-actions { margin-top: 10px; }
.person-actions form { display: flex; gap: 10px; }
.person-actions .btn { flex: 1; margin-top: 0; }

.badge-verified {
    background: var(--gold); color: var(--navy-dark); font-size: 0.72rem; font-weight: 800;
    padding: 2px 8px; border-radius: 999px; vertical-align: middle; white-space: nowrap;
}

/* --- Profile view --- */
.photo-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.photo-strip img { height: 300px; width: auto; border-radius: 10px; object-fit: cover; }
.facts { display: grid; gap: 6px 20px; margin: 14px 0; }
@media (min-width: 620px) { .facts { grid-template-columns: 1fr 1fr; } }
.facts dt { font-weight: 700; color: var(--muted); font-size: 0.85rem; }
.facts dd { margin: 0 0 8px; }
.chip {
    display: inline-block; background: #fdf3e0; border: 1px solid var(--gold);
    border-radius: 999px; padding: 3px 12px; margin: 2px 3px 2px 0; font-size: 0.88rem;
}
.profile-safety { margin-top: 18px; }

/* --- Photos (edit page) --- */
.photo-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .photo-grid { grid-template-columns: repeat(3, 1fr); } }
.photo-tile { margin: 0; }
.photo-tile img { width: 100%; height: 210px; object-fit: cover; border-radius: 10px; }
.photo-tile figcaption { padding-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.photo-actions { display: inline-flex; gap: 10px; }
.photo-actions form { display: inline; }
.tag {
    background: var(--info-bg); color: var(--info-ink); font-size: 0.75rem; font-weight: 700;
    padding: 2px 9px; border-radius: 999px;
}
.tag-pending { background: #fdf3e0; color: #8a6410; }
.tag-approved { background: var(--ok-bg); color: var(--ok-ink); }
.tag-rejected { background: var(--err-bg); color: var(--err-ink); }

/* --- Matches & chat --- */
.match-list { display: grid; gap: 10px; margin-top: 14px; }
.match-row {
    display: flex; gap: 14px; align-items: center; background: #fff;
    border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px;
    text-decoration: none; color: var(--ink);
}
.match-thumb { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; flex: none; }
.match-thumb-empty { background: #efe6d4; display: inline-block; }
.match-info { display: grid; }
.unread-dot {
    background: var(--red); color: #fff; font-size: 0.72rem; font-weight: 800;
    padding: 2px 8px; border-radius: 999px; margin-left: 6px;
}

.chat-card { max-width: 720px; margin-left: auto; margin-right: auto; }
.chat-head { display: flex; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.chat-log { display: flex; flex-direction: column; gap: 8px; padding: 16px 2px; max-height: 60vh; overflow-y: auto; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 16px; }
.bubble p { margin: 0; white-space: normal; overflow-wrap: anywhere; }
.bubble-time { font-size: 0.72rem; opacity: 0.75; }
.bubble.mine { background: var(--red); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble.theirs { background: #f1e9d8; align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-form { display: flex; gap: 10px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 12px; }
.chat-form textarea { flex: 1; margin-top: 0; }
.chat-form .btn { margin-top: 0; }

/* --- Admin --- */
.admin-nav { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 6px; }
.stat { text-align: center; }
.stat-num { display: block; font-size: 1.9rem; font-weight: 800; color: var(--navy); }
.stat-label { color: var(--muted); font-weight: 600; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; background: #fff; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
.table th { background: #fdf6e7; }
.mod-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 820px) { .mod-grid { grid-template-columns: repeat(3, 1fr); } }
.mod-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.mod-actions .btn { margin-top: 0; }
.verify-compare { display: flex; gap: 14px; flex-wrap: wrap; }
.verify-compare figure { margin: 0; }
.verify-compare img { height: 220px; width: auto; border-radius: 10px; object-fit: cover; }
.verify-compare figcaption { font-size: 0.85rem; color: var(--muted); text-align: center; padding-top: 4px; }

/* --- Legal pages --- */
.legal h2 { margin-top: 1.2em; }

/* --- Focus visibility (accessibility) --- */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--gold); outline-offset: 2px;
}

/* --- Header logout (POST form styled as a nav link) --- */
.logout-form { display: inline; margin: 0; }
.logout-form .btn { margin-top: 0; }
.nav-link-btn {
    background: none; border: none; padding: 0; cursor: pointer;
    color: #f3e9d2; font: inherit; font-weight: 600; font-size: 0.95rem;
}
.nav-link-btn:hover { color: var(--gold-soft); }

/* --- Honeypot (signup bot trap, invisible to people) --- */
.hp-field { position: absolute; left: -9999px; top: -9999px; height: 0; overflow: hidden; }

/* --- Profile completeness meter --- */
.meter {
    background: #efe6d4; border-radius: 999px; height: 14px; overflow: hidden; margin: 8px 0 4px;
}
.meter-fill { background: linear-gradient(90deg, var(--gold), var(--red)); height: 100%; border-radius: 999px; }
.meter-fill-0 { width: 0%; } .meter-fill-10 { width: 10%; } .meter-fill-20 { width: 20%; }
.meter-fill-30 { width: 30%; } .meter-fill-40 { width: 40%; } .meter-fill-50 { width: 50%; }
.meter-fill-60 { width: 60%; } .meter-fill-70 { width: 70%; } .meter-fill-80 { width: 80%; }
.meter-fill-90 { width: 90%; } .meter-fill-100 { width: 100%; }

/* --- Interest picker + prompt picker (profile edit) --- */
fieldset { border: 1.5px solid var(--line); border-radius: 10px; margin: 18px 0; padding: 12px 16px 16px; }
legend { font-weight: 700; padding: 0 6px; }
.interest-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
@media (min-width: 620px) { .interest-grid { grid-template-columns: 1fr 1fr 1fr; } }
.interest-check { margin: 4px 0; font-weight: 500; }
.prompt-row { border-top: 1px dashed var(--line); padding-top: 6px; margin-top: 8px; }
.prompt-row:first-of-type { border-top: none; }

/* --- Prompt blocks + small chips (profile view / cards) --- */
.prompt-block {
    background: #fdf6e7; border: 1px solid var(--line); border-radius: 10px;
    padding: 10px 14px; margin: 10px 0;
}
.prompt-q { font-weight: 700; color: var(--muted); margin: 0 0 2px; font-size: 0.9rem; }
.prompt-a { margin: 0; font-size: 1.02rem; }
.chip-small { font-size: 0.78rem; padding: 2px 9px; }
.card-interests { margin: 6px 0 0; }

/* --- Chat flagged note --- */
.bubble-flag { display: block; font-size: 0.72rem; font-weight: 700; margin-top: 4px; opacity: 0.9; }

/* --- Admin inline password fields --- */
.mod-actions input[type="password"] { width: auto; margin-top: 0; padding: 9px 12px; }

/* --- Cookie notice bar --- */
.cookie-bar {
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50;
    background: var(--navy); color: #f3e9d2; border-radius: var(--radius);
    padding: 12px 16px; display: flex; gap: 14px; align-items: center;
    box-shadow: 0 6px 24px rgba(0,0,0,0.3); max-width: 860px; margin: 0 auto;
}
.cookie-bar p { margin: 0; font-size: 0.9rem; }
.cookie-bar a { color: var(--gold-soft); }
.cookie-bar .btn { flex: none; }
