    * { box-sizing: border-box; }
    body { -webkit-user-select: none; user-select: none; }
    input { -webkit-user-select: text; user-select: text; }
    body[data-theme="light"] {
      background-color: #edc7c3;
      background-image:
        radial-gradient(ellipse at 48% 38%, #fff3e9 0%, #fff3e900 58%),
        radial-gradient(ellipse at 8% 85%, #fbe5dd 0%, #fbe5dd00 52%),
        radial-gradient(ellipse at 94% 12%, #f9dfd6 0%, #f9dfd600 48%),
        linear-gradient(125deg, #e6bdbb 0%, #f2d5cb 48%, #eac0c1 100%);
      background-attachment: fixed;
    }
    .themes { position: fixed; top: 20px; right: 20px; display: flex; gap: 4px; padding: 4px; border: 1px solid #ffffff26; border-radius: 999px; background: #242428; }
    .theme-button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #b8b8c0; cursor: pointer; }
    .theme-button[aria-pressed="true"] { background: #45454d; color: #ffffff; }
    .theme-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
    body[data-theme="light"] .themes { background: #fffaf7; border-color: #d9ccc5; }
    body[data-theme="light"] .theme-button { color: #76665f; }
    body[data-theme="light"] .theme-button[aria-pressed="true"] { background: #eadbd2; color: #4c1712; }
    body { margin: 0; min-height: 100vh; min-height: 100svh; display: grid; place-items: center; background: #111113; color: #f4f4f5; font-family: Arial, sans-serif; padding: 32px 24px; }
    main { width: 100%; max-width: 480px; padding: 24px 48px 36px; border: 1px solid #ffffff; border-radius: 24px; background: #fbf2ee; color: #4c1712; box-shadow: 0 24px 80px #00000040; }
    .login-shell { width: 100%; max-width: 480px; }
    .logo { position: relative; z-index: 1; display: block; width: 280px; max-width: 75%; height: auto; margin: 0 auto -20px; }
    .login-shell main { position: relative; padding-top: 36px; }
    .eyebrow { margin-bottom: 24px; color: #a25c56; font-size: .75rem; font-weight: 600; letter-spacing: .25em; text-transform: uppercase; }
    .input-wrap { position: relative; }
    .input-wrap input { padding-left: 50px; background: #fffaf780; border-color: #edd4cc; }
    .input-wrap svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
    .field-icon { position: absolute; left: 16px; top: 15px; pointer-events: none; }
    #password { padding-right: 48px; }
    .toggle { position: absolute; right: 6px; top: 4px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; color: #6c302b; cursor: pointer; }
    .options { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: -8px; }
    .remember { display: flex; align-items: center; gap: 8px; color: #777176; font-size: .875rem; }
    .remember input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: #a76b6d; }
    .divider { border-top: 1px solid #e6c8c1; margin-top: 24px; }
    header { text-align: center; margin-bottom: 32px; }
    h1 { margin: 0 0 12px; font-family: Georgia, serif; font-size: clamp(2rem, 6vw, 2.5rem); font-weight: 500; letter-spacing: -1px; }
    header p { margin: 0; color: #777176; font-size: 1rem; line-height: 1.5; }
    form { display: flex; flex-direction: column; gap: 24px; }
    .field { display: flex; flex-direction: column; gap: 10px; }
    label, .field-label { font-size: 1rem; font-weight: 500; }
    input { width: 100%; min-height: 52px; padding: 14px 16px; border: 1px solid #e4d4d4; border-radius: 10px; background: #ffffff; color: #34262c; font: inherit; color-scheme: light; }
    input::placeholder { color: #969096; }
    input:focus { outline: none; border-color: #ba8a80; }
    button:focus-visible { outline: 2px solid #ba8a80; outline-offset: 3px; }
    .enter { min-height: 52px; border: 0; border-radius: 10px; background: #ad747b; color: #ffffff; font-family: Arial, sans-serif; font-size: 1rem; font-weight: 600; cursor: pointer; box-shadow: none; transition: background-color .18s ease; }
    @media (hover: hover) { .enter:hover { background-color: #9b646b; } }
    .enter:active { background-color: #8e5960; }
    @media (prefers-reduced-motion: reduce) { .enter { transition: none; } }
    .forgot { align-self: center; border: 0; padding: 4px; background: transparent; color: #965f65; font: inherit; font-size: .875rem; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
    .forgot:hover { color: #633b40; }
    .status { margin: 0; color: #777176; font-size: .875rem; line-height: 1.5; text-align: center; }
    .status:empty { display: none; }
    body { align-items: center; padding: 32px 24px; }
    .themes { z-index: 5; }
    .login-shell { max-width: 440px; }
    .logo { width: 340px; margin-bottom: -14px; }
    .login-shell main { max-width: 440px; padding: 28px 32px; border-radius: 22px; background: linear-gradient(135deg, #fffaf5c9, #f8eee8d9); backdrop-filter: blur(10px); box-shadow: 0 12px 36px #aa6d5020, inset 0 0 24px #ffffff55; }
    .eyebrow { margin-bottom: 24px; }
    h1 { font-weight: 600; margin-bottom: 8px; }
    header { margin-bottom: 24px; }
    header p { max-width: 320px; margin-inline: auto; line-height: 1.4; }
    form { gap: 20px; }
    .field { gap: 6px; }
    input { min-height: 56px; }
    .field-icon { top: 17px; }
    .toggle { top: 6px; }
    .options { margin-top: -6px; }
    .remember input { appearance: none; border: 2px solid #a5786e; border-radius: 4px; padding: 0; background: transparent; width: 20px; height: 20px; }
    .remember input:checked { background: #a5786e; box-shadow: inset 0 0 0 3px #fbf2ee; }
    .forgot { color: #b45760; padding-right: 0; }
    @media (max-width: 540px) { .login-shell main { padding: 24px; } .logo { width: 280px; } body { padding-inline: 16px; } }
    @media (max-height: 800px) { .logo { width: 240px; } }
    .login-shell { transform: translateY(-28px); }
    body[data-theme="dark"] {
      background-color: #21191e;
      background-image:
        radial-gradient(ellipse at 48% 38%, #493239 0%, #49323900 58%),
        radial-gradient(ellipse at 8% 85%, #52363c 0%, #52363c00 52%),
        radial-gradient(ellipse at 94% 12%, #3f2b33 0%, #3f2b3300 48%),
        linear-gradient(125deg, #19171c 0%, #30232a 48%, #21191e 100%);
      background-attachment: fixed;
    }
    body[data-theme="dark"] .login-shell main {
      background: linear-gradient(135deg, #252127e8, #211c22ed);
      border-color: #875a61;
      color: #edc0c3;
      box-shadow: 0 16px 42px #00000035, inset 0 0 20px #a7666d0c;
    }
    body[data-theme="dark"] .eyebrow { color: #d5a0a4; }
    body[data-theme="dark"] header p,
    body[data-theme="dark"] .remember,
    body[data-theme="dark"] .status { color: #bcb2ba; }
    body[data-theme="dark"] .input-wrap input {
      background: #30293080;
      border-color: #57404a;
      color: #f1d9dd;
      color-scheme: dark;
    }
    body[data-theme="dark"] input::placeholder { color: #a397a0; }
    body[data-theme="dark"] .input-wrap input:focus { border-color: #ba858c; }
    body[data-theme="dark"] .toggle { color: #dfadb3; }
    body[data-theme="dark"] .forgot { color: #dda1aa; }
    body[data-theme="dark"] .forgot:hover { color: #f5cbd1; }
    body[data-theme="dark"] .remember input { border-color: #bf939d; }
    body[data-theme="dark"] .remember input:checked { background: #bf939d; box-shadow: inset 0 0 0 3px #282128; }
    body[data-theme="dark"] .divider { border-color: #68454e; }
    body[data-theme="dark"] .enter { background-color: #a66b75; color: #fff0f2; }
    @media (hover: hover) { body[data-theme="dark"] .enter:hover { background-color: #b47a84; } }
    body[data-theme="dark"] .enter:active { background-color: #945b65; }
    @media (max-height: 740px) { .login-shell { transform: none; } }
    body { isolation: isolate; }
    body::before {
      content: '';
      position: fixed;
      inset: 0;
      z-index: -1;
      pointer-events: none;
      background: url('assets/nevoa.svg') center / cover no-repeat;
      opacity: .58;
    }
    body[data-theme="light"] {
      background-color: #eac4c1;
      background-image:
        radial-gradient(ellipse at 18% 22%, #fae8decc 0%, transparent 48%),
        radial-gradient(ellipse at 80% 68%, #fce8debb 0%, transparent 44%),
        radial-gradient(ellipse at 42% 86%, #dba7b08c 0%, transparent 46%),
        radial-gradient(ellipse at 66% 12%, #e6b4b8aa 0%, transparent 50%);
    }
    body[data-theme="dark"] {
      background-color: #100e12;
      background-image:
        radial-gradient(ellipse at 12% 30%, #3a242f70 0%, transparent 48%),
        radial-gradient(ellipse at 84% 76%, #42283160 0%, transparent 44%),
        radial-gradient(ellipse at 50% 10%, #29202b60 0%, transparent 50%);
    }
    body[data-theme="dark"]::before { opacity: .075; }
    .login-shell { max-width: 410px; transform: translateY(-48px); }
    .logo { max-width: 90%; }
    body::before { inset: -5%; animation: mist-drift 38s ease-in-out infinite alternate; }
    @keyframes mist-drift {
      from { transform: translate(-1%, 1%) scale(1.02); }
      to { transform: translate(2%, -1.5%) scale(1.06); }
    }
    .login-shell { transform: translateY(-72px); }
    @media (max-height: 740px) { .login-shell { transform: translateY(-12px); } }
    @media (prefers-reduced-motion: reduce) { body::before { animation: none; } }
    .logo-light { display: none; }
    body[data-theme="light"] .logo-light { display: block; }
    body[data-theme="light"] .logo-dark { display: none; }
    .logo { margin-bottom: -24px; }
    .login-shell main { padding-top: 30px; }
    .login-shell main { max-width: 410px; padding: 24px 28px; }
    h1 { font-size: clamp(1.8rem, 6vw, 2.1rem); }
    .eyebrow { margin-bottom: 18px; }
    header { margin-bottom: 20px; }
    header p { font-size: .9375rem; }
    form { gap: 16px; }
    input { min-height: 50px; padding-block: 12px; }
    .field-icon { top: 14px; }
    .toggle { top: 3px; }
    .enter { min-height: 48px; }
    .divider { margin-top: 20px; }
    @media (max-height: 740px) { .login-shell { transform: none; } }

/* Slim scrollbars with no native arrow buttons. */
html{scrollbar-gutter:stable}
*{scrollbar-width:thin;scrollbar-color:#8c72864d transparent}
@supports selector(::-webkit-scrollbar){
 *{scrollbar-width:auto;scrollbar-color:auto}
 *::-webkit-scrollbar{width:6px;height:6px}
 *::-webkit-scrollbar-button{display:none;width:0;height:0}
 *::-webkit-scrollbar-track{background:transparent;margin:18px 0;border:0;box-shadow:none}
 *::-webkit-scrollbar-thumb{background:#8c72864d;border:1px solid transparent;border-radius:999px;background-clip:padding-box;min-height:40px}
 *::-webkit-scrollbar-thumb:hover{background-color:#c5759d99}
 *::-webkit-scrollbar-corner{background:transparent}
}
/* Modal dialogs own scrolling while the background stays in place. */
html:has(dialog[open]){overflow:hidden}
body:has(dialog[open]){overflow:hidden;overscroll-behavior:none}
dialog[open]{overscroll-behavior:contain}
/* Open and closed eyes crossfade with a small blink. */
.password-eye{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
.password-eye g{transform-origin:12px 12px;transition:opacity .18s ease,transform .22s ease}
#toggle-password[aria-pressed=false] .eye-open{opacity:0;transform:scaleY(.15)}
#toggle-password[aria-pressed=false] .eye-closed{opacity:1;transform:scaleY(1)}
#toggle-password[aria-pressed=true] .eye-open{opacity:1;transform:scaleY(1)}
#toggle-password[aria-pressed=true] .eye-closed{opacity:0;transform:scaleY(.15)}
@media(prefers-reduced-motion:reduce){.password-eye g{transition:none}}
/* Inline form notices follow the magIA palette. */
.field-error{display:flex;align-items:center;gap:7px;margin-top:7px;font:500 11px/1.5 "Segoe UI",sans-serif;letter-spacing:0;color:#e992ac;animation:field-notice-in .16s ease-out}
.field-error::before{content:'!';display:grid;place-items:center;flex:0 0 14px;height:14px;border:1px solid currentColor;border-radius:50%;font:700 10px/1 Arial,sans-serif}
body[data-theme=light] .field-error{color:#ad315d}
input[aria-invalid=true],textarea[aria-invalid=true],select[aria-invalid=true],.field-invalid .select-trigger{border-color:#df7298!important;background-color:#d4438708!important}
@keyframes field-notice-in{from{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.field-error{animation:none}}
/* Frame the complete artwork without cropping, stretching or edge masks. */
.login-page .login-book-art{position:fixed;inset:0;z-index:0;pointer-events:none;background:url("assets/livro-magico-login-3840.png") center bottom / contain no-repeat;opacity:1;filter:none}
.login-page .login-shell{position:relative;z-index:1}
@media(max-width:650px){.login-page .login-book-art{background-position:center bottom;background-size:contain}}
/* Anchor the spine at the viewport base and fill the side margins. */
.login-page .login-book-art{background-size:max(100vw,177.69vh) auto;background-position:center bottom -3.2vh}
@media(max-width:650px){.login-page .login-book-art{background-size:auto 100%;background-position:center bottom -3.2vh}}


.mobile-app-link{display:none}
@media(max-width:767px) and (pointer:coarse){.mobile-app-link{display:flex;align-items:center;justify-content:center;gap:8px;min-height:44px;margin-top:16px;border:1px solid #b1768a66;border-radius:12px;padding:10px 14px;color:#e6b3c5;background:#b1768a12;text-decoration:none;font:600 13px/1.4 Arial,sans-serif}.mobile-app-link svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.library-page .mobile-app-link{margin:0 0 20px}.login-page[data-theme=light] .mobile-app-link{color:#794658;background:#ad747b0c}}

.theme-art{display:block;width:18px;height:18px;pointer-events:none;background:currentColor;mask-position:center;mask-size:contain;mask-repeat:no-repeat;-webkit-mask-position:center;-webkit-mask-size:contain;-webkit-mask-repeat:no-repeat}.theme-art-sun{mask-image:url('assets/sol.png?v=2');-webkit-mask-image:url('assets/sol.png?v=2')}.theme-art-moon{mask-image:url('assets/lua.png?v=2');-webkit-mask-image:url('assets/lua.png?v=2')}
