/* static/css/site.css  -  Teso Soul Connect brand styles (mobile first) */
:root {
  --red: #d71935;        /* Soul Red: primary actions */
  --red-deep: #a70f28;   /* Deep Red: pressed / emphasis */
  --green: #176b38;      /* Forest Green: success */
  --gold: #e5ae32;       /* Gold: premium (fill only, never text on white) */
  --cream: #fff9f2;
  --white: #ffffff;
  --charcoal: #252525;
  --grey: #5f5f5f;       /* darkened from #777 so small text passes contrast */
  --light: #f2f3f5;
  --error: #b42318;
  --radius: 14px;
  --maxw: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Inter, Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--charcoal);
  background: var(--white);
}
img { max-width: 100%; height: auto; }
a { color: var(--red-deep); }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--charcoal); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--charcoal); color: #fff;
  padding: .6rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1rem; }
.narrow { max-width: 520px; }
.prose { max-width: 720px; }

/* header */
.site-header { background: var(--white); border-bottom: 1px solid var(--light); position: sticky; top: 0; z-index: 20; }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .7rem 1rem; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--charcoal); font-weight: 800; font-size: 1.1rem; }
.brand-logo { display: block; width: 76px; height: auto; }
.brand-name { line-height: 1.1; font-size: 1.45rem; letter-spacing: -.01em; }
@media (min-width: 900px) { .brand-logo { width: 96px; } .brand-name { font-size: 1.7rem; } }
.hero-grid { display: grid; gap: 1.5rem; align-items: center; }
.hero-logo { display: block; width: min(300px, 70%); height: auto; margin: 0 auto; }
@media (min-width: 760px) { .hero-grid { grid-template-columns: 1.3fr 1fr; } .hero-logo { width: 100%; max-width: 380px; } }
.brand-mark { width: 30px; height: 30px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-size: 1rem; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .9rem; }
.nav a { text-decoration: none; color: var(--charcoal); font-weight: 600; padding: .45rem .2rem; font-size: .95rem; }
.nav a:hover { color: var(--red); }
.nav a[aria-current="page"] { color: var(--red-deep); border-bottom: 2px solid var(--red); }
.nav form { margin: 0; }

