/* ==========================================================================
   SunTeam v2 — Public content pages
   (about, terms, contact, faq, plan, disclosure, forms, SunMag/news, errors)
   ========================================================================== */

/* ---------- page hero ---------- */
.page-hero { position: relative; padding: 18px 0 30px; overflow: hidden; }
.page-hero .hero-bg { z-index: -1; }
.page-hero-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.page-hero h1 { font-size: clamp(1.3rem, 1.05rem + 1vw, 1.7rem); font-weight: 900; line-height: 1.3; }
.page-hero .lead { margin-top: 10px; max-width: 640px; }
.page-hero .eyebrow { margin-bottom: 14px; }

/* ---------- content layout ---------- */
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.content-card { padding: clamp(22px, 4vw, 44px); }
.side-stack { position: sticky; top: 104px; display: flex; flex-direction: column; gap: 14px; }
.side-card { padding: 20px; }
.side-card h3 { font-size: var(--fs-md); font-weight: 800; margin-bottom: 12px; }
.side-links { display: flex; flex-direction: column; gap: 4px; }
.side-links a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); transition: background .2s, color .2s; }
.side-links a:hover, .side-links a.is-active { background: var(--surface-2); color: var(--text); }
.side-links a.is-active { box-shadow: inset 3px 0 0 var(--sun-500); }
.side-links .ic { color: var(--accent-ink); }
@media (max-width: 1020px) {
  .content-grid { grid-template-columns: 1fr; }
  .side-stack { position: static; }
}

