/* ============================================================
   HLA — Page components: forms, FAQ, perks, portal, admin
   Loaded after styles.css on inner pages.
   ============================================================ */

/* Compact page hero */
.page-hero { padding-block: clamp(2.25rem, 6vw, 4.5rem) clamp(1.5rem, 4vw, 3rem); }
.page-hero .eyebrow { margin-bottom: 1.1rem; }
.page-hero h1 { font-size: clamp(2.3rem, 5vw, 4rem); max-width: 16ch; }
.page-hero .lede { margin-top: 1.2rem; max-width: 54ch; }
.page-hero__grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }

/* Perks (gold-tinted variant of trust) */
.perks { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1rem, 2.5vw, 1.6rem); }
.perk { display: flex; gap: 1rem; padding: clamp(1.4rem, 2.5vw, 1.9rem); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); align-items: flex-start; }
.perk__ic { width: 46px; height: 46px; flex: none; border-radius: 12px; background: var(--gold-soft); color: oklch(40% 0.08 70); display: grid; place-items: center; }
.perk__ic svg { width: 24px; height: 24px; }
.perk h4 { font-family: var(--sans); font-size: var(--t-base); font-weight: 600; color: var(--ink); margin-bottom: 0.3rem; }
.perk p { font-size: var(--t-sm); color: var(--ink-soft); }

/* Forms */
.form-wrap { max-width: 720px; margin-inline: auto; }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1.5rem, 4vw, 2.75rem); box-shadow: var(--shadow-md); }
.form-card .form-head { margin-bottom: 1.75rem; }
.form-card .form-head h3 { font-size: var(--t-2xl); margin-bottom: 0.5rem; }
.form-card .form-head p { color: var(--ink-soft); font-size: var(--t-sm); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-foot { margin-top: 0.5rem; }
.form-foot .fineprint { font-size: var(--t-sm); color: var(--muted); margin-top: 1rem; display: flex; gap: 0.5rem; align-items: flex-start; }
.form-foot .fineprint svg { width: 16px; height: 16px; color: var(--green); flex: none; margin-top: 2px; }
.form-success { text-align: center; padding: clamp(1.5rem, 4vw, 2.5rem) 0.5rem; display: none; }
.form-success.show { display: block; animation: pop .5s var(--ease); }
.form-success__ic { width: 64px; height: 64px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; margin: 0 auto 1.25rem; }
.form-success__ic svg { width: 32px; height: 32px; }
.form-success h3 { margin-bottom: 0.6rem; }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .form-success.show { animation: none; } }

/* FAQ via <details> */
.faq { max-width: 760px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 1.25rem 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-family: var(--serif); font-size: var(--t-lg); color: var(--ink); font-weight: 480; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; transition: transform .3s var(--ease), background-color .2s var(--ease); position: relative; }
.faq summary .ic::before, .faq summary .ic::after { content: ""; position: absolute; background: var(--ink); }
.faq summary .ic::before { width: 11px; height: 1.7px; } .faq summary .ic::after { width: 1.7px; height: 11px; transition: transform .3s var(--ease); }
.faq details[open] summary .ic::after { transform: scaleY(0); }
.faq details[open] summary .ic { background: var(--paper-2); }
.faq .faq__body { padding-bottom: 1.3rem; color: var(--ink-soft); max-width: 68ch; }
@media (prefers-reduced-motion: reduce) { .faq summary .ic, .faq summary .ic::after { transition: none; } }

/* ============================================================
   Members Portal
   ============================================================ */
.portal__grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(1.5rem, 3vw, 2.5rem); align-items: start; }

.chat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden; display: flex; flex-direction: column; min-height: 520px; }
.chat__head { display: flex; align-items: center; gap: 0.8rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); background: var(--paper); }
.chat__avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--gold); display: grid; place-items: center; flex: none; }
.chat__avatar svg { width: 22px; height: 22px; }
.chat__head h3 { font-family: var(--sans); font-size: var(--t-base); font-weight: 600; }
.chat__head .status { font-size: var(--t-sm); color: var(--green); display: flex; align-items: center; gap: 0.4rem; }
.chat__head .status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.chat__log { flex: 1; padding: 1.5rem 1.25rem; display: flex; flex-direction: column; gap: 0.85rem; overflow-y: auto; max-height: 460px; }
.msg { max-width: 80%; padding: 0.8rem 1.05rem; border-radius: 16px; font-size: var(--t-base); line-height: 1.45; animation: msgIn .35s var(--ease); }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .msg { animation: none; } }
.msg--bot { align-self: flex-start; background: var(--paper-2); color: var(--ink); border-bottom-left-radius: 5px; }
.msg--user { align-self: flex-end; background: var(--ink); color: var(--paper); border-bottom-right-radius: 5px; }
.chat__quick { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0 1.25rem 0.5rem; }
.chat__input { display: flex; gap: 0.6rem; padding: 1rem 1.25rem; border-top: 1px solid var(--line); background: var(--paper); }
.chat__input input { flex: 1; padding: 0.75em 1em; border: 1.5px solid var(--line-strong); border-radius: 100px; background: var(--surface); font-size: var(--t-base); }
.chat__input input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.chat__send { width: 46px; height: 46px; flex: none; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; transition: background-color .2s var(--ease), transform .2s var(--ease); }
.chat__send:hover { background: oklch(24% 0.045 256); transform: translateY(-1px); }
.chat__send svg { width: 20px; height: 20px; }

