/* ══════════════════════════════════════════════════════════════════
   /account/ — consumer self-service (balance + top-up)
   Layered on styles.css + business.css (tokens, nav/footer, .field,
   .btn, .wizard__card/__error/__hint) — this file adds what those
   don't already cover: the account header, and the modal/top-up rules
   duplicated from team.css rather than shared with it (see
   docs/PLAN-web-self-service-portal.md, "Extending to plain consumer
   accounts" — this page is deliberately separate from the PBX Team
   page, so its styling stays separate too rather than importing a
   file named for the other page).
   ══════════════════════════════════════════════════════════════════ */

/* .btn sets display:inline-flex and .modal sets display:flex — both equal
   specificity to the browser's own [hidden]{display:none}, so whichever
   loads later (ours) wins the cascade and silently un-hides a hidden
   button/modal. Same fix team.css carries for the same reason. */
[hidden] { display: none !important; }

.btn--outline {
  background: #fff; color: var(--reketa-blue); border: 1.5px solid var(--rule);
}
.btn--outline:hover { background: var(--paper-2); transform: translateY(-1px); }

/* ─────────────────── account header ─────────────────── */
.account-nav {
  position: sticky; top: 70px; z-index: 20;
  display: flex; gap: 6px; overflow-x: auto;
  margin: 0 0 28px; padding: 7px;
  border: 1px solid var(--rule); border-radius: 14px;
  background: color-mix(in srgb, #fff 92%, transparent);
  box-shadow: 0 14px 40px -34px rgba(7, 95, 153, .65);
  backdrop-filter: blur(12px);
}
.account-nav a {
  flex: 0 0 auto; padding: 9px 14px; border-radius: 9px;
  color: var(--ink-2); font-size: 13px; font-weight: 700; text-decoration: none;
}
.account-nav a:hover, .account-nav a:focus-visible { background: var(--reketa-sky); color: var(--reketa-blue); }
.account-nav a[aria-current] { background: var(--reketa-sky); color: var(--reketa-blue-deep); box-shadow: inset 0 -2px 0 var(--teal); }
.section-anchor { scroll-margin-top: 150px; }
/* On phones the site nav wraps to two rows, so a second sticky bar would
   eat too much of the screen — let this one scroll away. */
@media (max-width: 720px) {
  .account-nav { position: static; }
  .section-anchor { scroll-margin-top: 120px; }
}

.account-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.account-header__title { font-size: clamp(30px, 4vw, 42px); color: var(--reketa-blue-deep); }
.account-balance { font-family: var(--mono); font-size: 15px; color: var(--ink-2); margin-top: 8px; }
.account-credit { font-family: var(--mono); font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.account-header__actions { display: flex; align-items: center; gap: 10px; }

/* ─────────────────── account details grid ─────────────────── */
.detail-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px; margin-bottom: 8px;
}
.detail-item {
  display: flex; flex-direction: column; gap: 2px;
  border: 1px solid var(--rule); border-radius: 14px; padding: 14px 16px;
  background: #fff; box-shadow: 0 14px 35px -32px rgba(7, 95, 153, .7);
}
.detail-item__label {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-3);
}
.detail-item__value { font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.detail-item__value--mono { font-family: var(--code); }

/* ─────────────────── modal (shared shape with team.css) ─────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(23, 54, 81, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal__card {
  width: 100%; max-width: 440px;
  background: var(--card); border-radius: 20px;
  padding: 28px; max-height: 90vh; overflow-y: auto;
}
.modal__actions {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 16px; margin-top: 8px;
}

/* ─────────────────── top-up modal ─────────────────── */
.topup-options, .topup-methods { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.topup-methods { flex-direction: row; flex-wrap: wrap; margin: 8px 0 0; }
.topup-option, .topup-method {
  display: flex; align-items: center; gap: 12px;
  border: 1.5px solid var(--rule); border-radius: 14px; padding: 12px 14px;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.topup-method { flex: 1 1 auto; justify-content: center; padding: 10px 14px; }
.topup-option:has(input:checked), .topup-method:has(input:checked) {
  border-color: var(--teal); background: color-mix(in srgb, var(--teal) 6%, var(--card));
}
.topup-option input, .topup-method input { accent-color: var(--teal); }
.topup-option__body { display: flex; flex-direction: column; gap: 2px; }
.topup-option__name { font-weight: 600; font-size: 14px; }
.topup-option__meta { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.topup-method__name { font-weight: 600; font-size: 13.5px; }

#topUpStripeElement {
  border: 1.5px solid var(--rule); border-radius: 14px; padding: 14px; margin: 12px 0;
}

.topup-innbucks {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin: 16px 0; padding: 16px; border: 1.5px solid var(--rule); border-radius: 14px;
}
.topup-innbucks img { max-width: 180px; border-radius: 8px; }
.topup-innbucks__code { font-family: var(--code); font-size: 20px; font-weight: 700; letter-spacing: .04em; }

/* ─────────────────── phone lines (mirrors team.css's .did-* shapes,
   renamed since this page has nothing to do with DIDs) ─────────────────── */
.line-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin: 32px 0 16px; flex-wrap: wrap;
}
.line-header__title { font-size: clamp(19px, 2.2vw, 22px); }
.line-header__actions { display: flex; align-items: center; gap: 10px; }
.line-usage { font-family: var(--mono); font-size: 13px; color: var(--ink-2); margin-top: 4px; }

/* ─────────────────── collapsible sections (transactions, call usage) ─────────────────── */
.collapse-toggle {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  border: 1.5px solid var(--rule); background: var(--card);
  color: var(--ink-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.collapse-toggle:hover { background: var(--paper-2); border-color: var(--teal); }
.collapse-toggle__chevron { display: inline-block; font-size: 11px; transition: transform .15s; }
.collapse-toggle[aria-expanded="false"] .collapse-toggle__chevron { transform: rotate(-90deg); }
.collapse-body { margin-top: 4px; }

/* ─────────────────── date filter (transactions) ─────────────────── */
.date-filter {
  display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px 14px;
  margin-bottom: 16px;
}
.field--inline { margin-bottom: 0; gap: 4px; }
.field--inline span { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.field--inline input {
  padding: 8px 12px; font-size: 14px; border-radius: 10px; width: auto;
}

.month-nav__input {
  border: 1.5px solid var(--rule); background: var(--card); color: var(--ink);
  border-radius: 10px; padding: 0 10px; height: 34px; font: inherit; font-size: 13px;
}
.line-list { display: flex; flex-direction: column; gap: 10px; }
.line-empty { color: var(--ink-3); font-size: 14px; }
.line-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1.5px solid var(--rule); border-radius: 14px; padding: 12px 16px;
}
.line-row__number { font-family: var(--mono); font-weight: 600; font-size: 14.5px; flex: 1 1 auto; min-width: 0; }
.line-row__meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.line-row__login { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
@media (max-width: 520px) {
  .line-row { flex-direction: column; align-items: flex-start; }
  .line-row__meta { width: 100%; justify-content: flex-start; }
}
.badge { border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; }
.badge--active { background: color-mix(in srgb, var(--teal) 15%, var(--card)); color: var(--teal-deep); }
.badge--pending { background: color-mix(in srgb, var(--gold) 25%, var(--card)); color: #8a6400; }
.badge--extra { background: var(--paper-2); color: var(--ink-2); }

/* ─────────────────── add-a-line modal ─────────────────── */
#addLineVerifyPhone { font-family: var(--mono); font-weight: 600; }

/* ─────────────────── transactions + call usage rows ───────────────────
   Shared .tx-* row shape (both lists are a title/meta left block and an
   amount/badge right block), so one set of rules styles both sections. */
.tx-list { display: flex; flex-direction: column; gap: 10px; }
.tx-empty { color: var(--ink-3); font-size: 14px; }
.tx-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1.5px solid var(--rule); border-radius: 14px; padding: 12px 16px;
}
.tx-row__main { flex: 1 1 auto; min-width: 0; }
.tx-row__title {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 14.5px;
}
.tx-row__party { overflow-wrap: anywhere; }
.tx-row__meta {
  font-family: var(--mono); font-size: 12px; color: var(--ink-3);
  margin-top: 3px; overflow-wrap: anywhere;
}
.tx-row__side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.tx-row__amount { font-family: var(--mono); font-weight: 600; font-size: 14px; }
.tx-row__dur { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
@media (max-width: 520px) {
  .tx-row { flex-direction: column; align-items: flex-start; }
  .tx-row__side { width: 100%; justify-content: space-between; }
}

/* status badges — same bucket names the app's Transaction History uses */
.badge--completed { background: color-mix(in srgb, var(--teal) 15%, var(--card)); color: var(--teal-deep); }
.badge--failed { background: color-mix(in srgb, var(--red) 12%, var(--card)); color: #B3261E; }
.badge--pending { background: color-mix(in srgb, var(--gold) 25%, var(--card)); color: #8a6400; }

.load-more { display: flex; justify-content: center; margin-top: 14px; }

/* ─────────────────── call usage ─────────────────── */
.call-dir {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; font-size: 13px; flex-shrink: 0;
}
.call-dir--out { background: color-mix(in srgb, var(--teal) 15%, var(--card)); color: var(--teal-deep); }
.call-dir--in { background: color-mix(in srgb, var(--gold) 28%, var(--card)); color: #8a6400; }

.month-nav { display: flex; gap: 8px; }
.month-nav__btn {
  width: 34px; height: 34px; border-radius: 10px;
  border: 1.5px solid var(--rule); background: var(--card);
  color: var(--ink); font-size: 17px; line-height: 1; cursor: pointer;
}
.month-nav__btn:hover:not(:disabled) { background: var(--paper-2); border-color: var(--teal); }
.month-nav__btn:disabled { opacity: .4; cursor: default; }

.call-summary {
  display: flex; gap: 10px; margin-bottom: 14px;
  background: color-mix(in srgb, var(--teal) 7%, var(--card));
  border: 1px solid var(--rule-soft); border-radius: 14px; padding: 14px 16px;
}
.call-summary__stat { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.call-summary__value { font-family: var(--mono); font-weight: 700; font-size: 15px; }
.call-summary__label { font-size: 11.5px; color: var(--ink-2); }
