/* Sunshree Suntec CHS – site styles
   Palette: register-ink navy text on cool paper, stamp blue for the society's own marks,
   brick red for money owed, ledger green for credits. */

:root {
  --paper: #F4F6F7;
  --surface: #FFFFFF;
  --ink: #1C2A35;
  --muted: #5A6973;
  --line: #D3DADF;
  --stamp: #2D3E9A;
  --stamp-soft: #E6E9F6;
  --due: #9A2B2B;
  --credit: #2B6A45;
  --warn-bg: #FFF4D6;
  --warn-ink: #6B4E00;
  --radius: 6px;
  --font: "Public Sans", "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12181D;
    --surface: #1A2228;
    --ink: #E3E8EB;
    --muted: #9AA7B0;
    --line: #2E3A42;
    --stamp: #9EABF2;
    --stamp-soft: #222B4A;
    --due: #F09A9A;
    --credit: #8ED3A6;
    --warn-bg: #3A3110;
    --warn-ink: #F3D98A;
    color-scheme: dark;
  }
  .hero-seal, .brand img { filter: brightness(1.9) saturate(.8); }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}
img { max-width: 100%; height: auto; }
a { color: var(--stamp); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--stamp); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem); font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; max-width: 72ch; }

.wrap { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.narrow { width: min(760px, 100% - 2rem); }
.page { padding-block: 2.5rem 3.5rem; }
.muted { color: var(--muted); }
.lede { font-size: 1.1rem; color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: .5rem; background: var(--surface); padding: .5rem 1rem; z-index: 50; }
.skip-link:focus { left: .5rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.05rem; }
.brand-text span { font-size: .8rem; color: var(--muted); }
.site-nav { display: flex; flex-wrap: wrap; gap: .25rem; }
.site-nav a {
  text-decoration: none; color: var(--ink);
  padding: .45rem .7rem; border-radius: var(--radius); font-weight: 500; font-size: .95rem;
}
.site-nav a:hover { background: var(--stamp-soft); }
.site-nav a[aria-current="page"] { color: var(--stamp); box-shadow: inset 0 -3px 0 var(--stamp); border-radius: 0; }
.nav-member { border: 1px solid var(--line); }
.site-nav a.nav-member[aria-current="page"] { border-radius: var(--radius); }
.nav-toggle { display: none; }

@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex; font: inherit; font-weight: 600;
    background: none; border: 1px solid var(--line); color: var(--ink);
    padding: .4rem .8rem; border-radius: var(--radius); cursor: pointer;
  }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; background: var(--surface);
    border-bottom: 1px solid var(--line); padding: .5rem 1rem 1rem;
  }
  .site-nav.open { display: flex; }
  .site-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--stamp); }
}