/* ---------- rich text (CMS html + legacy bootstrap content) ---------- */
.rich { color: var(--text-2); line-height: 2.1; font-size: var(--fs-md); overflow-wrap: anywhere; }
.rich > *:first-child { margin-top: 0; }
.rich h1, .rich h2, .rich h3, .rich h4, .rich h5, .rich h6 { color: var(--text); font-weight: 800; line-height: 1.6; margin: 28px 0 12px; }
.rich h2 { font-size: var(--fs-2xl); }
.rich h3 { font-size: var(--fs-xl); }
.rich h4, .rich h5 { font-size: var(--fs-lg); }
.rich h6 { font-size: var(--fs-md); }
.rich p { margin: 0 0 14px; }
.rich a:not(.btn) { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.rich ul, .rich ol { margin: 0 0 14px; padding-inline-start: 22px; list-style: disc; }
.rich ol { list-style: decimal; }
.rich li { margin-bottom: 6px; }
.rich img { max-width: 100%; height: auto; border-radius: var(--r-md); margin: 14px auto; }
.rich blockquote { margin: 16px 0; padding: 14px 18px; border-inline-start: 4px solid var(--sun-400); background: var(--surface-2); border-radius: var(--r-sm); color: var(--text); }
.rich hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.rich * { font-family: var(--font) !important; }
.rich [style*="font-size"] { font-size: inherit !important; }

/* tables (legacy .table / .profile_data / .table-modern) */
.rich table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 14px 0 22px; font-size: var(--fs-sm); border-radius: var(--r-md); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.rich th { background: var(--ink-900); color: #fff; font-weight: 700; padding: 12px 14px; text-align: center; border: 0 !important; white-space: nowrap; }
.rich td { padding: 12px 14px; border: 0 !important; border-bottom: 1px solid var(--line) !important; text-align: center; vertical-align: middle; background: var(--surface); }
.rich tbody tr:nth-child(even) td { background: var(--surface-2); }
.rich tr:last-child td { border-bottom: 0 !important; }
.rich .table-responsive, .rich table.table-responsive { display: table; }
.rich-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-inline: -4px; padding-inline: 4px; }
[data-theme="dark"] .rich th { background: var(--sun-400); color: var(--ink-900); }

/* bootstrap 4/5 bits used inside legacy content */
.rich .row { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 20px; }
.rich .row > [class*="col"] { flex: 1 1 260px; min-width: 0; padding: 0; max-width: none; }
.rich .row.g-4 > [class*="col-md-6"], .rich .row.g-4 > [class*="col-lg-4"] { flex: 1 1 280px; }
.rich .card { background: var(--surface); border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; margin-bottom: 18px; border: 0 !important; height: auto; }
.rich .card-header { padding: 14px 18px; font-weight: 800; background: var(--surface-2) !important; color: var(--text) !important; border-bottom: 1px solid var(--line); }
.rich .card-header.bg-danger { background: var(--rose-soft) !important; color: var(--rose) !important; }
.rich .card-header.bg-primary { background: var(--ink-900) !important; color: #fff !important; }
.rich .card-body { padding: 18px; }
.rich .card-title { color: var(--text); font-weight: 800; margin: 0 0 8px; font-size: var(--fs-lg); }
.rich .card-text { margin: 0; color: var(--text-2); font-size: var(--fs-sm); line-height: 2; }
.rich .bg-light, .rich .bg-white { background: var(--surface-2) !important; }
.rich .badge { display: inline-flex; align-items: center; padding: 6px 14px !important; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 800; }
.rich .badge.bg-warning { background: var(--sun-400) !important; color: var(--ink-900) !important; }
.rich .badge.bg-primary { background: var(--ink-900) !important; color: #fff !important; }
.rich .alert { padding: 14px 18px; border-radius: var(--r-md); border: 0; font-weight: 700; margin: 12px 0; }
.rich .alert-success { background: var(--mint-soft); color: var(--mint); }
.rich .alert-info, .rich .alert-primary { background: var(--sky-soft); color: var(--sky); }
.rich .alert-warning { background: var(--amber-soft); color: var(--accent-ink); }
.rich .alert-danger { background: var(--rose-soft); color: var(--rose); }
.rich .text-primary, .rich .text-secondary, .rich .text-dark { color: var(--text) !important; }
.rich .text-success { color: var(--mint) !important; }
.rich .text-danger { color: var(--rose) !important; }
.rich .text-muted { color: var(--text-3) !important; }
.rich .text-center { text-align: center; }
.rich .fw-bold, .rich b, .rich strong { font-weight: 800; color: var(--text); }
.rich .small, .rich small { font-size: 85%; }
.rich .border-bottom { border-bottom: 1px solid var(--line) !important; padding-bottom: 10px; }
.rich .border-top { border-top: 1px solid var(--line) !important; }
.rich .list-unstyled { list-style: none; padding: 0; }
.rich .bi { display: none; }
.rich .btn { display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 26px; border-radius: var(--r-pill); font-weight: 800; text-decoration: none; border: 0; }
.rich .btn-primary { background: var(--ink-900); color: #fff !important; }
.rich .btn-primary:hover { background: var(--sun-400); color: var(--ink-900) !important; }
.rich .plan-title { display: inline-block; font-size: var(--fs-2xl); padding-bottom: 10px; border-bottom: 4px solid var(--sun-400); }
.rich .term-card { transition: transform .25s var(--ease), box-shadow .25s; }
.rich .term-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2), inset 0 0 0 1px var(--line); }
.rich .term-card .card-title { color: var(--accent-ink); }
.rich .calc-box { direction: ltr; text-align: left; font-family: ui-monospace, Consolas, monospace !important; font-weight: 700; background: var(--ink-900); color: var(--sun-300); padding: 14px 18px; border-radius: var(--r-md); margin: 10px 0; }
.rich .rank-badge { display: inline-block; padding: 6px 14px; border-radius: var(--r-pill); background: linear-gradient(135deg, var(--sun-300), var(--sun-500)); color: var(--ink-900); font-weight: 900; font-size: var(--fs-xs); white-space: nowrap; }
.rich .mb-5 { margin-bottom: 32px !important; }
.rich .mt-5 { margin-top: 32px !important; }
.rich .pt-4 { padding-top: 24px !important; }

/* ---------- contact ---------- */
.contact-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.contact-card { display: flex; gap: 14px; padding: 20px; align-items: flex-start; }
.contact-card .kpi-ico { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; flex: none; background: var(--amber-soft); color: var(--accent-ink); }
.contact-card b { display: block; margin-bottom: 4px; }
.contact-card p, .contact-card a { font-size: var(--fs-sm); color: var(--text-2); line-height: 1.9; }
.contact-card a:hover { color: var(--accent-ink); }
.map-frame { border-radius: var(--r-xl); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); background: var(--surface-sunk); }
.map-frame iframe { display: block; width: 100%; height: 100%; min-height: 360px; border: 0; filter: saturate(.9); }
.contact-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: stretch; }
@media (max-width: 960px) { .contact-grid, .contact-cards { grid-template-columns: 1fr; } }

