/* CleanProof shared styles for inner pages (join, review, profiles, privacy).
   Design tokens below are mirrored in the homepage <style>. Change both together. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink: #1a1a18;
  --ink-light: #4a4a46;
  --ink-faint: #6b6b65;
  --cream: #f7f5f0;
  --white: #ffffff;
  --accent: #2d6a4f;
  --accent-dark: #235c43;
  --accent-light: #e8f4ef;
  --accent-mid: #52b788;
  --gold: #c9b458;
  --border: #e2dfd8;
  --border-strong: #b9b4a9;
  --star: #347956;
  --star-off: #8f887a;
  --error: #b42318;
  --error-light: #fdf1ef;
  --focus: #2d6a4f;
  --serif: 'DM Serif Display', Georgia, serif;
  --sans: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
}

html { scroll-behavior: smooth; }
body { font-family: var(--sans); background: var(--cream); color: var(--ink); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* NAV */
nav { background: rgba(247,245,240,0.95); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.nav-right { display: flex; align-items: center; gap: 6px; }
.logo { font-family: var(--serif); font-size: 1.4rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.logo span { color: var(--accent); }
.nav-back { font-size: 0.93rem; color: var(--ink-light); text-decoration: none; padding: 10px 12px; border-radius: 8px; }
.nav-back:hover { color: var(--accent); }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; font-family: var(--sans); font-size: 1rem; font-weight: 600; padding: 12px 24px; border-radius: 100px; text-decoration: none; border: 1.5px solid var(--accent); cursor: pointer; transition: background 0.2s, color 0.2s, transform 0.15s; }
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-outline { background: var(--white); color: var(--accent); }
.btn-outline:hover { background: var(--accent-light); color: var(--accent-dark); }
.btn-primary:hover { color: var(--white); }
.btn-sm { min-height: 42px; padding: 8px 18px; font-size: .92rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: wait; }

/* PAGE HEADER */
.page-head { padding-block: 48px 32px; }
.label { font-size: 0.95rem; font-weight: 600; color: var(--accent); margin-bottom: 10px; }
h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.1rem, 5vw, 3rem); line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; }
h1 em, h2 em { color: var(--accent); }
h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.5rem, 3.5vw, 1.9rem); line-height: 1.15; letter-spacing: -0.015em; }
h3 { font-size: 1.05rem; font-weight: 600; }
.lead { font-size: 1.05rem; color: var(--ink-light); margin-top: 14px; max-width: 600px; }

/* FORM CARD */
.card { background: var(--white); border: 1px solid var(--border); border-radius: 16px; padding: 32px; }
.form-section + .form-section { border-top: 1px solid var(--border); margin-top: 28px; padding-top: 28px; }
.form-section h2 { font-family: var(--sans); font-size: 1.05rem; font-weight: 600; letter-spacing: 0; margin-bottom: 4px; }
.form-section .hint { font-size: 0.88rem; color: var(--ink-light); margin-bottom: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field label, .field .field-label { font-size: 0.88rem; font-weight: 500; color: var(--ink); }
.req { color: var(--accent); }
.optional { color: var(--ink-faint); font-weight: 400; }
.field input[type=text], .field input[type=email], .field input[type=tel], .field input[type=url], .field input[type=date], .field select, .field textarea {
  width: 100%; min-width: 0; font-family: var(--sans); font-size: 0.95rem; color: var(--ink);
  background: var(--cream); border: 1px solid var(--border-strong); border-radius: 8px; padding: 12px 14px; min-height: 48px; font-size: 1rem;
  transition: border-color 0.2s, background 0.2s; -webkit-appearance: none; appearance: none;
}
.field textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); background-color: var(--white); box-shadow: 0 0 0 3px rgba(45,106,79,.25); }
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%234a4a46' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.field .help { font-size: 0.84rem; color: var(--ink-faint); }