.dash { display: flex; flex-direction: column; gap: 1.25rem; }
.dash__total { background: var(--ink-invert); color: oklch(92% 0.02 84); border-radius: var(--radius-lg); padding: clamp(1.5rem, 3vw, 2.1rem); }
.dash__total .eyebrow { color: var(--gold); }
.dash__big { font-family: var(--serif); font-size: clamp(3rem, 7vw, 4.5rem); line-height: 1; color: oklch(96% 0.012 84); margin: 0.6rem 0 0.2rem; letter-spacing: -0.02em; }
.dash__big span { font-size: 0.4em; color: var(--gold); margin-left: 0.3rem; }
.dash__sub { font-size: var(--t-sm); color: oklch(72% 0.02 84); }
.dash__sessions { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1.25rem, 2.5vw, 1.75rem); }
.dash__sessions h4 { font-family: var(--sans); font-size: var(--t-sm); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 1rem; }
.session { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.session:last-child { border-bottom: none; }
.session__main { font-weight: 600; color: var(--ink); }
.session__meta { font-size: var(--t-sm); color: var(--muted); }
.session__hrs { font-family: var(--serif); color: var(--gold-ink); white-space: nowrap; }
.dash__empty { color: var(--muted); font-size: var(--t-sm); text-align: center; padding: 1.5rem 0; }

/* ============================================================
   Admin
   ============================================================ */
.admin-lock { max-width: 460px; margin: clamp(2rem, 8vw, 6rem) auto; }
.admin-lock .form-card { text-align: left; }
.admin-shell { display: none; }
.admin-shell.show { display: block; }
.admin-bar { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; padding: 1rem 0 1.5rem; border-bottom: 1px solid var(--line); margin-bottom: 2rem; }
.admin-bar .status-chip { font-size: var(--t-sm); padding: 0.35em 0.85em; border-radius: 100px; background: var(--green-soft); color: var(--green); font-weight: 500; }
.admin-bar .status-chip.local { background: var(--gold-soft); color: oklch(40% 0.08 70); }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 2rem; }
.admin-tab { padding: 0.55em 1.1em; border-radius: 100px; font-size: var(--t-sm); font-weight: 500; color: var(--ink-soft); border: 1px solid var(--line); transition: all .2s var(--ease); }
.admin-tab:hover { border-color: var(--line-strong); }
.admin-tab.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.admin-panel { display: none; }
.admin-panel.active { display: block; animation: msgIn .3s var(--ease); }
.admin-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); margin-bottom: 1.5rem; }
.admin-section > h3 { font-size: var(--t-xl); margin-bottom: 0.35rem; }
.admin-section > .desc { font-size: var(--t-sm); color: var(--muted); margin-bottom: 1.5rem; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 0; }
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; background: var(--line-strong); border-radius: 100px; transition: background-color .25s var(--ease); }
.switch .track::before { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: transform .25s var(--ease); box-shadow: var(--shadow-sm); }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::before { transform: translateX(20px); }
.admin-save-bar { position: sticky; bottom: 0; background: oklch(97.6% 0.011 84 / 0.92); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 1rem 0; margin-top: 2rem; display: flex; gap: 1rem; align-items: center; justify-content: flex-end; }
.admin-save-bar .saved-flash { color: var(--green); font-size: var(--t-sm); font-weight: 600; opacity: 0; transition: opacity .3s var(--ease); }
.admin-save-bar .saved-flash.show { opacity: 1; }
.data-table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.data-table th { text-align: left; font-weight: 600; color: var(--muted); padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line-strong); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.75rem; }
.data-table td { padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--line); color: var(--ink-soft); vertical-align: top; }
.data-table tr:hover td { background: var(--paper-2); }
.data-empty { text-align: center; color: var(--muted); padding: 2.5rem 0; }
.table-scroll { overflow-x: auto; }

@media (max-width: 880px) {
  .page-hero__grid { grid-template-columns: 1fr; gap: 2rem; }
  .perks { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .portal__grid { grid-template-columns: 1fr; }
}

/* Send failure: shown only when a submission did not reach the backend. */
.send-error {
  margin-top: 1rem;
  font-size: var(--t-sm);
  color: oklch(50% 0.18 25);
  background: oklch(96% 0.03 25);
  border: 1px solid oklch(88% 0.06 25);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}
