:root {
  color: #16243d;
  background: #edf4ff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 5%, rgba(78, 146, 255, .62), transparent 31rem),
    radial-gradient(circle at 84% 88%, rgba(119, 113, 255, .29), transparent 28rem),
    linear-gradient(126deg, #dcebff 0%, #f5f9ff 48%, #e7edff 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: .28;
  pointer-events: none;
  background-image: linear-gradient(rgba(89, 125, 185, .12) 1px, transparent 1px), linear-gradient(90deg, rgba(89, 125, 185, .12) 1px, transparent 1px);
  background-size: 76px 76px;
  mask-image: linear-gradient(to bottom, #000, transparent 77%);
}

button, input { font: inherit; }
button { cursor: pointer; }

.login-page { display: grid; min-height: 100vh; place-items: center; padding: 4rem 1.5rem; }

.login-actions { position: fixed; top: 1.25rem; right: 1.25rem; z-index: 2; display: flex; gap: .7rem; }
.preference-button {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(152, 172, 211, .32);
  border-radius: 15px;
  color: #24489c;
  background: rgba(255, 255, 255, .76);
  box-shadow: 0 8px 21px rgba(75, 108, 164, .13);
  font-weight: 800;
  transition: transform .16s cubic-bezier(.34,1.56,.64,1), box-shadow .16s ease, background .16s ease;
}
.preference-button:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 12px 28px rgba(75, 108, 164, .2); }
.preference-button:active { transform: scale(.96); }
.icon-control { font-size: 25px; font-weight: 500; }

.login-card {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(420px, .96fr);
  width: min(100%, 1040px);
  min-height: 590px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: 27px;
  background: rgba(255, 255, 255, .58);
  box-shadow: 0 34px 70px rgba(53, 85, 140, .23), inset 0 1px rgba(255, 255, 255, .85);
  backdrop-filter: blur(16px);
}

.login-intro { display: flex; flex-direction: column; padding: 3.45rem 3.7rem 3rem; background: linear-gradient(145deg, rgba(223, 238, 255, .86), rgba(231, 246, 255, .55)); }
.login-brand { display: flex; align-items: center; gap: .78rem; color: #263855; font-size: 16px; font-weight: 760; }
.login-mark { display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid rgba(126, 168, 255, .6); border-radius: 14px; color: #fff; background: linear-gradient(135deg, #3a8dff, #2458de); box-shadow: 0 11px 25px rgba(44, 106, 234, .36); font-size: 13px; letter-spacing: .04em; }
.intro-copy { margin-top: auto; }
.intro-kicker, .eyebrow { margin: 0; color: #5d7ab5; font-size: 11px; font-weight: 760; letter-spacing: .13em; text-transform: uppercase; }
.intro-copy h1 { margin: .9rem 0 1.25rem; color: #16243d; font-size: clamp(2rem, 3.2vw, 3rem); letter-spacing: -.055em; line-height: 1.2; }
.accent { color: #1b71ec; }
.intro-description { max-width: 360px; margin: 0; color: #63718a; font-size: 15px; line-height: 1.85; }
.intro-points { display: grid; gap: .85rem; margin: 2.8rem 0 1.6rem; padding: 0; color: #50617e; font-size: 14px; list-style: none; }
.intro-points li { display: flex; align-items: center; gap: .75rem; }
.intro-points li > span:first-child { display: grid; width: 27px; height: 27px; place-items: center; border: 1px solid rgba(82, 132, 238, .24); border-radius: 8px; color: #2b75e7; background: rgba(244, 249, 255, .72); }
.intro-status { display: flex; align-items: center; gap: .55rem; margin: 0; color: #6b7c99; font-size: 13px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #23bf83; box-shadow: 0 0 0 5px rgba(35, 191, 131, .12); }

.login-panel { display: flex; flex-direction: column; justify-content: center; padding: 3.75rem clamp(2.4rem, 6vw, 5rem); background: rgba(255, 255, 255, .61); }
.login-panel-copy h2 { margin: .55rem 0 .35rem; color: #16243d; font-size: 2rem; letter-spacing: -.045em; }
.login-panel-copy p:last-child { margin: 0; color: #7b89a1; font-size: 14px; }
.login-form { display: grid; gap: .7rem; margin-top: 2.35rem; }
.field-label { color: #52637e; font-size: 13px; font-weight: 700; }
.field-shell { display: flex; align-items: center; gap: .65rem; height: 48px; padding: 0 .85rem; border: 1px solid rgba(135, 156, 195, .28); border-radius: 12px; color: #7e92b4; background: rgba(255, 255, 255, .82); box-shadow: 0 3px 9px rgba(64, 91, 138, .06); transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.field-shell:focus-within { border-color: #5a91fa; box-shadow: 0 0 0 4px rgba(62, 130, 245, .13); transform: translateY(-1px); }
.field-shell input { width: 100%; min-width: 0; border: 0; outline: 0; color: #22314b; background: transparent; }
.field-shell input::placeholder { color: #a5b2c7; }
.password-toggle { padding: 4px; border: 0; color: #7e92b4; background: transparent; font-size: 13px; }
.login-submit { position: relative; display: grid; height: 50px; margin-top: .85rem; overflow: hidden; border: 0; border-radius: 12px; color: #fff; background: linear-gradient(100deg, #1966df, #1686e9); box-shadow: 0 12px 24px rgba(27, 104, 225, .29); font-weight: 760; letter-spacing: .18em; place-items: center; transition: transform .16s cubic-bezier(.34,1.56,.64,1), box-shadow .18s ease, filter .18s ease; }
.login-submit:hover { box-shadow: 0 16px 31px rgba(27, 104, 225, .39); filter: brightness(1.045); }
.login-submit:active { transform: scale(.96); }
.login-submit:focus-visible, .preference-button:focus-visible, .password-toggle:focus-visible { outline: 3px solid rgba(48, 119, 238, .38); outline-offset: 3px; }
.button-loading { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.42); border-top-color: #fff; border-radius: 50%; animation: spin .72s linear infinite; }
.login-submit[data-loading="true"] .button-label { display: none; }
.login-submit[data-loading="true"] .button-loading { display: block; }
.login-submit[data-loading="true"] { pointer-events: none; }
.login-error { margin-top: 1.2rem; padding: .72rem .85rem; border: 1px solid rgba(215, 76, 76, .22); border-radius: 10px; color: #aa3030; background: rgba(255, 238, 238, .78); font-size: 13px; line-height: 1.45; animation: error-in .2s cubic-bezier(.16,1,.3,1); }
.login-note { margin: 1.25rem 0 0; color: #93a1b7; font-size: 12px; line-height: 1.6; }
.login-cursor { position: fixed; z-index: 4; width: 18px; height: 18px; border: 2px solid rgba(42, 110, 237, .76); border-radius: 50%; pointer-events: none; opacity: 0; transform: translate(-50%, -50%); transition: opacity .16s ease, width .16s ease, height .16s ease; }
.login-cursor.is-visible { opacity: 1; }
.login-cursor.is-active { width: 28px; height: 28px; }

html.theme-dark { color: #e7efff; background: #0c1528; }
html.theme-dark body { background: radial-gradient(circle at 12% 5%, rgba(33, 94, 195, .48), transparent 30rem), radial-gradient(circle at 85% 90%, rgba(83, 57, 165, .3), transparent 26rem), linear-gradient(135deg, #0d1830, #101c35 55%, #12172d); }
html.theme-dark body::before { opacity: .16; }
html.theme-dark .login-card { border-color: rgba(152, 184, 236, .17); background: rgba(13, 25, 49, .58); box-shadow: 0 34px 80px rgba(0, 0, 0, .34), inset 0 1px rgba(215, 235, 255, .07); }
html.theme-dark .login-intro { background: linear-gradient(145deg, rgba(22, 49, 95, .72), rgba(19, 40, 74, .43)); }
html.theme-dark .login-panel { background: rgba(13, 24, 46, .63); }
html.theme-dark .login-brand, html.theme-dark .intro-copy h1, html.theme-dark .login-panel-copy h2 { color: #eef5ff; }
html.theme-dark .intro-description, html.theme-dark .intro-points, html.theme-dark .intro-status, html.theme-dark .login-panel-copy p:last-child, html.theme-dark .login-note { color: #aabbd7; }
html.theme-dark .field-label { color: #bccae1; }
html.theme-dark .field-shell { border-color: rgba(151, 181, 231, .2); color: #92a9cf; background: rgba(5, 15, 33, .48); }
html.theme-dark .field-shell input { color: #edf4ff; }
html.theme-dark .preference-button { border-color: rgba(152, 184, 236, .18); color: #dceaff; background: rgba(16, 30, 56, .78); }
html.theme-dark .login-error { color: #ffb9b9; background: rgba(111, 31, 48, .34); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes error-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 800px) {
  .login-page { padding: 5rem 1rem 1.5rem; place-items: start center; }
  .login-card { grid-template-columns: 1fr; min-height: 0; }
  .login-intro { padding: 2.2rem 2rem; }
  .intro-copy { margin-top: 2.5rem; }
  .intro-points { margin: 2rem 0 0; }
  .intro-status { display: none; }
  .login-panel { padding: 2.3rem 2rem 2.6rem; }
}

@media (pointer: coarse) { .login-cursor { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