/* errors */
.field-error { font-size: .86rem; font-weight: 500; color: var(--error); margin-top: 2px; }
.field-error:empty { display: none; }
.check + .field-error, .consent .field-error { margin-top: -4px; padding-left: 28px; }
[aria-invalid="true"] { border-color: var(--error) !important; background-color: var(--error-light) !important; }
.has-error > .file-drop, fieldset.has-error, .has-error.checks { border-color: var(--error); }
fieldset.has-error .rating-name { color: var(--error); }
.error-summary { border: 2px solid var(--error); background: var(--error-light); border-radius: 12px; padding: 16px 18px; margin-bottom: 24px; }
.error-summary:focus { outline: 3px solid var(--focus); outline-offset: 3px; }
.error-summary-title { font-weight: 600; color: var(--ink); }
.error-summary ul { margin: 8px 0 0 18px; display: grid; gap: 4px; }
.error-summary a { color: var(--error); font-weight: 500; }
.row-2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 0 14px; }
.row-2 .field { margin-bottom: 16px; }
.form-section .row-2:last-child .field { margin-bottom: 0; }

/* checkboxes */
.checks { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px 16px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 0.95rem; color: var(--ink-light); cursor: pointer; padding: 3px 0; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.consent { background: var(--accent-light); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.consent .check { color: var(--ink); }

/* file input */
.file-drop { border: 1.5px dashed var(--border-strong); border-radius: 10px; padding: 18px; background: var(--cream); display: flex; flex-direction: column; gap: 8px; }
.file-drop input[type=file] { font-family: var(--sans); font-size: 0.9rem; color: var(--ink-light); width: 100%; }
.file-drop input[type=file]::file-selector-button { font-family: var(--sans); font-size: 0.88rem; font-weight: 500; background: var(--white); color: var(--accent); border: 1.5px solid var(--accent); border-radius: 100px; padding: 7px 16px; margin-right: 12px; cursor: pointer; }
.file-error { display: none; font-size: 0.85rem; color: var(--error); }
.file-error.show { display: block; }
.privacy-note { display: flex; gap: 10px; align-items: flex-start; font-size: 0.85rem; color: var(--ink-light); }
.privacy-note svg { flex-shrink: 0; margin-top: 2px; }

/* star rating input (radio buttons, keyboard accessible) */
.rating-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--border); }
.rating-field:last-child { border-bottom: none; }
.rating-field legend, .rating-name { font-size: 0.92rem; font-weight: 500; }
.rating-name small { display: block; font-weight: 400; color: var(--ink-faint); font-size: 0.8rem; }
fieldset { border: none; }
.stars-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.stars-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars-input label { font-size: 1.8rem; line-height: 1; color: #8f897d; cursor: pointer; padding: 3px; transition: color 0.15s; }
.stars-input label:hover, .stars-input label:hover ~ label,
.stars-input input:checked ~ label { color: var(--star); }
.stars-input input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 1px; border-radius: 4px; }
.rating-overall .stars-input label { font-size: 2.2rem; }

