/* =========================================================
   Moving parts, the account dialog (AB-126): a panel over the
   page, three tabs under a segmented control. The site's type,
   colours and buttons; nothing of the landing's staging
   (Benjamin, 05/10/2026).
   ========================================================= */

.acd {
  --danger: var(--rec-red, #ff4b3e);
  width: min(640px, calc(100vw - 2 * var(--gut, 16px)));
  max-height: min(760px, calc(100dvh - 32px));
  margin: auto; padding: 0; overflow: hidden;
  border: 1px solid var(--line-strong); border-radius: 22px;
  background: var(--panel); color: var(--text);
  font-family: inherit; font-size: 16px; line-height: 1.5; letter-spacing: -.012em;
  box-shadow: 0 40px 120px rgba(0, 0, 0, .55);
}
.acd:focus { outline: none; }
.acd[open] { display: flex; flex-direction: column; animation: acd-in .5s var(--ease-out, cubic-bezier(.16, 1, .3, 1)); }
.acd::backdrop { background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: acd-veil .35s ease; }
@keyframes acd-in { from { opacity: 0; transform: translateY(18px) scale(.985); } }
@keyframes acd-veil { from { opacity: 0; } }

.acd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 26px 28px 0; }
.acd-head h2 { font-weight: 440; font-size: 28px; line-height: 1.05; letter-spacing: -.04em; }
.acd-who { margin-top: 6px; color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }
.acd-close { position: relative; flex: none; width: 36px; height: 36px; margin: -4px -8px 0 0; border-radius: 50%; color: var(--muted); transition: background-color var(--mi-fast, .18s), color var(--mi-fast, .18s); }
.acd-close i { position: absolute; left: 11px; top: 17px; width: 14px; height: 1.5px; background: currentColor; transform: rotate(45deg); }
.acd-close i + i { transform: rotate(-45deg); }
.acd-close:focus-visible, .acd-seg button:focus-visible, .acd-quiet:focus-visible, .acd-input:focus-visible { outline: 2px solid var(--focus, var(--text)); outline-offset: 2px; }

.acd-flash { display: flex; align-items: center; gap: 10px; margin: 18px 28px 0; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 15px; line-height: 1.4; }
.acd-flash::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: #3ecf8e; }
.acd-flash[hidden] { display: none; }

/* the segmented control: three names, a thumb that slides under the chosen one */
.acd-seg { position: relative; display: flex; align-self: flex-start; margin: 22px 28px 0; padding: 4px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); }
.acd-seg button { position: relative; z-index: 1; height: 34px; padding: 0 16px; border-radius: 99px; color: var(--muted); font-weight: 500; font-size: 14.5px; letter-spacing: -.012em; transition: color var(--mi-fast, .18s); }
.acd-seg button[aria-selected="true"] { color: var(--text); }
.acd-thumb { position: absolute; left: 0; top: 4px; height: 34px; border-radius: 99px; background: var(--surface-high); border: 1px solid var(--line-strong); transition: transform .45s var(--ease-out, cubic-bezier(.16, 1, .3, 1)), width .45s var(--ease-out, cubic-bezier(.16, 1, .3, 1)); }

.acd-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 22px 28px 28px; transition: opacity var(--mi-fast, .18s); }
.acd[aria-busy="true"] .acd-body { opacity: .35; pointer-events: none; }
.acd-panel[hidden] { display: none; }
.acd-panel { animation: acd-panel .4s var(--ease-out, cubic-bezier(.16, 1, .3, 1)); }
@keyframes acd-panel { from { opacity: 0; transform: translateY(6px); } }
.acd-panel h3 { margin: 26px 0 8px; font-weight: 500; font-size: 15px; letter-spacing: -.012em; color: var(--text); }
.acd-panel > h3:first-child, .acd-panel > div > h3:first-child { margin-top: 0; }

