:root {
  --ink: #08252f;
  --aqua: #28b0a6;
  --aqua-dark: #117b78;
  --coral: #d95d39;
  --paper: #fff;
  --canvas: #edf3f2;
  --text: #17313a;
  --muted: #526970;
  --line: #d5e1df;
  --success: #207a56;
  --danger: #b63f37;
  --shadow: 0 20px 50px -38px rgba(8,37,47,.38);
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--canvas); font-family: var(--sans); }
button, input { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }
.muted { margin: 0; color: var(--muted); line-height: 1.55; }
.eyebrow { margin: 0 0 8px; color: var(--aqua-dark); font: 500 .68rem/1 var(--mono); letter-spacing: .13em; text-transform: uppercase; }
.form-error { min-height: 22px; margin: -4px 0 0; color: var(--danger); font-size: .82rem; }

.login-shell { min-height: 100svh; display: grid; grid-template-columns: minmax(360px, .9fr) minmax(440px, 1.1fr); background: var(--paper); }
.login-intro { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 100svh; overflow: hidden; padding: clamp(42px, 6vw, 86px); color: #edf7f5; background: var(--ink); }
.login-intro::before { content: ""; position: absolute; inset: 0; opacity: .6; pointer-events: none; background: radial-gradient(circle at 90% 10%, rgba(40,176,166,.45), transparent 34%), linear-gradient(145deg, transparent 65%, rgba(217,93,57,.18)); }
.login-intro > * { position: relative; }
.login-intro img { width: min(250px, 70%); }
.login-intro h1 { max-width: 640px; margin: 0; font-size: clamp(3rem, 5vw, 5.8rem); line-height: .98; letter-spacing: 0; }
.login-intro p { max-width: 560px; margin: 22px 0 0; color: rgba(237,247,245,.72); font-size: 1rem; line-height: 1.65; }
.login-intro > span { color: rgba(237,247,245,.55); font: 500 .66rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.login-panel { display: grid; place-items: center; padding: 48px; }
.auth-stack { width: min(420px, 100%); }
.mobile-logo { display: none; }
.auth-form { display: grid; gap: 22px; }
.auth-form h2 { margin: 0 0 10px; color: var(--ink); font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1; }
label { display: grid; gap: 8px; color: var(--text); font-size: .82rem; font-weight: 700; }
input { width: 100%; min-height: 50px; border: 1px solid #bdccca; border-radius: 6px; padding: 11px 13px; color: var(--ink); background: var(--paper); outline: none; }
input:focus { border-color: var(--aqua-dark); box-shadow: 0 0 0 3px rgba(40,176,166,.15); }
.password-field { position: relative; }
.password-field input { padding-right: 68px; }
.password-toggle { position: absolute; top: 50%; right: 8px; min-width: 50px; min-height: 34px; transform: translateY(-50%); border: 0; border-radius: 4px; padding: 6px 8px; color: var(--aqua-dark); background: transparent; cursor: pointer; font-size: .72rem; font-weight: 800; }
.password-toggle:hover { background: #edf8f6; }
.password-toggle:focus-visible { outline: 3px solid rgba(217,93,57,.38); outline-offset: 2px; }
.turnstile-wrap { min-height: 70px; }
.button, .text-button { border: 0; cursor: pointer; }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border-radius: 6px; padding: 11px 17px; font-size: .84rem; font-weight: 800; }
.button svg, .text-button svg { width: 17px; height: 17px; }
.button-primary { color: #042019; background: var(--aqua); box-shadow: 0 10px 24px -16px rgba(17,123,120,.8); }
.button-primary:hover { background: #42c5ba; }
.button-wide { width: 100%; min-height: 52px; }
.text-button { display: inline-flex; align-items: center; gap: 7px; justify-self: center; padding: 7px 0; color: var(--aqua-dark); background: none; font-size: .8rem; font-weight: 800; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(217,93,57,.38); outline-offset: 3px; }

.portal-header { min-height: 76px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 26px; border-bottom: 1px solid var(--line); padding: 14px clamp(22px, 5vw, 78px); background: var(--paper); }
.portal-header img { display: block; width: 190px; }
.client-name { border-left: 1px solid var(--line); padding-left: 26px; color: var(--ink); font-size: .84rem; font-weight: 800; }
.sign-out { justify-self: end; color: var(--ink); }
.portal-main { width: min(1360px, calc(100% - 44px)); margin: 0 auto; padding: clamp(34px, 5vw, 68px) 0 70px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading h1 { margin: 0 0 8px; color: var(--ink); font-size: clamp(2.3rem, 4vw, 4rem); line-height: .95; }
.secure-note { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: .72rem; }
.secure-note svg { width: 17px; color: var(--aqua-dark); }
.notice { margin-bottom: 20px; border-left: 4px solid var(--aqua); border-radius: 6px; padding: 14px 18px; color: var(--ink); background: #e1f5f1; font-size: .82rem; }
.notice.canceled { border-left-color: var(--coral); background: #f9e9e4; }
.due-band { min-height: 126px; display: grid; grid-template-columns: minmax(220px, .7fr) minmax(250px, 1fr) auto; align-items: center; gap: 30px; border: 1px solid #b9d6d2; border-radius: 8px; padding: 26px 30px; background: #f7fcfb; box-shadow: var(--shadow); }
.due-band span { display: block; color: var(--muted); font-size: .74rem; font-weight: 800; }
.due-band strong { display: block; margin-top: 6px; color: var(--ink); font-size: clamp(2.2rem, 4vw, 3.8rem); line-height: 1; }
.due-band p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.55; }
.billing-section { margin-top: 38px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.section-heading h2 { margin: 0; color: var(--ink); font-size: 1.3rem; }
.section-heading span { color: var(--muted); font-size: .72rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); box-shadow: var(--shadow); }
table { width: 100%; min-width: 850px; border-collapse: collapse; }
th { height: 44px; padding: 0 18px; border-bottom: 1px solid var(--line); color: #546d73; background: #f5f8f7; font: 500 .62rem/1 var(--mono); letter-spacing: .07em; text-align: left; text-transform: uppercase; }
td { min-height: 68px; padding: 15px 18px; border-bottom: 1px solid #e5eceb; font-size: .8rem; }
tr:last-child td { border-bottom: 0; }
.cell-title { display: block; color: var(--ink); font-weight: 800; }
.cell-sub { display: block; margin-top: 4px; color: var(--muted); font-size: .7rem; }
.status { display: inline-flex; align-items: center; gap: 6px; border-radius: 100px; padding: 5px 9px; font: 500 .62rem/1 var(--mono); text-transform: uppercase; }
.status-paid, .status-active { color: var(--success); background: #e6f4ed; }
.status-pending { color: #8b6209; background: #fff2d9; }
.status-canceling { color: #8b6209; background: #fff2d9; }
.status-canceled { color: var(--muted); background: #edf1f0; }
.status-past_due { color: var(--danger); background: #f9e7e5; }
.empty { padding: 34px 20px; color: var(--muted); text-align: center; }
.plans-list { display: grid; gap: 12px; }
.plan-row { min-height: 126px; display: grid; grid-template-columns: minmax(260px, 1.3fr) repeat(3, minmax(130px, .55fr)) auto; align-items: center; gap: 24px; border: 1px solid var(--line); border-radius: 8px; padding: 22px 24px; background: var(--paper); box-shadow: var(--shadow); }
.plan-row h3 { margin: 0; color: var(--ink); font-size: 1rem; }
.plan-row p { margin: 6px 0 0; color: var(--muted); font-size: .74rem; }
.plan-detail span { display: block; color: var(--muted); font-size: .66rem; text-transform: uppercase; }
.plan-detail strong { display: block; margin-top: 5px; color: var(--ink); font-size: .82rem; }
.help-footer { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 52px; color: var(--muted); }
.help-footer svg { color: var(--aqua-dark); }
.help-footer div { display: grid; gap: 2px; }
.help-footer strong { color: var(--ink); font-size: .78rem; }
.help-footer a { color: var(--aqua-dark); font-size: .74rem; text-decoration: none; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; max-width: min(420px, calc(100% - 48px)); transform: translateY(20px); opacity: 0; pointer-events: none; border-left: 4px solid var(--aqua); border-radius: 6px; padding: 14px 18px; color: #fff; background: var(--ink); box-shadow: 0 18px 45px rgba(8,37,47,.3); transition: opacity .25s, transform .25s; font-size: .8rem; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { border-left-color: var(--coral); }
.loading { opacity: .58; pointer-events: none; }

@media (max-width: 940px) {
  .plan-row { grid-template-columns: 1fr 1fr; }
  .plan-row > :first-child { grid-column: 1 / -1; }
  .plan-row .button { justify-self: start; }
}
@media (max-width: 760px) {
  .login-shell { display: block; background: var(--paper); }
  .login-intro { display: none; }
  .login-panel { min-height: 100svh; padding: 36px 24px; }
  .mobile-logo { display: block; width: min(220px, 72vw); margin-bottom: 34px; }
  .portal-header { grid-template-columns: 1fr auto; min-height: 68px; padding: 12px 18px; }
  .portal-header img { width: 155px; }
  .client-name { grid-column: 1 / -1; grid-row: 2; border: 0; padding: 0 0 4px; font-size: .72rem; }
  .portal-main { width: calc(100% - 28px); padding-top: 30px; }
  .page-heading { display: grid; align-items: start; }
  .page-heading h1 { font-size: 2.6rem; }
  .due-band { grid-template-columns: 1fr; gap: 18px; padding: 22px; }
  .due-band .button { width: 100%; }
  .section-heading { align-items: flex-start; }
  .plans-list { gap: 14px; }
  .plan-row { grid-template-columns: 1fr; gap: 18px; padding: 20px; }
  .plan-row > :first-child { grid-column: auto; }
  .plan-row .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
