@import url('../clientSelection/portal-tokens.css');

/* Light-first access screen; the shared tokens own all paint and control geometry. */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { color: var(--ds-text); background: var(--ds-bg); font-family: var(--ds-font-family); line-height: var(--ds-line-height); }
.hidden { display: none; }
main { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: var(--ds-space-6); }
#loginWrapper { width: 100%; max-width: 400px; display: flex; flex-direction: column; align-items: center; }
#loginCard { width: 100%; padding: var(--ds-space-8); background: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-card); box-shadow: var(--ds-shadow-sm); }
#loginSubtitle { margin:0 0 var(--ds-space-5); font-size:1.65rem; font-weight:var(--ds-weight-semibold); letter-spacing:-.025em; }
form { display: flex; flex-direction: column; }
label { margin-bottom: var(--ds-space-2); color: var(--ds-text); font-size: var(--ds-font-size-sm); font-weight: var(--ds-weight-medium); }
.input, select { width: 100%; min-height: var(--ds-target-size); padding: var(--ds-space-2) var(--ds-space-3); margin-bottom: var(--ds-space-4); border: 1px solid var(--ds-control-border); border-radius: var(--ds-radius-control); color: var(--ds-text); background: var(--ds-surface); font: inherit; font-size: var(--ds-font-size-body); }
.input:focus-visible, select:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: 2px; }
button { min-height: var(--ds-target-size); margin-top: var(--ds-space-4); padding: var(--ds-space-2) var(--ds-space-4); border: 1px solid var(--ds-action); border-radius: var(--ds-radius-control); color: var(--ds-on-action); background: var(--ds-action); font: inherit; font-weight: var(--ds-weight-semibold); cursor: pointer; transition: background-color var(--ds-motion-feedback) var(--ds-ease-standard), border-color var(--ds-motion-feedback) var(--ds-ease-standard); }
button:hover:not(:disabled) { background: var(--ds-action-hover); border-color: var(--ds-action-hover); }
button:active:not(:disabled) { background: var(--ds-action-active); border-color: var(--ds-action-active); }
button:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: 3px; }
button:disabled { color: var(--ds-disabled-text); background: var(--ds-disabled-bg); border-color: var(--ds-border); cursor: not-allowed; }
.errorMsg { margin-top: var(--ds-space-3); padding: var(--ds-space-3); border: 1px solid var(--ds-danger-border); border-radius: var(--ds-radius-control); color: var(--ds-danger-text); background: var(--ds-danger-bg); font-size: var(--ds-font-size-sm); }
#loadingScreen { position: fixed; inset: 0; z-index: var(--ds-z-loading); display: grid; place-items: center; background: var(--ds-bg); }
.loaderContent { display: grid; place-items: center; gap: var(--ds-space-4); color: var(--ds-text-secondary); }
.spinner { width: 36px; height: 36px; border: 3px solid var(--ds-border); border-top-color: var(--ds-action); border-radius: var(--ds-radius-pill); animation: spin var(--ds-motion-loading) linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#loadingScreen.loadingHidden, .loadingHidden { display: none; }
.login-remember { display: flex; align-items: center; gap: var(--ds-space-2); min-height: var(--ds-target-size); margin: 0; cursor: pointer; font-weight: var(--ds-weight-regular); }
.login-remember input { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; accent-color: var(--ds-action); }
@media (max-width: 480px) { main { padding: var(--ds-space-4); } #loginCard { padding: var(--ds-space-6); } }
#loginCard [hidden] { display: none; }
#mfaForm, #accountSecurity, #recoveryKit { display: grid; gap: var(--ds-space-3); }
#manualKey, #recoveryList, #deviceList { overflow-wrap: anywhere; }
#enrollQr { max-width: 100%; height: auto; }
#accountSecurity { margin-bottom: var(--ds-space-6); }

body { background:var(--ds-dashboard-bg); }
#loginWrapper { max-width:28rem; }
#loginWrapper:has(#accountSecurity:not([hidden])) { max-width:44rem; }
#loginCard :is(h2,#securityTitle) { font-weight:var(--ds-weight-semibold); letter-spacing:-.02em; }
.login-password-label { display:flex; justify-content:space-between; align-items:baseline; flex-wrap:wrap; gap:var(--ds-space-2); }
#loginCard a { color:var(--ds-link); font-size:var(--ds-font-size-sm); text-underline-offset:.18em; }
#identityLinks { display:grid; gap:var(--ds-space-3); margin-top:var(--ds-space-5); text-align:center; }
#identityLinks .google { margin:0; }
#deviceList { list-style:none; }
#deviceList li { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:var(--ds-space-1) var(--ds-space-4); border-block-end:1px solid var(--ds-border); padding-block:var(--ds-space-3); }
#deviceList small { grid-column:1; color:var(--ds-text-secondary); }
#deviceList button { grid-column:2; grid-row:1 / 3; align-self:center; margin:0; }
#accountSecurity button { background:var(--ds-surface); color:var(--ds-text); border-color:var(--ds-control-border); }
#mfaForm .input { margin:0; }
#recoveryList { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,12rem),1fr)); gap:var(--ds-space-2); padding-inline-start:1.25rem; }

#accountSecurity button:hover:not(:disabled) { background:var(--ds-surface-raised); }
