/* Mavonya app additions — the same design system as the
   public pages (styles.css): dark green #0b4a2e, white,
   Chewy display type, DM Sans body, one 1080px frame, the
   4/8/12/16/24/32/48/64 spacing scale. App8 merged the two
   competing .button definitions into the ONE rule below. */

/* One card pattern: hairline border, 16px radius, token
   padding. Stacked cards sit 16px apart. */
.card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  margin: 16px 0;
  background: #fff;
}

.card h2, .card h3 { margin-top: 0; }

/* ONE primary button pattern (app8 — this is the only
   .button rule in either stylesheet): filled green, 8px
   radius, 52px tall, 18px/700. Width law: a button that is
   a form's or card's own action takes its container's full
   width; paired actions (.row-actions) share one size —
   side by side on desktop, stacked full-width on phone;
   the chat form's Send keeps its row beside the input. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--green);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.3;
  min-height: 52px;
  padding: 12px 28px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.05s ease, filter 0.15s ease;
}

.button:hover { background: var(--green-dark); }
.button:active { transform: translateY(1px); filter: brightness(0.94); }
.button:disabled { opacity: 0.55; }

.button.secondary {
  background: #fff;
  color: var(--green);
  border: 2px solid var(--green);
}
.button.secondary:hover { background: #eef5f0; }

.button.small { min-height: 44px; padding: 8px 16px; font-size: 16px; }

.button.danger-quiet {
  background: #fff;
  color: #8a2b20;
  border: 2px solid #b3402f;
}
.button.danger-quiet:hover { background: #fdf4f2; }

.card > .button, form > .button, .signup-step > .button { display: flex; width: 100%; }
.chat-form > .button { display: inline-flex; width: auto; }

/* Text runs into a button with a 24px gap (16px paragraph
   margin + 8px); a helper note follows its button at 12px. */
p + .button { margin-top: 8px; }
.button + p { margin-top: 12px; }

.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row-actions .button { flex: 1 1 0; }

/* Profile sign-out pair (app8.1): full width, same height,
   keeping the paragraph rhythm the old <p> wrappers gave. */
.profile-actions { margin: 16px 0; }

.notice {
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
  background: #f6faf7;
}

.notice.error { border-left-color: #b3402f; background: #fdf4f2; }

.muted { color: var(--muted); }
.small { font-size: 15px; }

.avatars { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

.person { display: flex; align-items: center; gap: 8px; }

.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; flex: none;
}

.people-list { list-style: none; margin: 0; padding: 0; }
.people-list li {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 0; border-top: 1px solid var(--line);
}
.people-list li:first-child { border-top: 0; }

.link-button {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--green); font: inherit; font-weight: 600; text-decoration: underline;
}

label.field { display: block; margin: 0 0 16px; font-weight: 600; }
label.field span { display: block; margin-bottom: 8px; }

input[type="text"], input[type="email"], input[type="date"],
input[type="time"], input[type="number"], select, textarea {
  width: 100%; padding: 12px 16px; font: inherit;
  /* Entered values read at regular weight (app8.1): the
     label's semibold is for the label only — inherited 600
     used to render as 700, there is no 600 in the font set. */
  font-weight: 400;
  border: 1px solid #b9c8bd; border-radius: 8px; background: #fff; color: var(--ink);
  transition: border-color 0.15s ease;
}
/* Inputs stand as tall as buttons (52px) so a form reads as
   one instrument, not a pile of parts. */
input[type="text"], input[type="email"], input[type="date"],
input[type="time"], input[type="number"], select { height: 52px; }
input:focus, select:focus, textarea:focus { border-color: var(--green); }

textarea { min-height: 64px; resize: vertical; }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { padding: 8px 0; border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; }
.checklist label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.checklist input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--green); }

/* The chat is the group page's primary tool, so its section
   wears the card pattern; the box is 320px on phone, 380px
   on desktop — from here, never from an inline style. The
   DM box takes the same rule. */
.section.chat-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  margin: 0 0 32px;
}
.chat-box {
  border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; height: 380px; overflow-y: auto; background: #fff;
}
#chat-older { font-size: 15px; margin: 0 0 12px; }
.chat-msg { margin: 0 0 12px; overflow-wrap: anywhere; }
.chat-msg .who { font-weight: 700; color: var(--green-dark); font-size: 15px; display: inline-flex; align-items: center; gap: 8px; }
.chat-msg .who .avatar { width: 28px; height: 28px; font-size: 14px; }
.chat-msg .when { color: var(--muted); font-size: 14px; margin-left: 8px; }
.chat-msg.recap {
  background: #f6faf7; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px;
}
.chat-form { display: flex; gap: 8px; margin-top: 12px; }
.chat-form input { flex: 1; }

/* Sign-in/sign-up mode switch: ONE segmented control, the
   same width as the input under it — two equal halves, the
   active half filled. Auth forms cap at 440px on the frame's
   left axis. */
