/* ============================================================
   Peso Cash Loan — shared styles for legal pages
   (privacy policy + terms & conditions, EN + FIL)
   Depends on styles.css for design tokens.
   ============================================================ */

body { background: var(--bg-warm); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* ---- legal nav ---- */
.legal-nav-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; color: var(--green-700); }
.back-link svg { width: 18px; height: 18px; }
.back-link:hover { color: var(--green); }

/* ---- hero ---- */
.legal-hero { background: linear-gradient(140deg, var(--green-deep), var(--green-ink)); color: #fff; padding: 64px 0 56px; position: relative; overflow: hidden; }
.legal-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(620px 360px at 88% -10%, rgba(6,184,92,.28), transparent 60%); }
.legal-hero .wrap { position: relative; z-index: 1; }
.legal-hero .eyebrow { color: var(--green); }
.legal-hero h1 { color: #fff; font-size: clamp(34px, 5vw, 52px); margin: 16px 0 22px; }
.legal-meta { display: flex; flex-wrap: wrap; gap: 12px; }
.legal-meta .lm { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: 12px; padding: 11px 16px; font-size: 13.5px; }
.legal-meta .lm strong { display: block; color: var(--green); font-family: var(--font-display); font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.legal-meta .lm span { color: rgba(255,255,255,.85); }

/* ---- layout + table of contents ---- */
.legal-layout { display: grid; grid-template-columns: 250px 1fr; gap: 56px; align-items: start; padding: 64px 0 90px; }
.legal-toc { position: sticky; top: 96px; }
.legal-toc h4 { font-family: var(--font-body); font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.legal-toc ol { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.legal-toc a { display: flex; gap: 10px; padding: 8px 12px; border-radius: 9px; font-size: 14px; color: var(--ink-2); font-weight: 500; line-height: 1.35; transition: background .15s, color .15s; }
.legal-toc a:hover { background: var(--mint-50); color: var(--green-700); }
.legal-toc a.active { background: var(--mint-100); color: var(--green-700); font-weight: 700; }
.legal-toc a .n { color: var(--green-700); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- body + sections ---- */
.legal-body { max-width: 760px; min-width: 0; }
.legal-intro { font-size: 17px; color: var(--ink-2); margin-bottom: 14px; overflow-wrap: break-word; }
.legal-intro:last-of-type { margin-bottom: 8px; }
.legal-section { padding-top: 40px; scroll-margin-top: 92px; }
.legal-section:first-of-type { padding-top: 8px; }
.legal-section > h2 { font-size: 25px; margin-bottom: 18px; display: flex; gap: 12px; align-items: baseline; }
.legal-section > h2 .n { color: var(--green); font-size: 19px; font-weight: 800; flex: none; }
.legal-section h3 { font-size: 18px; margin: 26px 0 12px; color: var(--green-ink); }
.legal-section p { font-size: 16px; color: var(--ink-2); margin-bottom: 14px; overflow-wrap: break-word; }
.legal-section ul { list-style: none; display: flex; flex-direction: column; gap: 11px; margin: 4px 0 16px; }
.legal-section ul li { position: relative; padding-left: 28px; font-size: 15.5px; color: var(--ink-2); }
.legal-section ul li::before { content: ""; position: absolute; left: 6px; top: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.legal-section ul li strong { color: var(--green-ink); }
.legal-section li { overflow-wrap: break-word; }
/* long URLs / emails must break inside narrow in-app webviews */
.legal-section a, .contact-card .cc-v, .legal-meta .lm span { overflow-wrap: anywhere; word-break: break-word; }
.legal-divider { height: 1px; background: var(--line); margin-top: 40px; }

/* ---- callout ---- */
.callout { background: var(--mint-50); border: 1px solid var(--mint-200); border-radius: var(--radius); padding: 20px 22px; margin: 18px 0; display: flex; gap: 14px; }
.callout.warn { background: #fff6e6; border-color: #f0d28a; }
.callout svg { width: 22px; height: 22px; color: var(--green-700); flex: none; margin-top: 1px; }
.callout.warn svg { color: #c98a00; }
.callout p { margin: 0; font-size: 15px; color: var(--green-ink); }
.callout.warn p { color: #7a5800; }

/* ---- terms stat grid (terms pages only) ---- */
.terms-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0 16px; }
.terms-grid .tg { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.terms-grid .tg .tg-k { font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.terms-grid .tg .tg-v { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--green-ink); letter-spacing: -.01em; }
.terms-grid .tg .tg-v small { font-size: 13px; color: var(--muted); font-weight: 600; }

/* ---- contact card ---- */
.contact-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; box-shadow: var(--shadow-sm); display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; margin-top: 6px; }
.contact-card .cc-row { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.contact-card .cc-k { font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.contact-card .cc-v { font-size: 15.5px; color: var(--ink); font-weight: 600; }

/* ---- placeholder pill for fields awaiting real data ---- */
.ph { background: #fff6e6; border-bottom: 2px dotted #e0a92e; color: #9a6a00; font-weight: 600; padding: 0 5px; border-radius: 4px; }

@media (max-width: 920px) {
  .legal-layout { grid-template-columns: 1fr; gap: 0; }
  .legal-toc { display: none; }
  .contact-card, .terms-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .legal-hero { padding: 44px 0 38px; }
  .legal-layout { padding: 40px 0 64px; }
  .legal-section { padding-top: 32px; }
  .legal-section > h2 { font-size: 22px; }
  .legal-section p, .legal-intro { font-size: 15.5px; }
  .legal-meta .lm { flex: 1 1 100%; }
}