/* Hero: the society seal is the one bold element */
.hero { background: var(--surface); border-bottom: 1px solid var(--line); }
.hero-inner {
  display: grid; grid-template-columns: auto 1fr; gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center; padding-block: clamp(2rem, 6vw, 4.5rem);
}
.hero-seal { width: clamp(140px, 22vw, 230px); transform: rotate(-8deg); opacity: .92; }
@media (prefers-reduced-motion: no-preference) {
  .hero-seal { animation: stamp .55s cubic-bezier(.2,.9,.3,1.2) both; }
  @keyframes stamp {
    from { transform: rotate(-8deg) scale(1.35); opacity: 0; }
    to   { transform: rotate(-8deg) scale(1); opacity: .92; }
  }
}
.hero h1 { font-size: clamp(2rem, 1.2rem + 3.2vw, 3.4rem); max-width: 18ch; margin-bottom: .35em; }
.address { color: var(--muted); font-weight: 500; }
.hero-lede { font-size: 1.15rem; max-width: 52ch; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
@media (max-width: 640px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-seal { width: 130px; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  padding: .65rem 1.1rem; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.btn:hover { border-color: var(--stamp); }
.btn-primary { background: var(--stamp); border-color: var(--stamp); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary { color: #10162E; } }
.btn-primary:hover { filter: brightness(1.1); }
.btn-small { padding: .35rem .7rem; font-size: .9rem; }
.btn-danger { color: var(--due); }
.btn-link { background: none; border: 0; color: var(--stamp); font: inherit; text-decoration: underline; cursor: pointer; padding: .4rem; }
.btn[disabled] { opacity: .55; cursor: progress; }

/* Home */
.home-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2.5rem; padding-block: 2.5rem 3.5rem; }
@media (max-width: 820px) { .home-grid { grid-template-columns: 1fr; } }
.block-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.block-list li { border-bottom: 1px solid var(--line); }
.block-list a {
  display: grid; grid-template-columns: 1fr auto; gap: .25rem 1rem; align-items: baseline;
  padding: 1rem .25rem; text-decoration: none; color: var(--ink);
}
.block-list a:hover { background: var(--stamp-soft); }
.block-list .bname { font-weight: 700; font-size: 1.1rem; }
.block-list .bcount { color: var(--muted); grid-column: 1; font-size: .92rem; }
.block-list .bdue { grid-column: 2; grid-row: 1 / span 2; text-align: right; font-weight: 700; color: var(--due); }
.block-list .bdue small { display: block; font-weight: 500; color: var(--muted); font-size: .8rem; }
.latest-notice { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--stamp); padding: 1.25rem; border-radius: var(--radius); }
.latest-notice time { color: var(--muted); font-size: .9rem; }
.latest-notice h3 { margin-top: .25rem; }

/* Facts */
.facts { margin: 1.5rem 0 2rem; border-top: 1px solid var(--line); }
.facts > div { display: grid; grid-template-columns: 12rem 1fr; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-weight: 500; }
.facts dd { margin: 0; font-weight: 500; }
@media (max-width: 560px) { .facts > div { grid-template-columns: 1fr; gap: .1rem; } }

.people { list-style: none; padding: 0; margin: 1.5rem 0; border-top: 1px solid var(--line); }
.people li { display: grid; grid-template-columns: 10rem 1fr; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.people .role { color: var(--muted); }
.people .who { font-weight: 600; }

/* Dues */
.dues-tools { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin: 1.5rem 0 1rem; }
.segmented { display: flex; flex-wrap: wrap; gap: .4rem; }
.segmented button {
  font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer;
  padding: .45rem .85rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.search input {
  font: inherit; width: min(320px, 100%); padding: .55rem .8rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink);
}
.search { flex: 1 1 260px; max-width: 360px; }
@media (max-width: 640px) { .search { max-width: none; } }
.search input { width: 100%; }

.dues-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px;
  margin: 0 0 2rem; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.dues-summary > div { padding: .9rem 1.1rem; background: var(--surface); }
.dues-summary dt { font-size: .85rem; color: var(--muted); }
.dues-summary dd { margin: .15rem 0 0; font-size: 1.3rem; font-weight: 700; }
.dues-summary .due { color: var(--due); }
.dues-summary .credit { color: var(--credit); }

.block-section { margin-bottom: 2.5rem; }
.block-section h2 { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.block-section h2 small { font-size: .9rem; font-weight: 500; color: var(--muted); }

.table-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { padding: .6rem .85rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: .82rem; font-weight: 600; color: var(--muted); background: var(--paper); white-space: nowrap; }
tbody tr:hover { background: var(--stamp-soft); }
td.unit { font-weight: 700; white-space: nowrap; }
td.type { color: var(--muted); font-size: .88rem; }
.num { text-align: right; white-space: nowrap; }
.amt-due { color: var(--due); font-weight: 600; }
.amt-credit { color: var(--credit); font-weight: 600; }
.not-listed { color: var(--muted); font-style: italic; }
tfoot td { font-weight: 700; border-bottom: 0; background: var(--paper); }
.flag {
  display: inline-block; margin-left: .4rem; font-size: .75rem; font-weight: 600;
  background: var(--warn-bg); color: var(--warn-ink); padding: .05rem .45rem; border-radius: 4px;
}
.empty { padding: 2rem; text-align: center; color: var(--muted); }

.callout {
  background: var(--stamp-soft); border-radius: var(--radius); padding: 1.25rem 1.4rem; margin: 2rem 0;
}
.callout h2 { font-size: 1.1rem; }
.callout p:last-child { margin-bottom: 0; }
.glossary { margin-top: 1rem; }
.glossary summary { cursor: pointer; font-weight: 600; }
.glossary dt { font-weight: 700; margin-top: .75rem; }
.glossary dd { margin: .2rem 0 0; color: var(--muted); max-width: 72ch; }

/* Notices */
.notice { border-bottom: 1px solid var(--line); padding: 1.5rem 0; }
.notice time { color: var(--muted); font-weight: 500; }
.notice h2 { margin-top: .3rem; }

/* Forms */
.switcher { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 1rem 0 1.5rem; }
.switch-btn { font: inherit; font-weight: 600; padding: .55rem 1.2rem; border: 0; background: var(--surface); color: var(--ink); cursor: pointer; }
.switch-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.form { display: grid; gap: 1rem; max-width: 460px; }
.form label { display: grid; gap: .3rem; font-weight: 600; font-size: .95rem; }
.form input, .form select, .inline-label select {
  font: inherit; font-weight: 400; padding: .6rem .75rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink);
}
.form .check { display: flex; gap: .55rem; align-items: flex-start; font-weight: 400; }
.form .check input { margin-top: .3rem; }
.input-prefix { display: flex; }
.input-prefix span { padding: .6rem .7rem; border: 1px solid var(--line); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); background: var(--paper); font-weight: 500; }
.input-prefix input { flex: 1; border-radius: 0 var(--radius) var(--radius) 0; min-width: 0; }
.form-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.form-msg { margin: 0; min-height: 1.2em; color: var(--due); font-weight: 500; }
.form-msg.ok { color: var(--credit); }
.entry-form { max-width: none; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; margin: 1rem 0; }
.entry-form .wide { grid-column: span 2; }
.entry-form .form-msg, .entry-form .form-actions { grid-column: 1 / -1; }
@media (max-width: 560px) { .entry-form .wide { grid-column: auto; } }
.inline-label { display: inline-grid; gap: .3rem; font-weight: 600; margin: .5rem 0; min-width: 220px; }

.status-card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--stamp); border-radius: var(--radius); padding: 1.25rem 1.4rem; margin-top: 1.5rem; }
.status-card .form-actions { margin-top: .75rem; }
.account-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin: 1.5rem 0 1rem; }
.account-head h1, .account-head h2 { margin: 0; }
#admin-panel section { margin-bottom: 2.5rem; }
.dup-warning { display: block; color: var(--warn-ink); background: var(--warn-bg); font-size: .8rem; padding: .1rem .4rem; border-radius: 4px; margin-top: .25rem; }
.row-actions { display: flex; gap: .5rem; justify-content: flex-end; white-space: nowrap; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 1.75rem 0; font-size: .9rem; }
.site-footer p { margin: 0 0 .35rem; }

@media print {
  .site-header, .site-footer, .dues-tools, .callout, .glossary, .hero { display: none !important; }
  .tab[hidden] { display: none; }
  body { background: #fff; color: #000; }
  .table-scroll { border: 0; overflow: visible; }
}

main { min-height: 65vh; }
.mt-sm { margin-top: 1.75rem; }
#member-account h3 { margin-top: 1.75rem; }
.btn-google { gap: .6rem; width: 100%; max-width: 460px; }
.g-logo { font-weight: 800; color: #4285F4; font-size: 1.1rem; }
.google-box { max-width: 460px; margin: 1rem 0 .5rem; display: grid; gap: .6rem; }
.google-box .form-msg:empty { display: none; }
.or-line { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .9rem; margin: .25rem 0 0; }
.or-line::before, .or-line::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.small-note { font-size: .88rem; margin: 0; }