.tabs { display: flex; border: 2px solid var(--green); border-radius: 8px; overflow: hidden; margin: 16px 0 24px; }
.tabs button {
  flex: 1 1 0; font: inherit; font-weight: 600; min-height: 52px; padding: 12px 16px; cursor: pointer;
  background: #fff; color: var(--green); border: 0;
}
.tabs button.active { background: var(--green); color: #fff; }

.auth .tabs, .auth form, .auth .notice { max-width: 440px; }

.badge {
  display: inline-block; border: 1px solid var(--green); color: var(--green);
  border-radius: 8px; padding: 4px 8px; font-size: 14px; font-weight: 700;
}

.kids-row { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.kids-row input { width: 76px; flex: none; }

/* Member home outing card (app8.1): the fact lines carry a
   small semibold label with the value right after it on the
   same line; the run-by line keeps the host names and the
   background-check badge together on one line; the meet
   time never wraps away from its date. */
.fact strong { font-size: 15px; font-weight: 600; }
.run-by { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.run-by .badge { flex: none; font-size: 12px; }
.open-group { margin-top: 12px; }
.run-by .badge { flex: none; }
.nowrap { white-space: nowrap; }

/* Group page members (app8.1): every member row has the
   same geometry — head line (avatar, name, role chip), then
   ONE actions row (role select + small buttons, even
   height), then the quiet Report/Block text actions. */
.people-list li.member-row { display: block; }
.person .badge { margin-left: 8px; }
.member-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.member-actions select { width: auto; height: 44px; padding: 8px 12px; }
.member-quiet { display: flex; gap: 8px; margin-top: 8px; }

/* Groups page member card actions (app8.1): the host/member
   status is a plain text line; the two actions stack at
   card width, equal height, primary then secondary. */
.gc-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.gc-actions .button { width: 100%; }

.pod { border-top: 1px solid var(--line); padding: 12px 0; }
.pod:first-of-type { border-top: 0; }

.modal {
  position: fixed; inset: 0; background: rgba(20, 35, 27, 0.5);
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20;
}
.modal-card { background: #fff; border-radius: 16px; max-width: 480px; width: 100%; padding: 24px; }
.modal-card h3 { margin-top: 0; }

[hidden] { display: none !important; }

.weather-line {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6faf7;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--green-dark);
}

/* Group cards carry their facts in fixed slots — name, then
   day/time, then place, then the meta line, then the action —
   identical geometry on every card. */
.group-card p { margin: 0 0 8px; }
.group-card .gc-when { font-weight: 700; color: var(--green-dark); }

/* The signed-in home ("This Saturday") lives in the same
   reading column as every other content section. */
#app-home { max-width: 720px; }

/* Accessibility floor (NN/g + Apple HIG + WCAG 2.2): main
   buttons are 52px with a clear pressed state and a visible
   focus outline; every tappable target is at least 44px;
   long words in chat wrap instead of breaking the layout
   at 320px / 200% zoom. */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

.people-list .link-button,
.row-actions .link-button { min-height: 44px; padding: 8px; }

.send-error { display: flex; gap: 8px; align-items: center; margin-top: 8px; }

/* Hero photo (app8): photo-first, as ruled in app6. On phone
   it is capped in a 16:10 box so the headline and the outing
   card begin inside the first scroll; desktop keeps the
   app6 layout. */
.hero-photo { margin: 0 auto; max-width: 760px; }
.hero-photo img { width: 100%; height: auto; border-radius: 16px; display: block; }
.hero-photo figcaption { margin-top: 8px; }

/* Explainer films (app7/app7.1): click-to-play, poster only
   until then, NO <track> element ever (iOS blocks playback).
   The width/height attributes on <video> hold the 16:9 box,
   so the page never shifts when the poster or film loads.
   The transcript summary is a quiet caption line (app8,
   quieter still in app8.1), not a heading: 15px, muted,
   weight 500, small marker. */
.film { margin: 16px 0; max-width: 720px; }
.film video { width: 100%; height: auto; border-radius: 16px; display: block; background: #0b4a2e; }
.film-words { margin: 0 0 16px; max-width: 720px; }
.film-words summary { cursor: pointer; color: var(--muted); font-weight: 500; font-size: 15px; }
.film-words summary::marker { font-size: 12px; }
.film-words p { margin: 8px 0 0; }

/* Motion-lite (world-class pass): group cards lift a touch on
   hover; sections reveal once on scroll (the .reveal class is
   added by common.js only when motion is welcome and
   IntersectionObserver exists). Everything is off under
   prefers-reduced-motion — in the JS check and here. */
.group-card { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.group-card:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(11, 74, 46, 0.1); }

.reveal { opacity: 0; transform: translateY(10px); transition: opacity 0.3s ease, transform 0.3s ease; }
.reveal.revealed { opacity: 1; transform: none; }

@media (max-width: 640px) {
  .card { padding: 20px; }
  /* Kids row stacks (app8.1): the label takes its own line,
     then the number box and the helper sit side by side,
     vertically centred — no three-column squeeze. */
  .kids-row { flex-wrap: wrap; }
  .kids-row label { flex: 1 1 100%; }
  .kids-row .small { flex: 1 1 0; min-width: 0; }
  .section.chat-card { padding: 20px; margin: 0 0 24px; }
  .chat-box { height: 320px; }
  .row-actions { flex-direction: column; }
  .row-actions .button { width: 100%; }
  .hero-photo img { aspect-ratio: 16 / 10; object-fit: cover; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .group-card { transition: none; }
  .group-card:hover { transform: none; box-shadow: none; }
  .button, .skip-link { transition: none; }
}