/* PROFILE */
.profile-hero { padding-block: 40px 24px; }
.profile-card { background: var(--white); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; }
.example-ribbon { background: var(--ink); color: rgba(255,255,255,0.8); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; padding: 9px 24px; }
.profile-top { padding: 28px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.avatar { width: 72px; height: 72px; border-radius: 16px; background: var(--accent); color: var(--white); font-family: var(--serif); font-size: 2rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { font-family: var(--serif); font-size: 1.9rem; line-height: 1.1; }
.profile-meta { color: var(--ink-light); font-size: 0.95rem; margin-top: 4px; }
.founding { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 600; color: var(--accent); background: var(--accent-light); padding: 4px 10px; border-radius: 100px; margin-top: 8px; }
.profile-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.profile-grid { display: grid; grid-template-columns: 340px minmax(0,1fr); gap: 24px; margin-top: 24px; align-items: start; }
.side-card { background: var(--white); border: 1px solid var(--border); border-radius: 16px; padding: 24px; }
.side-card + .side-card { margin-top: 16px; }
.score { display: flex; align-items: baseline; gap: 10px; }
.score b { font-family: var(--serif); font-weight: 400; font-size: 3rem; line-height: 1; }
.score-sub { font-size: 0.88rem; color: var(--ink-light); margin-top: 4px; }
.stars { letter-spacing: 2px; color: var(--star); }
.stars .off { color: var(--star-off); }
.bars { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.bar-label { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--ink-light); margin-bottom: 5px; }
.bar { height: 6px; border-radius: 4px; background: #ece9e2; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--star); border-radius: 4px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tag { font-size: 0.82rem; background: var(--cream); border: 1px solid var(--border); border-radius: 100px; padding: 4px 12px; color: var(--ink-light); }
.side-card h2, .side-card h3 { font-family: var(--sans); font-size: 1.05rem; font-weight: 600; letter-spacing: 0; line-height: 1.3; margin-bottom: 2px; }
.side-card p { font-size: 0.9rem; color: var(--ink-light); }
.reviews-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.review { background: var(--white); border: 1px solid var(--border); border-radius: 16px; padding: 22px 24px; }
.review + .review { margin-top: 14px; }
.review-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.review-who { font-weight: 600; }
.review-when { font-size: 0.82rem; color: var(--ink-faint); }
.verified { display: inline-flex; align-items: center; gap: 5px; font-size: 0.75rem; font-weight: 600; color: var(--accent); background: var(--accent-light); padding: 4px 10px; border-radius: 100px; white-space: nowrap; }
.review .stars { margin-top: 8px; font-size: 1rem; }
.review-text { margin-top: 8px; color: var(--ink-light); }
.mini-ratings { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 0.84rem; color: var(--ink-faint); }
.mini-ratings b { color: var(--ink); font-weight: 600; }
.reply { margin-top: 14px; padding: 12px 16px; background: var(--cream); border-radius: 10px; font-size: 0.9rem; color: var(--ink-light); }
.reply b { color: var(--ink); }
.resolved { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 600; color: #fff; background: var(--accent); padding: 3px 10px; border-radius: 100px; }
.resolved-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; font-size: .86rem; color: var(--ink-faint); }
.empty { background: var(--white); border: 1.5px dashed var(--border-strong); border-radius: 16px; padding: 36px 24px; text-align: center; color: var(--ink-light); }

/* PROSE (privacy) */
.prose h2 { margin-top: 36px; margin-bottom: 10px; }
.prose p, .prose li { color: var(--ink-light); }
.prose p + p { margin-top: 12px; }
.prose ul { padding-left: 20px; margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.prose strong { color: var(--ink); }
.callout { background: var(--accent-light); border-radius: 12px; padding: 18px 20px; color: var(--ink); }

/* THANKS */
.thanks { padding-block: 72px; text-align: center; }
.thanks .tick { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-light); display: flex; align-items: center; justify-content: center; margin: 0 auto 24px; }
.thanks .lead { margin-left: auto; margin-right: auto; }
.next-steps { text-align: left; margin: 32px auto 0; max-width: 520px; display: flex; flex-direction: column; gap: 14px; }
.next-step { display: flex; gap: 14px; align-items: flex-start; background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.next-step .n { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--white); font-family: var(--serif); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.next-step p { font-size: 0.92rem; color: var(--ink-light); }
.next-step strong { color: var(--ink); }

/* FOOTER */
footer { background: var(--ink); margin-top: 72px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding-block: 28px; }
.footer-logo { font-family: var(--serif); font-size: 1.15rem; color: rgba(255,255,255,0.8); }
.footer-logo span { color: var(--accent-mid); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { font-size: 0.88rem; color: rgba(255,255,255,0.75); text-decoration: none; padding: 6px 0; }
.footer-links a:hover { color: #9fdcbf; }
footer p { font-size: 0.82rem; color: rgba(255,255,255,0.62); }

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 860px) {
  .profile-grid { grid-template-columns: 1fr; }
  .profile-actions { margin-left: 0; width: 100%; }
}
@media (max-width: 640px) {
  .card { padding: 22px 18px; }
  .nav-right .btn { display: none; }
  .row-2, .checks { grid-template-columns: 1fr; }
  .page-head { padding-block: 32px 24px; }
  .profile-top { padding: 22px; }
  .profile-name { font-size: 1.6rem; }
  .review { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
