/* EZ Access customer portal — brand: teal #1E5B52, terracotta #D9703C, sand #F7F0E6, ink #1F2A28 */
:root {
  --teal: #1E5B52; --teal-dark: #164640; --teal-soft: #E2EDEA;
  --terra: #D9703C; --terra-dark: #B85A2B; --terra-soft: #FBE9DE;
  --sand: #F7F0E6; --sand-2: #EFE5D5;
  --ink: #1F2A28; --muted: #5E6966; --line: #E4DDD2;
  --danger: #B3261E; --danger-soft: #FCE8E6;
  --radius: 16px; --shadow: 0 4px 16px rgba(22, 70, 64, .07);
  --font: "Nunito", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--ink); background: var(--sand); }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--terra-dark); }
h1 { font-size: 1.5rem; margin: 0 0 4px; font-weight: 800; }
h2 { font-size: 1.1rem; margin: 0; font-weight: 800; }
button, input { font: inherit; color: inherit; }

/* top bar + tabs */
.topbar { background: var(--teal); color: #fff; position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 960px; margin: 0 auto; padding: 0 16px; height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand:hover { color: #fff; }
.brand strong { font-weight: 800; font-size: 1.1rem; }
.brand em { font-style: normal; font-weight: 700; font-size: .8rem; background: var(--terra); padding: 2px 8px; border-radius: 6px; margin-left: 2px; white-space: nowrap; }
.brand img { border-radius: 9px; background: var(--sand); }
.topbar-right { display: flex; gap: 8px; }
.lang { background: rgba(255, 255, 255, .14); border: 0; color: #fff; padding: 5px 12px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: .85rem; }
.lang:hover { background: rgba(255, 255, 255, .24); }
.tabs { max-width: 960px; margin: 0 auto; padding: 0 10px; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs a { color: #D5E5E1; padding: 9px 14px 11px; font-weight: 700; white-space: nowrap; border-bottom: 3px solid transparent; }
.tabs a:hover { color: #fff; }
.tabs a.on { color: #fff; border-bottom-color: var(--terra); }

.page { max-width: 960px; margin: 0 auto; padding: 24px 16px 60px; }
.page-head { margin-bottom: 18px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 16px; }
.grid .card { margin: 0; }
.empty { color: var(--muted); text-align: center; padding: 18px 0 8px; margin: 0; }
.loading { color: var(--muted); text-align: center; padding: 60px 0; }

/* buttons, inputs */
.btn { border: 0; border-radius: 999px; padding: 10px 20px; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn.primary { background: var(--terra); color: #fff; }
.btn.primary:hover { background: var(--terra-dark); color: #fff; }
.btn.ghost { background: var(--teal-soft); color: var(--teal-dark); }
.btn.ghost:hover { background: #D3E4DF; }
.btn.sm { padding: 6px 14px; font-size: .88rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: default; }
.link-btn { background: none; border: 0; padding: 0; color: var(--teal); cursor: pointer; font-weight: 700; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-weight: 700; margin-bottom: 6px; }
.field input { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.field input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.field input.code { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-weight: 800; }
.form-error { color: var(--danger); min-height: 1.4em; margin: 4px 0 10px; font-weight: 600; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; cursor: pointer; }
.check + .check { border-top: 1px solid #F0EBE3; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--teal); flex: none; }
.check strong { display: block; }

/* sign-in */
.login { max-width: 420px; margin: 6vh auto 0; }
.login .card { padding: 28px 24px; }
.login-logo { display: flex; justify-content: center; margin-bottom: 14px; }
.login-logo img { border-radius: 16px; background: var(--sand); }
.login h1 { text-align: center; }
.login .lead { text-align: center; color: var(--muted); margin: 0 0 22px; }
.dev-code { background: #FFF4D6; color: #7A5B00; border-radius: 10px; padding: 8px 12px; font-size: .9rem; margin-bottom: 12px; }

/* badges */
.badge { display: inline-block; font-size: .78rem; font-weight: 800; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.badge.teal { background: var(--teal-soft); color: var(--teal-dark); }
.badge.terra { background: var(--terra-soft); color: var(--terra-dark); }
.badge.grey { background: #EEECE8; color: #7A7672; }
.badge.warn { background: #FBEFC5; color: #7A5900; }
.badge.vip { background: var(--terra); color: #fff; }

/* home */
.stat-label { color: var(--muted); font-weight: 700; font-size: .9rem; }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--teal); line-height: 1.2; margin: 4px 0; }
.stat-value.due { color: var(--terra-dark); }
.pay-box { background: var(--teal-soft); border-radius: 12px; padding: 12px 14px; margin-top: 12px; }
.pay-box dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 6px 0 0; }
.pay-box dt { color: var(--muted); }
.pay-box dd { margin: 0; font-weight: 800; word-break: break-all; }
.vip-card { background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%); color: #fff; }
.vip-card .muted { color: #CFE2DD; }
.vip-card .stat-label { color: #CFE2DD; }
.vip-card .stat-value { color: #fff; }
.perks { margin: 10px 0 0; padding-left: 20px; }
.perks li { margin: 3px 0; }

/* lists */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li + li { border-top: 1px solid #F0EBE3; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; color: inherit; }
a.row:hover { background: #FBF8F3; color: inherit; }
.row .main { flex: 1; min-width: 0; }
.row .main strong { display: block; }
.row .amount { font-weight: 800; white-space: nowrap; text-align: right; }
.row .amount.pos { color: var(--teal); }
.svc-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; font-weight: 800; flex: none; }
.svc-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .9rem; }

/* referrals */
.ref-code { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0 4px; }
.ref-code code { font-family: inherit; font-size: 1.8rem; font-weight: 800; letter-spacing: .06em; color: var(--terra-dark); background: var(--terra-soft); border-radius: 12px; padding: 4px 16px; }
.steps { margin: 0; padding-left: 20px; }
.steps li { margin: 6px 0; }

/* bill page */
.bill-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.seg { display: inline-flex; background: #fff; border-radius: 999px; padding: 3px; box-shadow: var(--shadow); }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; font-weight: 700; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--teal); color: #fff; }
.print-tip { font-size: .85rem; color: var(--muted); margin: -6px 0 14px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; }
.toast.err { background: var(--danger); }

@media (max-width: 520px) {
  .brand em { display: none; }
  .stat-value { font-size: 1.7rem; }
}
@media print {
  .no-print, .bill-bar, .print-tip, .toast { display: none !important; }
  .page { padding: 0; max-width: none; }
}

/* small layout helpers (no inline styles: the CSP forbids them) */
.center { text-align: center; }
.strong { font-weight: 700; }
.mt { margin: 14px 0 0; }
.mt-s { margin: 8px 0 0; }
.split { display: flex; justify-content: space-between; }
.bar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.sub-head { margin: 16px 0 6px; }
.details { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 700; word-break: break-word; }

/* referrals: member vs VIP */
.compare { border: 2px solid var(--terra-soft); }
.compare h2 { color: var(--terra-dark); margin-bottom: 10px; }
.compare-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.compare-table th, .compare-table td { text-align: left; vertical-align: top; padding: 8px; border-bottom: 1px solid #F0EBE3; }
.compare-table thead th { font-size: .85rem; color: var(--muted); }
.compare-table tbody th { color: var(--muted); font-weight: 700; white-space: nowrap; }
.compare-table .vip-col { background: var(--terra-soft); color: var(--terra-dark); font-weight: 700; }

/* account system: forms, family, ID */
button, input, select { font: inherit; color: inherit; }
.field select { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; background: #fff; }
.field input[type=file] { padding: 9px; }
.field .hint { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; margin-top: 4px; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { flex: 1 1 220px; margin-bottom: 0; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.notice { background: var(--teal-soft); border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; }
.notice.warn { background: #FBEFC5; color: #5E4500; }
.perm { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.perm select, .perm input { border: 1.5px solid var(--line); border-radius: 10px; padding: 5px 8px; background: #fff; font-size: .9rem; }
.perm input { width: 110px; }
.link-btn.danger { color: var(--danger); }
.mt { margin-top: 14px; }
.links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
