/* Presentation only: keep all account forms, identifiers and authentication handlers. */
html[data-interface-theme]:not([data-interface-theme="classic"]) #authenticationOverlay {
  --auth-accent:var(--theme-accent); --auth-accent-strong:var(--theme-accent-dark); --auth-rgb:var(--theme-rgb);
  --auth-soft:var(--theme-soft); --auth-surface:var(--theme-paper); --auth-ink:var(--theme-ink);
  background:var(--theme-canvas);
}
#authenticationOverlay { overflow-y:auto; padding:24px; align-items:center; background:var(--bg,#f8f6fc); }
#authenticationOverlay .authentication-desktop-shell {
  display:grid; width:min(460px,100%); min-height:0; max-height:none;
  grid-template-columns:minmax(0,1fr); grid-template-rows:auto;
  margin:auto; box-sizing:border-box; overflow:visible; border:0;
  border-radius:0; background:transparent; box-shadow:none; backdrop-filter:none;
}
#authenticationOverlay #authenticationCard {
  display:block; width:100%; min-width:0; max-width:none; padding:32px; box-sizing:border-box;
  overflow:visible; align-self:center; border:1px solid var(--border,#e5deed);
  border-radius:var(--composition-page-radius,24px); background:var(--surface,#fffdfd);
  box-shadow:0 16px 48px rgba(var(--primary-rgb,112,85,177),.08);
}
#authenticationOverlay #authenticationCard > .authentication-brand,
#authenticationOverlay #authenticationCard > .authentication-view { width:100%; min-width:0; }
#authenticationOverlay .authentication-story,
#authenticationOverlay .authentication-ambient { display:none; }
#authenticationOverlay #authenticationCard .authentication-brand-lockup { display:flex; align-items:center; justify-content:flex-start; width:100%; gap:12px; margin:0 0 24px; }
#authenticationOverlay .authentication-logo { width:44px; height:44px; border-radius:12px; }
#authenticationOverlay .authentication-wordmark { color:var(--tx,#29223f); font-size:28px; font-weight:750; line-height:1.2; }
#authenticationOverlay #authenticationBrandLine,
#authenticationOverlay .authentication-mobile-signature { display:none; }
#authenticationOverlay #authenticationCard .authentication-profile-switch { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; gap:4px; margin:0; padding:4px; border:1px solid var(--border,#e5deed); border-radius:var(--composition-control-radius,12px); background:var(--primary-bg,#eee8fa); }
#authenticationOverlay #authenticationCard .authentication-profile-option { min-height:44px; padding:10px; justify-content:center; font-size:14px; color:var(--tx-3,#6e647e); }
#authenticationOverlay #authenticationCard .authentication-profile-option.active { color:var(--primary-dk,#58408f); background:var(--surface,#fffdfd); box-shadow:0 2px 5px #29223f0a; }
#authenticationOverlay #authenticationCard .authentication-profile-option.active::after { display:none; }
#authenticationOverlay #authenticationCard .authentication-form,
#authenticationOverlay #authenticationCard .authentication-password-field { width:100%; min-width:0; }
#authenticationOverlay #authenticationCard .authentication-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
  width:100%; min-width:0; max-width:100%; box-sizing:border-box; min-height:48px; font-size:16px; font-weight:400;
}
#authenticationOverlay #authenticationCard .authentication-password-toggle { width:44px; height:44px; }
#authenticationOverlay #authenticationCard .authentication-submit,
#authenticationOverlay #authenticationCard .authentication-quick-demo { width:100%; min-height:48px; }
#authenticationOverlay #authenticationCard .authentication-submit { background:var(--primary,#7055b1); border-color:var(--primary,#7055b1); color:#fff; font-size:14px; box-shadow:0 4px 10px rgba(var(--primary-rgb,112,85,177),.12); }
#authenticationOverlay #authenticationCard :is(.authentication-text-action,.authentication-back,.authentication-secondary-action button) { color:var(--primary-dk,#58408f); }
#authenticationOverlay #authenticationCard .authentication-form input:not([aria-invalid="true"]):focus { border-color:var(--primary,#7055b1); box-shadow:0 0 0 3px rgba(var(--primary-rgb,112,85,177),.12); }
#authenticationOverlay #authenticationCard .authentication-heading { margin-bottom:20px; }
#authenticationOverlay #authenticationCard #loginView {
  display:block; height:auto; min-height:0; max-height:none;
}
#authenticationOverlay #authenticationCard #loginView[hidden] { display:none; }
#authenticationOverlay #authenticationCard #loginView > .authentication-heading {
  height:auto; min-height:0; flex:none; margin-bottom:20px;
}
#authenticationOverlay #authenticationCard .authentication-profile-context { min-height:0; }
#authenticationOverlay #authenticationCard .authentication-heading h1 { font-size:26px; line-height:1.25; }
#authenticationOverlay #authenticationCard .authentication-heading { text-align:left; }
#authenticationOverlay #authenticationCard .authentication-form label { font-size:13px; }
#authenticationOverlay #authenticationCard .authentication-text-action { font-size:13px; }
#authenticationOverlay #authenticationCard .authentication-brand { margin-bottom:24px; }
#authenticationOverlay #authenticationCard .authentication-status:empty { display:none; }
#authenticationOverlay #authenticationCard .authentication-label-row { flex-wrap:wrap; gap:4px 12px; }
#authenticationOverlay .authentication-desktop-status { display:flex; grid-column:1; min-height:0; padding:14px 4px 0; justify-content:center; flex-wrap:wrap; gap:6px; border:0; background:transparent; color:var(--tx-3,#6e647e); text-align:center; }
#authenticationOverlay .authentication-desktop-status strong { max-width:100%; overflow-wrap:anywhere; background:transparent; color:inherit; padding:0; font-size:11px; line-height:1.5; letter-spacing:0; text-transform:none; }
#authenticationOverlay .authentication-desktop-status span { display:none; }

