:root { --action-menu-shadow:0 3px 10px rgba(var(--platform-background-rgb,238,244,240),0.2); --popup-border:1px solid rgba(var(--platform-surface-rgb,255,255,255),0.1803921568627451); }
/* Card measurements: approved reference /login, source 739ccd710d33b55df827a18bc180f701fb9bda22.
   Shared presentation for login, setup and password change; account logic is separate. */
.auth-page { min-height: 100dvh; display: grid; place-items: center; padding: calc(24px * var(--platform-spacing,1)) calc(20px * var(--platform-spacing,1)); }
.auth-content { --auth-card-width:560px; width: min(100%, var(--auth-card-width)); padding: calc(40px * var(--platform-spacing,1)); border: 0; border-radius: calc(10px * var(--platform-radius-scale,1)); background: var(--brand); box-shadow: none; color: var(--platform-popupText,var(--platform-onPrimary,white)); font-weight: 600; line-height: 1.65; }
.auth-header { margin-bottom: 30px; text-align: center; }
.auth-header :is(h1,h2) { margin: 0; color: var(--platform-popupHeading,var(--platform-onPrimary,white)); font-size: calc(30px * var(--platform-font-scale,1)); font-weight: 900; line-height: 1.4; }
.auth-header > span { display: block; width: 120px; height: 2px; margin: 16px auto 0; background: var(--platform-accent,#f0ad4e); }
.auth-content form { display: grid; gap: calc(20px * var(--platform-spacing,1)); }
.auth-field { display: grid; gap: calc(7px * var(--platform-spacing,1)); text-align: start; }
.auth-field > label,.auth-field-heading > label { color: var(--platform-onPrimary,white); font-size: calc(16px * var(--platform-font-scale,1)); font-weight: 700; line-height: 1.5; }
.auth-content input { width: 100%; min-height: 50px; padding: calc(10px * var(--platform-spacing,1)) calc(14px * var(--platform-spacing,1)); appearance: none; border: 1px solid var(--platform-border,#dcdcde); border-radius: calc(8px * var(--platform-radius-scale,1)); background: var(--platform-surface,white); box-shadow: none; color: var(--platform-text,#1e293b); font: 600 calc(16px * var(--platform-font-scale,1))/1.5 var(--platform-font,Cairo,sans-serif); outline: none; text-align: start; }
.auth-content input:focus { border-color: var(--brand); box-shadow: none; outline: none; }
.auth-content input[aria-invalid='true'] { border-color: #b42318; }
.auth-content p { margin: 0; font-size: calc(13px * var(--platform-font-scale,1)); line-height: 1.6; }
.auth-content :is(#form-error,#password-error) { color: #ffd9d5; font-weight: 700; }
.auth-content :is(#form-error,#password-error,#password-success):empty { display: none; }
#password-success { padding: calc(10px * var(--platform-spacing,1)) calc(12px * var(--platform-spacing,1)); border: 1px solid #ffffff73; border-radius: calc(8px * var(--platform-radius-scale,1)); color: white; text-align: center; line-height: 1.7; }
.auth-submit { display: inline-flex; width: fit-content; min-width: min(152px,100%); max-width: 100%; min-height: 46px; align-items: center; justify-content: center; justify-self: center; padding: calc(8px * var(--platform-spacing,1)) calc(28px * var(--platform-spacing,1)); border: 1px solid var(--platform-surface,white); border-radius: calc(8px * var(--platform-radius-scale,1)); background: var(--platform-surface,white); color: var(--brand); font-size: calc(18px * var(--platform-font-scale,1)); font-weight: 700; line-height: 1.4; }
.auth-submit:disabled { opacity:1; cursor: default; }
#factor-dialog .auth-submit:disabled { cursor: default; }
.auth-cancel,#password-login { width: fit-content; justify-self: center; padding: 0; border: 0; border-radius: calc(4px * var(--platform-radius-scale,1)); background: transparent; color: var(--platform-onPrimary,white); font-size: calc(14px * var(--platform-font-scale,1)); font-weight: 700; line-height: 1.6; text-decoration: underline; text-underline-offset: 4px; }
.auth-content :is(.auth-submit,.auth-cancel,a):focus-visible { outline: 2px solid var(--platform-surface,white); outline-offset: 3px; }
.auth-content [hidden] { display: none; }
.password-field { --password-action-color:var(--platform-muted,#475569); position: relative; min-width: 0; }
.auth-content .password-field input { padding-left: calc(54px * var(--platform-spacing,1)); padding-right: calc(14px * var(--platform-spacing,1)); }
.password-field-actions { position:absolute; inset-inline-end:8px; top:50%; transform:translateY(-50%); display:flex; align-items:center; }
.password-eye { display:grid; place-items:center; width:42px; height:42px; min-height:42px; flex:0 0 42px; padding:0; border:0; border-radius:calc(8px * var(--platform-radius-scale,1)); background:transparent; box-shadow:none; color:var(--password-action-color); }
.password-field--tools .password-eye { width:36px; height:40px; min-height:40px; flex-basis:36px; }
.auth-content .password-field--tools input { padding-left:calc(124px * var(--platform-spacing,1)); }
.auth-content .password-field:dir(ltr) input { padding-left:calc(14px * var(--platform-spacing,1)); padding-right:calc(54px * var(--platform-spacing,1)); }
.auth-content .password-field--tools:dir(ltr) input { padding-right:calc(124px * var(--platform-spacing,1)); }
.password-eye svg { width: 22px; height: 22px; }
.password-eye:focus-visible { outline: none; background: var(--brand); color: var(--platform-onPrimary,white); }
.password-eye .eye-slash { display: none; }
.password-eye[aria-pressed='true'] .eye-slash { display: block; }
.auth-content input::-ms-reveal { display: none; }
.password-dialog { max-width: calc(100% - 40px); margin: auto; max-height: calc(100dvh - 32px); overflow-y: auto; }
.password-dialog::backdrop { background: rgba(var(--platform-heading-rgb,0,0,0),0.35); }
@media (max-width: 1024px) {
  .auth-content { --auth-card-width:520px; width: min(100%, var(--auth-card-width)); padding: calc(36px * var(--platform-spacing,1)); }
  .auth-header :is(h1,h2) { font-size: calc(28px * var(--platform-font-scale,1)); }
}
@media (max-width: 767px) {
  .auth-content { padding: calc(30px * var(--platform-spacing,1)) calc(24px * var(--platform-spacing,1)); }
  .auth-header { margin-bottom: 26px; }
  .auth-content form { gap: calc(18px * var(--platform-spacing,1)); }
}
@media (max-width: 544px) {
  .auth-content { padding: calc(24px * var(--platform-spacing,1)) calc(20px * var(--platform-spacing,1)); }
  .auth-header :is(h1,h2) { font-size: calc(25px * var(--platform-font-scale,1)); }
  .auth-header > span { width: 100px; }
  .auth-content input { min-height: 48px; }
}
@media (forced-colors: active) {
  .auth-content { border: 1px solid CanvasText; }
  .auth-header > span { background: CanvasText; }
  .auth-content input:focus { border-color: Highlight; }
}

.navigation-footer { flex-wrap: wrap; }
#logout-error { margin: 0; padding: 0 calc(10px * var(--platform-spacing,1)); color: #b42318; }
#logout-error:empty { display: none; }
.account-settings { position: static; margin-inline-end: 0; }
.account-settings summary { cursor: pointer; list-style: none; }
.account-settings summary::-webkit-details-marker { display: none; }
.account-panel { box-shadow:var(--action-menu-shadow); position: absolute; z-index: 6; top: var(--account-menu-top,calc(100% + 8px)); inset-inline: -1px; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); padding: calc(6px * var(--platform-spacing,1)); border: 1px solid rgba(var(--platform-surface-rgb,255,255,255),0.1803921568627451); border-radius: calc(8px * var(--platform-radius-scale,1)); background: var(--brand); color: var(--platform-onPrimary,white); }
.account-panel button { display: flex; align-items: center; justify-content:center; gap:0; width:100%; height:40px; min-height:40px; padding:0; border: 0; border-radius: calc(4px * var(--platform-radius-scale,1)); background: transparent; color: inherit; text-align: start; font-size: calc(14px * var(--platform-font-scale,1)); font-weight: 800; }
.account-panel button svg { flex: 0 0 20px; }
.account-panel button:focus-visible { outline:2px solid var(--platform-surface,white); outline-offset:-2px; background:transparent; color:var(--platform-onPrimary,white); }
.shell[data-collapsed='true'] .account-settings { margin-inline: 0; }
.auth-content button { text-decoration: none; }

/* Paint only the autofilled interior white; retain the single existing border. */
.auth-content input:is(:autofill, :-webkit-autofill) {
  box-shadow: 0 0 0 1000px var(--platform-surface,white) inset;
  -webkit-text-fill-color: var(--platform-text,#1e293b);
  caret-color: var(--platform-text,#1e293b);
}
@media (forced-colors: active) {
  .auth-content input:is(:autofill, :-webkit-autofill) { box-shadow: none; -webkit-text-fill-color: CanvasText; }
}

.password-tools { display: grid; gap: calc(8px * var(--platform-spacing,1)); margin-top: 3px; }
.password-requirements { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: calc(6px * var(--platform-spacing,1)) calc(14px * var(--platform-spacing,1)); font-size: calc(12px * var(--platform-font-scale,1)); line-height: 1.7; }
.password-requirements li { display: inline-flex; align-items: center; gap: calc(6px * var(--platform-spacing,1)); white-space: nowrap; }
.password-requirements li > span[aria-hidden] { flex: 0 0 10px; text-align: center; color: #ffd9d5; }
.password-requirements li[data-met='true'] > span[aria-hidden] { color: var(--platform-onPrimary,white); }
.password-rule-label { unicode-bidi: plaintext; }
.password-tool-actions { display:flex; align-items:center; }
.password-tool-actions button { display:grid; place-items:center; width:36px; height:40px; min-height:40px; flex:0 0 36px; padding:0; border:0; border-radius:calc(6px * var(--platform-radius-scale,1)); background:transparent; color:var(--password-action-color); }
.password-tool-actions svg { width:20px; height:20px; }
.password-tool-actions button:focus-visible { outline:none; background:var(--brand); color:var(--platform-onPrimary,white); }
.password-field-heading { display:flex; align-items:baseline; gap:calc(6px * var(--platform-spacing,1)) calc(12px * var(--platform-spacing,1)); }
.password-field-heading > label { flex:0 0 auto; color:var(--platform-onPrimary,white); font-size:calc(16px * var(--platform-font-scale,1)); font-weight:700; line-height:1.5; }
.password-field-heading .password-tool-status { min-width:0; font-size:calc(12px * var(--platform-font-scale,1)); text-align:start; }
.password-tool-status:empty { display: none; }

.account-panel .factor-settings-link { text-decoration:none; display:flex; align-items:center; justify-content:center; gap:0; min-height:40px; padding:0; border-radius:calc(4px * var(--platform-radius-scale,1)); color:inherit; font-size:calc(14px * var(--platform-font-scale,1)); font-weight:800; }
.factor-settings-link svg { flex:0 0 20px; }
.factor-settings-link:focus-visible { outline:2px solid var(--brand); outline-offset:-2px; }
.factor-panel { display:grid; gap:calc(20px * var(--platform-spacing,1)); }
.factor-qr { display:block; width:240px; max-width:100%; height:auto; margin:auto; }
.factor-secret { overflow-wrap:anywhere; direction:ltr; text-align:center; user-select:all; }
.factor-codes { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:calc(8px * var(--platform-spacing,1)); padding:calc(12px * var(--platform-spacing,1)); border:1px solid rgba(var(--platform-surface-rgb,255,255,255),0.45098039215686275); border-radius:calc(8px * var(--platform-radius-scale,1)); direction:ltr; text-align:center; font-family:monospace; font-size:calc(15px * var(--platform-font-scale,1)); }
.factor-saved { display:flex; gap:calc(10px * var(--platform-spacing,1)); align-items:flex-start; font-size:calc(14px * var(--platform-font-scale,1)); }
.auth-content .factor-saved input { appearance:auto; width:20px; min-width:20px; min-height:20px; height:20px; margin:2px 0; accent-color:var(--platform-surface,white); }
.factor-panel a { color:var(--platform-onPrimary,white); }
#factor-status:empty { display:none; }

.factor-method { display:flex; align-items:center; justify-content:space-between; gap:calc(16px * var(--platform-spacing,1)); font-weight:700; }
.factor-switch { display:inline-flex; align-items:center; justify-content:center; gap:calc(8px * var(--platform-spacing,1)); flex-shrink:0; padding:calc(5px * var(--platform-spacing,1)) 0; min-height:44px; border:0; background:transparent; color:var(--platform-onPrimary,white); font:inherit; font-size:calc(13px * var(--platform-font-scale,1)); }
.factor-switch-track { position:relative; display:block; width:46px; height:26px; border:1px solid var(--platform-surface,white); border-radius:calc(20px * var(--platform-radius-scale,1)); background:transparent; }
.factor-switch-track::after { content:''; position:absolute; top:3px; left:3px; width:18px; height:18px; background:var(--platform-surface,white); border-radius:50%; }
.factor-switch[aria-checked='true'] .factor-switch-track { background:var(--platform-surface,white); }
.factor-switch[aria-checked='true'] .factor-switch-track::after { left:23px; background:var(--brand); }
.factor-switch:focus-visible { outline:2px solid var(--platform-surface,white); outline-offset:4px; border-radius:calc(4px * var(--platform-radius-scale,1)); }
.factor-switch:disabled { opacity:1; cursor:default; }
#factor-dialog-error { color:#ffd9d5; font-weight:700; }
#factor-dialog-error:empty { display:none; }

.factor-state-icon, #factor-dialog-submit svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; }
#factor-dialog-submit { gap:calc(8px * var(--platform-spacing,1)); }
.factor-method > span { min-width:0; }
#factor-settings-dialog .factor-switch { gap:calc(6px * var(--platform-spacing,1)); }
#factor-settings-dialog { overscroll-behavior:contain; }

.auth-remember { display:flex; align-items:center; gap:calc(10px * var(--platform-spacing,1)); width:fit-content; font-size:calc(14px * var(--platform-font-scale,1)); font-weight:700; cursor:pointer; }
.auth-content .auth-remember input { appearance:none; width:20px; min-width:20px; height:20px; min-height:20px; padding:0; margin:0; border:1px solid var(--platform-border,#dcdcde); border-radius:calc(8px * var(--platform-radius-scale,1)); background:var(--platform-surface,white); box-shadow:none; cursor:pointer; transition:none; }
.auth-content .auth-remember input:focus-visible { outline:2px solid var(--platform-surface,white); outline-offset:3px; }
.factor-method + .factor-method { border-top:1px solid var(--platform-border,#dcdcde); padding-top:calc(20px * var(--platform-spacing,1)); }

.auth-content .auth-remember input:checked { background:white url('/admin-assets/remember-check.svg') center/18px 18px no-repeat; }
.auth-content .confirm-actions { display:flex; justify-content:center; gap:calc(16px * var(--platform-spacing,1)); width:100%; max-width:320px; margin:20px auto 0; }
.confirm-actions .auth-submit { flex:0 1 152px; width:152px; min-width:0; min-height:46px; padding:calc(8px * var(--platform-spacing,1)) calc(12px * var(--platform-spacing,1)); background:var(--platform-surface,white); color:var(--brand); }
.auth-content .confirm-message { margin:0; font-size:calc(24px * var(--platform-font-scale,1)); font-weight:800; line-height:1.6; text-align:center; }
.confirmation-dialog::backdrop { background:transparent; }

.confirm-preview { display:block; width:160px; height:160px; max-width:100%; margin:18px auto 0; object-fit:contain; border-radius:calc(8px * var(--platform-radius-scale,1)); background:var(--platform-surface,white); }
dialog.auth-content { padding-top:calc(58px * var(--platform-spacing,1)); border:var(--popup-border); box-shadow:var(--action-menu-shadow); }
.dialog-close { position:absolute; top:10px; inset-inline-end:10px; display:grid; place-items:center; width:40px; height:40px; padding:0; border:0; border-radius:calc(8px * var(--platform-radius-scale,1)); background:transparent; color:var(--platform-onPrimary,white); }
.dialog-close svg { width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:2; }
.dialog-close:focus-visible { outline:2px solid var(--platform-surface,white); outline-offset:1px; }
.dialog-close:disabled { cursor:default; opacity:1; }
@media(max-width:544px) { .auth-content .confirm-message { font-size:calc(22px * var(--platform-font-scale,1)); } }

/* Dashboard action palette; public/account pages do not carry this scope. */
body[data-dashboard] :is(.auth-submit,button.auth-cancel) {
  background:var(--brand); color:var(--platform-onPrimary,#fff);
}
body[data-dashboard] .auth-submit { border-color:var(--brand); }
body[data-dashboard] .auth-content .auth-submit { border-color:rgba(var(--platform-surface-rgb,255,255,255),0.45098039215686275); }
/* Account tabs share the existing white/green account controls. */
.auth-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:calc(10px * var(--platform-spacing,1)); margin-bottom:30px; }
.auth-tabs [role='tab'] { min-width:0; min-height:46px; padding:calc(8px * var(--platform-spacing,1)); border:1px solid var(--platform-surface,white); border-radius:calc(8px * var(--platform-radius-scale,1)); background:transparent; color:var(--platform-onPrimary,white); font:700 calc(16px * var(--platform-font-scale,1))/1.5 var(--platform-font,Cairo,sans-serif); cursor:pointer; }
.auth-tabs [aria-selected='true'] { background:var(--platform-surface,white); color:var(--brand); }
.auth-tabs [role='tab']:focus-visible { outline:2px solid var(--platform-surface,white); outline-offset:3px; }
@media(max-width:360px) { .auth-tabs [role='tab'] { padding-inline:calc(4px * var(--platform-spacing,1)); font-size:calc(15px * var(--platform-font-scale,1)); white-space:nowrap; } }
#register-form .auth-submit:disabled { cursor:default; }

/* Copy feedback shares the contact disclosure palette without adding a form row. */
.password-copy-tooltip { position:absolute; bottom:calc(100% + 6px); left:50%; transform:translateX(-50%); z-index:10; width:max-content; max-width:100%; padding:calc(6px * var(--platform-spacing,1)) calc(12px * var(--platform-spacing,1)); background:var(--platform-surface,white); color:var(--platform-primary,#005a3d); border-radius:calc(8px * var(--platform-radius-scale,1)); box-shadow:0 2px 12px #0003; text-align:center; font:700 calc(14px * var(--platform-font-scale,1))/1.6 var(--platform-font,Cairo,sans-serif); box-sizing:border-box; overflow-wrap:anywhere; }


.auth-field-heading { display:flex; align-items:center; justify-content:space-between; gap:calc(12px * var(--platform-spacing,1)); }
.auth-field-heading .auth-forgot { flex-shrink:0; }

@media(max-width:360px) { .auth-field-heading { gap:calc(8px * var(--platform-spacing,1)); } .auth-field-heading .auth-forgot { font-size:calc(13px * var(--platform-font-scale,1)); } .auth-field-heading > label { white-space:nowrap; } }

.dialog-close[data-dialog-back]:dir(ltr) svg { transform:rotate(180deg); }

#register-form .auth-submit,#student-register-form .auth-submit{background:var(--platform-surface,#fff);color:var(--brand,var(--platform-primary,#005a3d));font-weight:700;opacity:1}

/* No pointer or autofocus ring on icons. Keyboard focus emphasizes the glyph itself. */
html body :is(button:has(>svg),.dialog-close):focus{outline:0!important;box-shadow:none!important}
html body :is(button:has(>svg),.dialog-close):focus-visible>svg{scale:1.12;stroke-width:2.5}

/* Account recovery and code actions use plain text without underlines. */
.site-auth-main .auth-cancel,.site-auth-main #password-login{text-decoration:none}

#recovery-password-fields:not([hidden]){display:grid;gap:calc(20px * var(--platform-spacing,1))}

