/* Plain pages outside the game (templates/base_page.html): the profile, the legal pages,
   contact. The landing's header and footer; ReziDay's profile/legal layout in Remi's tokens. */
.pg { min-height: 100dvh; display: flex; flex-direction: column; background: var(--canvas); color: var(--ink); }
.pg a:not(.btn) { color: var(--teal); font-weight: 600; text-decoration: none; }
.pg a:not(.btn):hover { color: var(--teal-hover); }

.pg-main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: clamp(32px, 6vw, 64px) 16px clamp(48px, 8vw, 88px); }

/* ---- Forms shared with the auth pages ---- */
.field-error { font-size: 13px; color: var(--coral-deep); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--coral); }
.auth-error { background: #FDECE7; border: 1px solid #F6C9BC; color: var(--coral-deep); border-radius: var(--r-xs); padding: 10px 12px; font-size: 13.5px; }
.is-busy { opacity: .7; pointer-events: none; }

/* ---- Legal ---- */
.legal { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 30px; }
.legal-head { display: flex; flex-direction: column; gap: 10px; }
.legal-head h1 { font-family: var(--font-serif); font-weight: 600; font-size: clamp(32px, 5vw, 46px); line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
.legal-head p { margin: 0; }
.legal-summary { display: flex; gap: 18px; align-items: flex-start; padding: 20px 22px; background: var(--teal-tint-2); border-color: var(--teal-border-2); }
.legal-summary .sticker { width: 48px; height: 48px; }
.legal-summary-title { font-weight: 700; margin-bottom: 4px; }
.legal-summary-body { color: var(--body-c); line-height: 1.6; }
.legal-sections { display: flex; flex-direction: column; gap: 26px; }
.legal-sections h2 { font-family: var(--font-serif); font-weight: 600; font-size: 21px; margin: 0 0 8px; }
.legal-sections p { margin: 0 0 10px; line-height: 1.68; color: var(--body-c); }

/* ---- Contact ---- */
.contact { display: flex; flex-direction: column; gap: 28px; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.contact-card { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.contact-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-card .input, .contact-card .textarea { width: 100%; font-size: 16px; }
.contact-card .textarea { min-height: 150px; }
.contact-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.contact-topics { display: flex; flex-wrap: wrap; gap: 8px; }
.contact-topic { cursor: pointer; }
.contact-topic input { position: absolute; opacity: 0; pointer-events: none; }
.contact-topic span { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: var(--r-pill);
                      border: 1.5px solid var(--border-2); background: var(--card); font-size: 13.5px; font-weight: 600; }
.contact-topic input:checked + span { border-color: var(--teal); background: var(--teal-tint); color: var(--teal-ink); }
.contact-topic input:focus-visible + span { box-shadow: 0 0 0 3px rgba(14, 124, 123, .25); }
.contact-submit { align-self: flex-start; }
.contact-sent { align-items: flex-start; }
.contact-sent h2 { font-family: var(--font-serif); margin: 0; }
.contact-sent p { margin: 0; }
.contact-side { display: flex; flex-direction: column; gap: 14px; }
.contact-tip { padding: 18px 20px; }
.contact-tip h3 { margin: 0 0 6px; font-size: 15px; }
.contact-tip p { margin: 0; line-height: 1.55; font-size: 14px; }

/* ---- Profile ---- */
.prof { display: flex; flex-direction: column; gap: 20px; }
.prof-flash { display: none; }   /* shown as a toast by profil.js */
.prof-hero { display: flex; align-items: center; gap: 20px; padding: 24px; flex-wrap: wrap; }
.prof-avatar-btn { position: relative; border-radius: 50%; padding: 0; }
.prof-avatar-btn:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.prof-avatar-cam { position: absolute; right: -2px; bottom: -2px; width: 30px; height: 30px; border-radius: 50%;
                   background: var(--card); border: 1.5px solid var(--border-2); display: grid; place-items: center; color: var(--ink); }
.prof-id { flex: 1; min-width: 180px; }
.prof-name { font-family: var(--font-serif); font-weight: 600; font-size: clamp(26px, 3.4vw, 34px); margin: 0; line-height: 1.15; overflow-wrap: anywhere; }
.prof-meta { margin-top: 4px; font-size: 14px; }
.prof-edit { gap: 8px; }
.prof-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.prof-section { padding: 8px 0; overflow: hidden; }
.prof-h2 { font-family: var(--font-serif); font-weight: 600; font-size: 20px; margin: 12px 22px 6px; }
.prof-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 22px; text-align: left;
            border-top: 1px solid var(--divider); color: var(--ink) !important; font-weight: 400 !important; }
button.prof-row:hover, a.prof-row:hover { background: var(--surface-3); }
.prof-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.prof-row-title { font-weight: 600; font-size: 14.5px; }
.prof-row-title--danger { color: var(--coral-deep); }
.prof-row-sub { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.prof-chev { color: var(--muted-3); flex: none; }

/* ---- Dialogs (native <dialog>, profil.js) ---- */
.pm { border: 0; padding: 0; border-radius: var(--r-lg); background: var(--card); color: var(--ink);
      width: min(460px, calc(100vw - 32px)); box-shadow: var(--shadow-sheet); }
.pm::backdrop { background: rgba(15, 34, 48, .45); }
.pm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 22px 6px; }
.pm-title { font-family: var(--font-serif); font-weight: 600; font-size: 21px; margin: 0; }
.pm-sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.pm-x { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); flex: none; }
.pm-x:hover { background: var(--surface-3); color: var(--ink); }
.pm-body { padding: 12px 22px; display: flex; flex-direction: column; gap: 12px; line-height: 1.55; }
.pm-body p { margin: 0; }
.pm-body .input { width: 100%; font-size: 16px; }
.pm-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 22px 22px; }
.pm-photo { align-items: center; text-align: center; }
.pm-photo-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.prof-upload { cursor: pointer; }
.prof-presets { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; padding-bottom: 10px; }
.prof-preset { width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
               background: var(--c, var(--surface)); color: #fff; font-size: 13px; font-weight: 700; overflow: hidden;
               box-shadow: 0 0 0 2px var(--card), 0 0 0 3px transparent; }
.prof-preset .avatar { width: 100%; height: 100%; }
.prof-preset.is-on { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--teal); }

@media (max-width: 760px) {
  .prof-body, .contact-grid { grid-template-columns: 1fr; }
  .contact-row { grid-template-columns: 1fr; }
  .prof-hero { padding: 20px; }
  .prof-edit { width: 100%; }
}
@media (max-width: 560px) {
  /* the phone: a dialog becomes a bottom sheet */
  .pm { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: var(--r-lg) var(--r-lg) 0 0; padding-bottom: env(safe-area-inset-bottom); }
}