/* ---------- forms ---------- */
.form-card { padding: clamp(20px, 3vw, 32px); }
.form-card .h-3 { margin-bottom: 6px; }
.form-card .form-grid { margin-top: 18px; }
.form-card textarea.input { min-height: 140px; height: auto; padding-block: 12px; line-height: 1.9; resize: vertical; }
.form-card select.input { appearance: auto; }
.form-card .btn-lg { width: 100%; margin-top: 6px; }
.note-card { display: flex; gap: 12px; padding: 18px; border-radius: var(--r-lg); background: var(--surface-sunk); color: var(--text-2); font-size: var(--fs-sm); line-height: 2; }
.note-card .ic { color: var(--sky); flex: none; margin-top: 4px; }
.steps-v { display: flex; flex-direction: column; gap: 0; counter-reset: s; }
.steps-v li { position: relative; padding: 0 44px 18px 0; font-size: var(--fs-sm); color: var(--text-2); line-height: 1.9; counter-increment: s; }
.steps-v li::before { content: counter(s); position: absolute; inset-inline-start: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--sun-400); color: var(--ink-900); font-weight: 900; font-size: var(--fs-xs); }
.steps-v li::after { content: ""; position: absolute; inset-inline-start: 14px; top: 34px; bottom: 4px; width: 2px; background: var(--line-strong); }
.steps-v li:last-child::after { display: none; }
.steps-v b { color: var(--text); display: block; }
.result-card { text-align: center; padding: 32px 22px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.result-card .code { font-size: var(--fs-3xl); font-weight: 900; letter-spacing: 0; direction: ltr; color: var(--text); background: var(--amber-soft); padding: 8px 22px; border-radius: var(--r-md); }

/* ---------- faq ---------- */
.faq-search { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 18px; border-radius: var(--r-pill); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong), var(--sh-2); max-width: 560px; }
.faq-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: var(--fs-lg); }
.faq-search .ic { color: var(--text-3); }
.faq-section { scroll-margin-top: 110px; margin-bottom: 30px; }
.faq-section h2 { font-size: var(--fs-xl); font-weight: 800; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.faq-section h2 .ic { color: var(--accent-ink); }
.faq-item { border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 10px; transition: box-shadow .2s; }
.faq-item[open] { box-shadow: inset 0 0 0 1.5px var(--sun-500), var(--sh-2); }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; cursor: pointer; list-style: none; font-weight: 700; line-height: 1.8; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .pm { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface-sunk); transition: transform .25s var(--ease), background .2s; }
.faq-item[open] summary .pm { transform: rotate(45deg); background: var(--sun-400); color: var(--ink-900); }
.faq-item .faq-a { padding: 0 20px 20px; color: var(--text-2); line-height: 2.1; font-size: var(--fs-sm); }
.faq-empty { padding: 28px; text-align: center; color: var(--text-3); }

/* ---------- SunMag / news ---------- */
.blog-feature { display: grid; grid-template-columns: 1.3fr 1fr; gap: 0; border-radius: var(--r-xl); overflow: hidden; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 28px; transition: box-shadow .3s; }
.blog-feature:hover { box-shadow: var(--sh-3), inset 0 0 0 1px var(--line); }
.blog-feature .a-media { aspect-ratio: auto; min-height: 320px; }
.blog-feature .a-body { padding: clamp(22px, 3vw, 40px); justify-content: center; gap: 14px; }
.blog-feature .a-title { font-size: clamp(1.1rem, 1rem + .5vw, 1.35rem); line-height: 1.6; }
@media (max-width: 860px) { .blog-feature { grid-template-columns: 1fr; } .blog-feature .a-media { min-height: 220px; } }
.a-lock { display: inline-flex; align-items: center; gap: 4px; }

.article { max-width: 780px; }
.article-head h1 { font-size: clamp(1.25rem, 1.05rem + .8vw, 1.55rem); font-weight: 900; line-height: 1.5; }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: var(--fs-sm); color: var(--text-3); font-weight: 600; }
.article-meta span { display: inline-flex; align-items: center; gap: 6px; }
.article-cover { margin: 26px 0; border-radius: var(--r-xl); overflow: hidden; background: var(--surface-sunk); box-shadow: inset 0 0 0 1px var(--line); }
.article-cover img { width: 100%; height: auto; }
.article .rich { font-size: var(--fs-lg); line-height: 2.2; }
.locked { position: relative; padding: 28px; border-radius: var(--r-xl); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 18px; }
.locked .empty-ico { width: 64px; height: 64px; }
.share-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); font-size: var(--fs-sm); font-weight: 700; color: var(--text-2); }
.recent-list { display: flex; flex-direction: column; }
.recent-list a { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); font-weight: 700; line-height: 1.8; color: var(--text); }
.recent-list a:last-child { border-bottom: 0; }
.recent-list a:hover { color: var(--accent-ink); }
.recent-list span { font-size: var(--fs-xs); color: var(--text-3); font-weight: 600; }

/* ---------- best sellers ---------- */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.person { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 12px 18px; border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); text-align: center; transition: transform .25s var(--ease), box-shadow .25s; }
.person:hover { transform: translateY(-3px); box-shadow: var(--sh-2), inset 0 0 0 1px var(--line); }
.person .avatar { width: 84px; height: 84px; font-size: var(--fs-xl); }
.person b { font-size: var(--fs-sm); line-height: 1.7; }
.person .rank-no { position: absolute; top: 10px; inset-inline-start: 10px; min-width: 30px; height: 30px; padding: 0 8px; border-radius: var(--r-pill); display: grid; place-items: center; background: var(--surface-sunk); font-size: var(--fs-xs); font-weight: 900; color: var(--text-2); }
.person.top .rank-no { background: var(--sun-400); color: var(--ink-900); }
.person.top .avatar { box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--sun-400); }

/* ---------- error pages ---------- */
.error-page { position: relative; isolation: isolate; overflow: hidden; min-height: 62vh; display: grid; place-items: center; text-align: center; padding: 40px 0; }
.error-code { font-size: clamp(5rem, 3rem + 10vw, 10rem); font-weight: 900; line-height: 1; background: linear-gradient(180deg, var(--sun-300), var(--sun-600)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-page .lead { margin: 10px auto 24px; max-width: 520px; }