/* a label and its value */
.acd-rows > div { display: grid; grid-template-columns: minmax(104px, 1fr) minmax(0, 3fr); gap: 4px 20px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.acd-rows > div:first-child { padding-top: 0; }
.acd-rows > div[hidden] { display: none; }
.acd-rows dt { color: var(--muted); font-size: 15px; }
.acd-rows dd { overflow-wrap: anywhere; }

.acd-state { display: inline-flex; align-items: center; gap: 7px; margin-left: 12px; color: var(--muted); font-size: 14px; vertical-align: 1px; }
.acd-state[hidden] { display: none; }
.acd-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--label); }
.acd-state[data-tone="open"]::before { background: #3ecf8e; }
.acd-state[data-tone="late"]::before { background: var(--danger); }
.acd-state[data-tone="late"] { color: var(--text); }

.acd-text { max-width: 56ch; color: var(--muted); font-size: 15.5px; }
.acd-dim { color: var(--muted); }
.acd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 16px; }
.acd-actions [hidden] { display: none; }
.acd-actions .btn { height: 40px; }
.acd-note { flex-basis: 100%; color: var(--muted); font-size: 14px; line-height: 1.4; }
.acd-note:empty { display: none; }

.acd-confirm { margin-top: 16px; padding: 16px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 15.5px; }
.acd-confirm[hidden] { display: none; }
.acd-confirm p + p { margin-top: 8px; }

/* fields: the name beside its button, the password under its label */
.acd-input { width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); font: inherit; letter-spacing: inherit; }
.acd-inline { display: flex; gap: 10px; }
.acd-inline .btn { height: 40px; flex: none; }
.acd-rows dd .acd-note { margin-top: 6px; }
.acd-pass[hidden] { display: none; }
.acd-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.acd-fields label { display: grid; gap: 6px; color: var(--muted); font-size: 14px; }
.acd-fields label[hidden] { display: none; }

/* the membership, as a pass: the plan in large, its state, its dates. Lit in the accent while it is open. */
.acd-pass { perspective: 1100px; }
.acd-pass-in { position: relative; display: flex; flex-direction: column; gap: 26px; padding: 20px 22px; overflow: hidden; border-radius: 18px; border: 1px solid var(--line-strong); background: var(--surface);
  transform: rotateX(calc(var(--rx, 0deg) * .5)) rotateY(calc(var(--ry, 0deg) * .5)); transition: transform .6s var(--ease-out, cubic-bezier(.16, 1, .3, 1)); will-change: transform; }
.acd-pass[data-tone="open"] .acd-pass-in { border-color: color-mix(in srgb, var(--accent) 34%, var(--line-strong));
  background:
    radial-gradient(110% 120% at 100% 0%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 58%),
    radial-gradient(80% 90% at 0% 100%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%),
    linear-gradient(140deg, color-mix(in srgb, var(--text) 11%, var(--bg)), var(--bg) 75%);
  box-shadow: 0 22px 48px rgba(0, 0, 0, .4), inset 0 1px 0 color-mix(in srgb, var(--text) 12%, transparent); }
.acd-pass[data-tone="late"] .acd-pass-in { border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: radial-gradient(110% 120% at 100% 0%, color-mix(in srgb, var(--danger) 20%, transparent), transparent 60%), var(--surface); }
.acd-pass-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.acd-pass-label { font: 500 10px/1.2 "Geist Mono", ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; color: color-mix(in srgb, var(--text) 55%, transparent); }
.acd-pass-top .acd-state { margin-left: 0; padding: 4px 10px 4px 9px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--text) 14%, transparent); background: color-mix(in srgb, var(--bg) 55%, transparent); color: var(--text); font-size: 13px; }
.acd-pass-name { position: relative; font-weight: 440; font-size: clamp(30px, 6vw, 40px); line-height: 1; letter-spacing: -.045em; }
.acd-pass-text { margin-top: 16px; }

/* the card on file, drawn: warm metal, the accent in its light, the four digits Stripe gives */
.acd-card { width: min(100%, 340px); aspect-ratio: 1.586; margin: 4px 0 6px; perspective: 900px; }
.acd-card[hidden] { display: none; }
.acd-card-in { position: relative; display: flex; flex-direction: column; justify-content: space-between; height: 100%; padding: 20px 22px; overflow: hidden; border-radius: 18px; border: 1px solid color-mix(in srgb, var(--text) 18%, transparent);
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 60%),
    radial-gradient(90% 80% at 0% 100%, color-mix(in srgb, var(--text) 10%, transparent), transparent 70%),
    linear-gradient(140deg, color-mix(in srgb, var(--text) 13%, var(--bg)), var(--bg) 72%);
  box-shadow: 0 24px 50px rgba(0, 0, 0, .45), inset 0 1px 0 color-mix(in srgb, var(--text) 14%, transparent);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .6s var(--ease-out, cubic-bezier(.16, 1, .3, 1)); will-change: transform; }