/* buttons */
.btn {
  display: inline-block; min-height: 44px; padding: .7rem 1.4rem; border-radius: 999px;
  border: 2px solid var(--red); background: var(--red); color: #fff; font: inherit; font-weight: 700;
  text-decoration: none; text-align: center; cursor: pointer;
}
.btn:hover { background: var(--red-deep); border-color: var(--red-deep); color: #fff; }
.btn-secondary { background: transparent; color: var(--red-deep); }
.btn-secondary:hover { background: var(--cream); color: var(--red-deep); }
.btn-small { min-height: 40px; padding: .45rem 1rem; font-size: .9rem; }
.btn-block { display: block; width: 100%; }
.nav .btn { color: #fff; }
.nav .btn-secondary { color: var(--red-deep); }

/* hero */
.hero { background: linear-gradient(180deg, var(--cream) 0%, #fff 100%); padding: 3rem 0 2.5rem; }
.hero h1 { font-size: clamp(1.9rem, 6vw, 3rem); line-height: 1.15; margin: 0 0 .8rem; }
.hero .lead { font-size: 1.15rem; max-width: 36rem; color: var(--grey); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.4rem; }
.eyebrow { color: var(--green); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; margin: 0 0 .6rem; }

/* sections and cards */
.section { padding: 2.5rem 0; }
.section.alt { background: var(--cream); }
.section h2 { font-size: 1.6rem; margin: 0 0 1rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-2 { grid-template-columns: repeat(2, 1fr); } }
.card { background: var(--white); border: 1px solid var(--light); border-radius: var(--radius); padding: 1.2rem; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.card h3 { margin-top: 0; }
.step-number { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 800; margin-bottom: .5rem; }

/* notices */
.notice { border-radius: 10px; padding: .8rem 1rem; margin: 1rem 0; border: 1px solid var(--light); background: var(--light); }
.notice-success { background: #e8f5ec; border-color: var(--green); }
.notice-error { background: #fdecea; border-color: var(--error); }
.notice-warning, .notice-draft { background: #fff4d6; border-color: var(--gold); }
.notice-info { background: #eef3ff; border-color: #9db6f2; }
.banner { background: var(--charcoal); color: #fff; text-align: center; padding: .55rem 1rem; font-size: .9rem; }

/* forms */
.form-card { background: #fff; border: 1px solid var(--light); border-radius: var(--radius); padding: 1.4rem; margin: 1.5rem 0 2.5rem; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.form-card h1 { font-size: 1.6rem; margin-top: 0; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .3rem; }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field input[type="date"] {
  width: 100%; min-height: 46px; padding: .6rem .8rem; border: 1.5px solid #b9bcc2; border-radius: 10px;
  background: var(--light); font: inherit; color: var(--charcoal);
}
.field input:focus { background: #fff; border-color: var(--charcoal); }
.field.has-error input { border-color: var(--error); }
.help { color: var(--grey); font-size: .88rem; margin: .3rem 0 0; }
.error { color: var(--error); font-size: .9rem; margin: .3rem 0 0; font-weight: 600; }
.error::before { content: "Error: "; }
.check { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: .8rem; }
.check input { margin-top: .3rem; width: 20px; height: 20px; flex: none; }
.form-links { margin-top: 1rem; font-size: .95rem; }
.inline-form { display: inline; margin: 0; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--red-deep); text-decoration: underline; cursor: pointer; }

/* status list */
.status-list { list-style: none; padding: 0; margin: 0; }
.status-list li { padding: .6rem 0; border-bottom: 1px solid var(--light); display: flex; justify-content: space-between; gap: 1rem; }
.badge-text { font-weight: 700; }
.badge-text.ok { color: var(--green); }
.badge-text.todo { color: var(--grey); }

details.faq { border-bottom: 1px solid var(--light); padding: .8rem 0; }
details.faq summary { cursor: pointer; font-weight: 700; }

/* footer */
.site-footer { background: var(--charcoal); color: #ddd; padding: 2rem 0; margin-top: 2rem; font-size: .92rem; }
.site-footer a { color: #fff; }
.footer-links { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; padding: 0; list-style: none; margin: 0 0 1rem; }

/* ---------------- Phase 2: profiles ---------------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.field select, .field textarea, .field input[type="number"], .field input[type="file"] {
  width: 100%; min-height: 46px; padding: .6rem .8rem; border: 1.5px solid #b9bcc2; border-radius: 10px;
  background: var(--light); font: inherit; color: var(--charcoal);
}
.field textarea { min-height: 110px; resize: vertical; }
.field select:focus, .field textarea:focus, .field input[type="number"]:focus { background: #fff; border-color: var(--charcoal); }
.field.has-error select, .field.has-error textarea { border-color: var(--error); }
fieldset.fieldset { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
fieldset.fieldset legend { font-weight: 600; padding: 0; margin-bottom: .3rem; }

.step-label { color: var(--grey); font-size: .9rem; margin: 0 0 .4rem; }
.progress { height: 8px; background: var(--light); border-radius: 999px; overflow: hidden; margin-bottom: 1rem; }
.progress span { display: block; height: 100%; background: var(--red); border-radius: 999px; }
.form-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.2rem; }

.choice-grid > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .5rem; }
.choice-grid label { display: flex; align-items: center; gap: .55rem; padding: .55rem .7rem; border: 1.5px solid #d6d8dc; border-radius: 10px; background: #fff; cursor: pointer; }
.choice-grid input[type="checkbox"] { width: 20px; height: 20px; flex: none; }
.choice-grid label:has(input:checked) { border-color: var(--red); background: var(--cream); }

.choice-cards { display: grid; gap: .6rem; }
.choice-card { display: flex; gap: .8rem; align-items: flex-start; padding: .9rem 1rem; border: 1.5px solid #d6d8dc; border-radius: var(--radius); background: #fff; cursor: pointer; }
.choice-card input { width: 22px; height: 22px; margin-top: .15rem; flex: none; }
.choice-card:has(input:checked) { border-color: var(--red); background: var(--cream); }
.choice-text { display: flex; flex-direction: column; }

.age-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }

.photo-grid { list-style: none; padding: 0; margin: 1rem 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.photo-item { position: relative; border: 1px solid var(--light); border-radius: var(--radius); padding: .5rem; background: #fff; }
.photo-item img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 10px; }
.photo-tag { position: absolute; top: .9rem; left: .9rem; background: var(--gold); color: var(--charcoal); font-size: .75rem; font-weight: 800; padding: .15rem .55rem; border-radius: 999px; }
.photo-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }

.chip { display: inline-block; background: var(--cream); border: 1px solid #ecd9c3; border-radius: 999px; padding: .2rem .8rem; margin: 0 .25rem .35rem 0; font-size: .92rem; }
.profile-head { display: flex; gap: 1rem; align-items: center; }
.profile-head h2 { margin: 0 0 .2rem; }
.profile-head p { margin: .2rem 0; }
.profile-photo { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; flex: none; }
.profile-photo.placeholder { background: var(--cream); color: var(--red); display: grid; place-items: center; font-size: 2.4rem; border: 2px dashed #ecd9c3; }

/* ---------------- Phase 3: discovery, matches, safety ---------------- */
.filter-bar { margin: 1rem 0 1.5rem; }
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem .8rem; align-items: end; }
.filter-row .field { margin-bottom: 0; }
.filter-row .field:nth-child(3) { grid-column: 1 / -1; }
.filter-submit .btn { width: 100%; }
@media (min-width: 720px) {
  .filter-row { grid-template-columns: 140px 140px 1fr auto; }
  .filter-row .field:nth-child(3) { grid-column: auto; }
  .filter-submit .btn { width: auto; }
}
.member-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .member-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .member-grid { grid-template-columns: repeat(4, 1fr); } }
.member-card { background: #fff; border: 1px solid var(--light); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.member-card-link { display: block; color: inherit; text-decoration: none; }
.member-card-link:hover { color: inherit; }
.member-card img, .member-card-placeholder { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.member-card-placeholder { background: var(--cream); color: var(--red); display: grid; place-items: center; font-size: 3rem; }
.member-card-body { padding: .7rem .9rem 1rem; }
.member-card-body h3 { margin: 0 0 .1rem; font-size: 1.05rem; }
.member-card-body p { margin: .2rem 0; font-size: .92rem; }
.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1.5rem 0; }
.status-list li form.inline-form { flex: none; }

/* ---------------- Phase 4: messages ---------------- */
.badge-count { display: inline-block; min-width: 1.4rem; padding: 0 .4rem; border-radius: 999px; background: var(--red); color: #fff; font-size: .78rem; font-weight: 800; text-align: center; line-height: 1.4rem; }
.chat-list { list-style: none; padding: 0; margin: 1rem 0; }
.chat-row { display: grid; gap: .1rem; padding: .8rem 1rem; border: 1px solid var(--light); border-radius: var(--radius); margin-bottom: .6rem; background: #fff; text-decoration: none; color: var(--charcoal); }
.chat-row:hover { background: var(--cream); color: var(--charcoal); }
.chat-row.unread { border-color: var(--red); }
.chat-preview { color: var(--grey); font-size: .92rem; }
.chat { display: flex; flex-direction: column; gap: .6rem; margin: 1rem 0; }
.bubble { max-width: 85%; padding: .6rem .9rem; border-radius: 16px; background: var(--light); overflow-wrap: anywhere; }
.bubble p { margin: 0; }
.bubble.mine { align-self: flex-end; background: var(--cream); border: 1px solid #ecd9c3; }
.bubble.theirs { align-self: flex-start; }
.bubble-meta { display: block; margin-top: .25rem; color: var(--grey); font-size: .78rem; }
.match-message { margin-top: .5rem; }
.chat-notice { align-self: center; text-align: center; max-width: 92%; margin: .2rem 0; color: var(--grey); font-size: .85rem; }
.chat-settings { margin: 1rem 0; }
.chat-settings summary { cursor: pointer; }
.chat-settings .field { margin-top: .8rem; }

/* Stage 5: account settings, danger button, Safety Centre */
.btn-danger { background: #9b1c1c; border-color: #9b1c1c; color: #fff; }
.btn-danger:hover { background: #7a1414; border-color: #7a1414; color: #fff; }
.safety-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; margin: 1rem 0 1.5rem; }
@media (min-width: 700px) { .safety-grid { grid-template-columns: 1fr 1fr; } }
.safety-grid .card h3 { margin-top: 0; }
.safety-toc { padding-left: 1.1rem; }

.mono { font-family: ui-monospace, Consolas, monospace; letter-spacing: .05em; word-break: break-all; }

/* Stage 7: identity verification badge (blue = identity verified) */
:root { --blue: #1553b8; }
.badge-verified { display: inline-flex; align-items: center; justify-content: center; min-width: 1.25rem; height: 1.25rem; padding: 0 .35rem; border-radius: 999px; background: var(--blue); color: #fff; font-size: .78rem; font-weight: 800; vertical-align: middle; }
.badge-verified-lg { height: 1.6rem; padding: 0 .7rem; font-size: .85rem; }

/* ---- Stage 9: matching */
.compat { display: inline-block; padding: .1rem .65rem; border-radius: 999px; font-size: .82rem; font-weight: 700; background: var(--cream); border: 1px solid #ecd9c3; color: var(--grey); }
.compat-strong-match { background: #e6f4ea; border-color: #b9dcc3; color: #1b6a35; }
.compat-good-match { background: #eaf1fb; border-color: #bcd1ef; color: var(--blue); }
.plain-list { list-style: none; padding-left: 0; margin: .4rem 0; }
.plain-list li { margin: .35rem 0; }
.question-card textarea { width: 100%; }

/* ---- Stage 8: premium */
.badge-premium { display: inline-flex; align-items: center; padding: 0 .6rem; height: 1.6rem; border-radius: 999px; background: var(--gold); color: var(--charcoal); font-size: .85rem; font-weight: 800; vertical-align: middle; }
.plan-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin: 1rem 0; }
.plan-card { text-align: center; }
.plan-price { font-size: 1.6rem; font-weight: 800; margin: .3rem 0; }
.pay-ref { font-size: 1.6rem; font-weight: 800; letter-spacing: .06em; }