/* Shared authentication surface. Does not restyle Biblioteca or profile forms. */
:is(.mley-auth, .mley-auth-panel) { --auth-on-accent:#fff; }
:root[data-theme="dark"] :is(.mley-auth, .mley-auth-panel) { --auth-on-accent:#17212b; }
.mley-auth .mley-account-card { width:min(28rem, calc(100% - 2rem)); margin:clamp(1.25rem,6vh,3.5rem) auto; padding:clamp(1.25rem,5vw,2rem); border-radius:16px; box-shadow:none; }
.mley-auth .mley-account-card h1 { font-size:clamp(1.65rem,5vw,2rem); line-height:1.2; margin:0 0 1.25rem; text-align:left; }
.mley-auth-panel { max-width:32rem; }
:is(.mley-auth, .mley-auth-panel) .mley-account-field { display:grid; gap:.4rem; margin-block:1rem; }
.mley-auth-label-row { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:.35rem .75rem; }
.mley-auth-label-row label { margin:0; font-weight:600; }
.mley-auth-label-row a { font-size:var(--text-small); }
:is(.mley-auth, .mley-auth-panel) input:not([type="hidden"]):not([type="checkbox"]):not([type="color"]) { box-sizing:border-box; width:100%; min-width:0; min-height:48px; padding:.65rem .85rem; border:1px solid var(--border-color); border-radius:10px; background:var(--bg-surface-2); color:var(--text-color); font:inherit; transition:border-color .15s,background-color .15s,box-shadow .15s; }
:is(.mley-auth, .mley-auth-panel) input::placeholder { color:var(--text-muted); }
:is(.mley-auth, .mley-auth-panel) input:not([type="hidden"]):hover { border-color:var(--border-strong); }
:is(.mley-auth, .mley-auth-panel) input:not([type="hidden"]):focus-visible { background:var(--bg-surface); border-color:var(--accent-color); outline:2px solid var(--accent-color); outline-offset:1px; box-shadow:0 0 0 4px var(--surface-accent); }
:is(.mley-auth, .mley-auth-panel) input[aria-invalid="true"], :is(.mley-auth, .mley-auth-panel) input:user-invalid { border-color:var(--chip-danger-text); }
.mley-auth-password { position:relative; }
:is(.mley-auth, .mley-auth-panel) .mley-auth-password input { padding-inline-end:3.5rem; }
:is(.mley-auth, .mley-auth-panel) button.mley-auth-reveal { position:absolute; inset-inline-end:3px; top:2px; display:grid; place-items:center; width:44px; height:44px; padding:0; border:0; border-radius:8px; background:transparent; color:var(--text-muted); cursor:pointer; }
:is(.mley-auth, .mley-auth-panel) button.mley-auth-reveal:hover { background:var(--surface-accent); color:var(--accent-color); }
.mley-auth-reveal[hidden], .mley-auth-reveal [hidden] { display:none !important; }
:is(.mley-auth, .mley-auth-panel) .mley-auth-submit { display:flex; align-items:center; justify-content:center; box-sizing:border-box; width:100%; min-height:48px; margin-top:.5rem; padding:.65rem 1rem; border:1px solid var(--accent-color); border-radius:10px; background:var(--accent-color); color:var(--auth-on-accent); font:inherit; font-weight:650; cursor:pointer; text-decoration:none; }
:is(.mley-auth, .mley-auth-panel) .mley-auth-submit:hover { background:var(--accent-color); color:var(--auth-on-accent); filter:brightness(.94); }
:is(.mley-auth, .mley-auth-panel) .mley-auth-submit:disabled { background:var(--surface-muted); border-color:var(--border-color); color:var(--text-muted); cursor:wait; filter:none; }
.mley-auth a, .mley-auth-panel a:not(.mley-auth-submit) { color:var(--accent-color); text-decoration:none; font-weight:600; }
.mley-auth a:hover, .mley-auth-panel a:not(.mley-auth-submit):hover { text-decoration:underline; color:var(--accent-color); }
:is(.mley-auth, .mley-auth-panel) :is(a,button):focus-visible { outline:2px solid var(--accent-color); outline-offset:2px; }
.mley-auth-footer { margin-top:1.5rem; padding-top:1rem; border-top:1px solid var(--border-color); text-align:center; font-size:var(--text-small); color:var(--text-muted); }
.mley-auth-footer p { margin:0; }
.mley-auth-footer a { display:inline-flex; align-items:center; min-height:44px; }
.mley-auth .mley-login-providers { grid-template-columns:minmax(0,1fr); margin-block:0; }
.mley-auth .mley-login-providers form { margin:0; }
.mley-auth .mley-login-providers button { width:100%; min-height:48px; border:1px solid var(--border-color); border-radius:10px; color:var(--text-color); background:var(--bg-surface); font-weight:600; }
.mley-auth .mley-login-providers button:hover:not(:disabled) { background:var(--bg-surface-2); }
.mley-auth .mley-login-providers button:disabled { color:var(--text-muted); background:var(--surface-muted); cursor:default; }
.mley-auth .mley-login-preview { font-size:var(--text-caption); }
.mley-auth-divider { display:flex; align-items:center; gap:.75rem; margin:1.25rem 0; color:var(--text-muted); font-size:var(--text-small); text-align:center; }
.mley-auth-divider::before, .mley-auth-divider::after { content:""; flex:1; min-width:.5rem; height:1px; background:var(--border-color); }
.mley-auth-status { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
@media (max-width:480px) { .mley-auth .mley-account-header { padding-inline:1rem; } .mley-auth-label-row a { min-height:44px; display:inline-flex; align-items:center; } }
@media (prefers-reduced-motion:reduce) { :is(.mley-auth,.mley-auth-panel) input { transition:none !important; } }

.mley-auth-retry { display:grid; gap:1rem; text-align:center; }
.mley-auth-panel .mley-account-actions { display:grid; grid-template-columns:minmax(0,1fr); justify-content:stretch; gap:.75rem; text-align:center; }
.mley-auth-cancel { display:inline-flex; justify-content:center; align-items:center; min-height:44px; }