/* Reset the desktop grid as well as the hidden story at intermediate widths. */
@media(max-width:1000px) {
  #authenticationOverlay { padding:24px 20px; }
  #authenticationOverlay .authentication-desktop-shell {
    display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:auto;
    width:min(460px,100%); min-height:0; max-height:none; overflow:visible;
    border:0; border-radius:24px; background:transparent; box-shadow:none; backdrop-filter:none;
  }
  #authenticationOverlay .authentication-story { display:none; }
  #authenticationOverlay #authenticationCard {
    display:block; width:100%; max-width:none; padding:28px;
    border:1px solid rgba(255,255,255,.85); border-radius:24px;
    background:var(--surface,#fffdfd);
    box-shadow:0 16px 48px #44316612;
  }
  #authenticationOverlay #authenticationCard .authentication-brand-lockup {
    display:flex; flex-direction:row; justify-content:flex-start; align-items:center;
    gap:12px; width:100%; margin-bottom:22px;
  }
  #authenticationOverlay .authentication-logo { width:44px; height:44px; border-radius:12px; }
  #authenticationOverlay .authentication-brand-copy { text-align:left; }
  #authenticationOverlay .authentication-wordmark { font-size:27px; line-height:1.2; }
  #authenticationOverlay #authenticationBrandLine,
  #authenticationOverlay .authentication-mobile-signature { display:none; }
  #authenticationOverlay #authenticationCard .authentication-heading h1 { font-size:24px; }
  #authenticationOverlay #authenticationCard .authentication-form input { font-size:16px; }
  #authenticationOverlay .authentication-desktop-status {
    display:flex; grid-column:1; justify-content:center; padding:14px 8px;
    min-height:0; border:0; background:transparent; text-align:center;
  }
  #authenticationOverlay .authentication-desktop-status span { display:none; }
}
@media(max-width:480px) {
  #authenticationOverlay { padding:max(16px,env(safe-area-inset-top)) 12px max(16px,env(safe-area-inset-bottom)); }
  #authenticationOverlay #authenticationCard { padding:24px 20px; }
}
@media(max-height:620px) {
  #authenticationOverlay { align-items:start; }
  #authenticationOverlay .authentication-desktop-shell { margin:0 auto; }
}

/* Published signup/recovery use their existing modal, outside the login card. */
html[data-interface-theme] dialog.account-access-modal { width:min(460px,calc(100vw - 24px)); border-color:var(--border,#e5deed); border-radius:var(--composition-page-radius,24px); padding:28px; background:var(--surface,#fffdfd); color:var(--tx,#29223f); font-family:var(--font); }
html[data-interface-theme] dialog.account-access-modal .authentication-heading { text-align:left; margin:18px 0 22px; }
html[data-interface-theme] dialog.account-access-modal .authentication-heading h1 { color:var(--tx,#29223f); font-size:26px; line-height:1.25; }
html[data-interface-theme] dialog.account-access-modal .authentication-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) { min-height:48px; font-size:16px; font-weight:400; border-color:var(--border,#e5deed); color:var(--tx,#29223f); background:var(--surface,#fffdfd); }
html[data-interface-theme] dialog.account-access-modal .authentication-form label { color:var(--tx-2,#29223f); font-size:13px; line-height:1.5; }
html[data-interface-theme] dialog.account-access-modal .authentication-form label:has(input[type="checkbox"]) { display:flex; align-items:flex-start; gap:8px; }
html[data-interface-theme] dialog.account-access-modal .authentication-submit { min-height:48px; width:100%; background:var(--primary,#7055b1); color:#fff; border-color:var(--primary,#7055b1); border-radius:var(--composition-control-radius,12px); }
html[data-interface-theme] dialog.account-access-modal .authentication-back { color:var(--primary-dk,#58408f); min-height:44px; }
html[data-interface-theme] dialog.account-access-modal p { font-size:13px; line-height:1.6; }
@media(max-width:480px) { html[data-interface-theme] dialog.account-access-modal { padding:22px 20px; } }