.acd-card-foot p[hidden] { display: none; }
.acd-card-top { position: relative; display: flex; align-items: center; justify-content: space-between; }
.acd-card-chip { position: relative; width: 40px; height: 30px; border-radius: 7px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 88%, #fff), color-mix(in srgb, var(--accent) 62%, #000)); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); }
.acd-card-chip i { position: absolute; inset: 7px 0; border-top: 1px solid rgba(0, 0, 0, .28); border-bottom: 1px solid rgba(0, 0, 0, .28); }
.acd-card-chip::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 12px; margin-left: -6px; border-left: 1px solid rgba(0, 0, 0, .28); border-right: 1px solid rgba(0, 0, 0, .28); }
.acd-card-brand { font-weight: 600; font-size: 19px; letter-spacing: -.02em; font-style: italic; text-transform: capitalize; }
.acd-card-number { position: relative; display: flex; gap: 14px; font: 500 19px/1 "Geist Mono", ui-monospace, monospace; letter-spacing: .08em; }
.acd-card-number i { font-style: normal; color: color-mix(in srgb, var(--text) 55%, transparent); letter-spacing: .12em; }
.acd-card-foot { position: relative; display: flex; justify-content: space-between; gap: 16px; }
.acd-card-foot p { display: grid; gap: 4px; min-width: 0; }
.acd-card-foot span { font: 500 9.5px/1.2 "Geist Mono", ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; color: color-mix(in srgb, var(--text) 50%, transparent); }
.acd-card-foot b { font-weight: 500; font-size: 14.5px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the invoices: a day, a sum, a state, and the way to the document */
.acd-list { list-style: none; }
.acd-list:empty { display: none; }
.acd-list li { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 4px 16px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; }

/* the end of the Account tab: what erases the account, apart and quiet */
.acd-end { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }

/* an action that ends something: red. The one that erases is a quiet line of text; its confirmation is a full red button. */
.btn-solid.acd-danger { background: var(--danger); color: var(--accent-ink); }
.acd-quiet { padding: 4px 0; color: color-mix(in srgb, var(--danger) 82%, var(--muted)); font-size: 15px; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--danger) 40%, transparent); text-underline-offset: 4px; transition: color var(--mi-fast, .18s), text-decoration-color var(--mi-fast, .18s), opacity var(--mi-fast, .18s); }
.acd-quiet[disabled] { opacity: .4; cursor: not-allowed; }
@media (hover: hover) {
  .acd-close:hover { background: var(--surface-high); color: var(--text); }
  .acd-seg button:hover { color: var(--text); }
  .btn-solid.acd-danger:hover { background: color-mix(in srgb, var(--danger) 86%, #fff); }
  .acd-quiet:not([disabled]):hover { color: var(--danger); text-decoration-color: var(--danger); }
}

/* the account's own address: nothing but the dialog on the page */
.acct-host { min-height: 100dvh; }

@media (max-width: 560px) {
  .acd { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 22px 22px 0 0; border-width: 1px 0 0; }
  .acd-head { padding: 22px 20px 0; }
  .acd-seg { margin: 18px 20px 0; align-self: stretch; }
  .acd-seg button { flex: 1; padding: 0 8px; }
  .acd-flash { margin: 16px 20px 0; }
  .acd-body { padding: 20px 20px 24px; }
  .acd-rows > div { grid-template-columns: 1fr; }
  .acd-list li { grid-template-columns: 1fr auto; }
  .acd-list li span:nth-child(3) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .acd[open], .acd::backdrop, .acd-panel { animation: none; }
  .acd-thumb { transition: none; }
  .acd-card-in, .acd-pass-in { transition: none; transform: none; }
}
