:root {
  color-scheme: light;
  --ink: #11172b;
  --muted: #747d94;
  --paper: #f4f6fb;
  --card: #ffffff;
  --line: #e2e7f0;
  --violet: #7158e8;
  --violet-dark: #543ed4;
  --mint: #20c997;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html {
  min-height: 100%;
  background: var(--paper);
  overscroll-behavior: none;
  touch-action: pan-x pan-y;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body { min-height: 100vh; min-height: 100dvh; margin: 0; color: var(--ink); background: var(--paper); overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
button { touch-action: manipulation; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
[hidden] { display: none !important; }

.login-shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(360px, 1.05fr) minmax(440px, .95fr); }
.welcome-panel { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; min-height: 100%; padding: clamp(28px, 5vw, 64px); color: #fff; background: radial-gradient(circle at 85% 15%, rgba(141,116,255,.68), transparent 28%), radial-gradient(circle at 5% 90%, rgba(32,201,151,.22), transparent 34%), linear-gradient(145deg, #0d1227 0%, #171e3c 52%, #31265f 100%); }
.welcome-panel::before, .welcome-panel::after { content: ""; position: absolute; z-index: -1; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; }
.welcome-panel::before { width: 440px; height: 440px; right: -270px; bottom: -180px; box-shadow: 0 0 0 55px rgba(255,255,255,.025), 0 0 0 110px rgba(255,255,255,.018); }
.welcome-panel::after { width: 180px; height: 180px; right: 10%; top: 17%; box-shadow: inset 0 0 60px rgba(141,116,255,.16); }
.brand-row { display: flex; align-items: center; gap: 13px; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; color: #fff; background: linear-gradient(145deg, #9a84ff, #6148db); box-shadow: 0 13px 35px rgba(113,88,232,.4); font-size: 22px; font-weight: 900; }
.brand-copy { display: flex; flex-direction: column; }
.brand-copy strong { letter-spacing: .14em; font-size: 17px; }
.brand-copy small { margin-top: 5px; color: rgba(255,255,255,.58); font-size: 10px; }
.welcome-copy { max-width: 620px; margin: auto 0; padding: 70px 0; }
.eyebrow { margin: 0; color: #9d88ff; font-size: 10px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.welcome-copy .eyebrow { color: #bfb4ff; }
.welcome-copy h1 { max-width: 580px; margin: 13px 0 18px; font-size: clamp(42px, 5.2vw, 76px); line-height: .98; letter-spacing: -.045em; }
.welcome-copy > p:last-child { max-width: 520px; margin: 0; color: rgba(255,255,255,.64); font-size: clamp(14px, 1.4vw, 18px); line-height: 1.6; }
.feature-row { display: flex; flex-wrap: wrap; gap: 10px; }
.feature-row span { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 999px; color: rgba(255,255,255,.72); background: rgba(255,255,255,.05); backdrop-filter: blur(12px); font-size: 10px; font-weight: 700; }
.feature-row i { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 8px; color: #fff; background: rgba(141,116,255,.6); font-style: normal; }

.auth-panel { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; padding: clamp(24px, 6vw, 80px); background: radial-gradient(circle at 10% 10%, rgba(113,88,232,.08), transparent 30%), var(--paper); }
.connection-state { position: absolute; top: max(22px, env(safe-area-inset-top)); right: 28px; display: flex; align-items: center; gap: 7px; color: #178163; font-size: 10px; font-weight: 750; }
.connection-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(32,201,151,.12); }
.connection-state.offline { color: #9b6710; }
.connection-state.offline i { background: #f4b83f; box-shadow: 0 0 0 4px rgba(244,184,63,.14); }
.auth-card { width: min(100%, 470px); padding: clamp(24px, 4vw, 42px); border: 1px solid rgba(216,222,234,.88); border-radius: 30px; background: rgba(255,255,255,.94); box-shadow: 0 28px 70px rgba(31,39,72,.12); }
.auth-heading h2 { margin: 7px 0 9px; font-size: clamp(27px, 3vw, 36px); letter-spacing: -.03em; }
.auth-heading > p:last-child { margin: 0 0 28px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.field { display: grid; gap: 7px; margin-bottom: 17px; }
.field > span:first-child { color: #4f586f; font-size: 10px; font-weight: 800; }
.input-wrap { height: 55px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid var(--line); border-radius: 16px; background: #fafbfe; transition: border-color .16s, box-shadow .16s, background .16s; }
.input-wrap:focus-within { border-color: #9f8cff; background: #fff; box-shadow: 0 0 0 4px rgba(113,88,232,.1); }
.input-wrap > i { padding-right: 10px; border-right: 1px solid var(--line); color: var(--violet); font-style: normal; font-weight: 850; }
.input-wrap input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 16px; }
.input-wrap input::placeholder { color: #a8afbf; }
.password-wrap button { flex: 0 0 auto; padding: 6px; border: 0; color: var(--violet); background: transparent; font-size: 9px; font-weight: 800; }
.remember-row { display: grid; grid-template-columns: 42px minmax(0,1fr); align-items: center; gap: 11px; margin: 7px 0 23px; cursor: pointer; }
.remember-row > input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch { position: relative; width: 42px; height: 25px; border-radius: 99px; background: #cfd5e1; transition: background .18s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(30,37,63,.22); transition: transform .18s; }
.remember-row input:checked + .switch { background: var(--violet); }
.remember-row input:checked + .switch i { transform: translateX(17px); }
.remember-row input:focus-visible + .switch { outline: 3px solid rgba(113,88,232,.2); outline-offset: 2px; }
.remember-copy strong, .remember-copy small { display: block; }
.remember-copy strong { font-size: 11px; }
.remember-copy small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.submit-button { width: 100%; height: 55px; display: flex; align-items: center; justify-content: space-between; padding: 0 19px 0 22px; border: 0; border-radius: 16px; color: #fff; background: linear-gradient(135deg, #866ff4, var(--violet-dark)); box-shadow: 0 13px 28px rgba(113,88,232,.28); font-size: 13px; font-weight: 850; cursor: pointer; transition: transform .15s, box-shadow .15s, opacity .15s; }
.submit-button:hover { transform: translateY(-1px); box-shadow: 0 16px 32px rgba(113,88,232,.34); }
.submit-button:active { transform: translateY(0); }
.submit-button:disabled { cursor: wait; opacity: .65; transform: none; }
.submit-button i { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,.16); font-style: normal; font-size: 18px; }
.form-message { margin: 0 0 16px; padding: 11px 13px; border: 1px solid #ffc7ce; border-radius: 13px; color: #a83242; background: #fff0f2; font-size: 10px; line-height: 1.45; }
.form-message.success { border-color: #bcebdc; color: #087957; background: #ecfbf6; }
.security-note { display: flex; align-items: flex-start; gap: 8px; margin: 18px 2px 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.security-note span { color: var(--violet); font-size: 15px; line-height: 1; }
.support-note { width: min(100%, 470px); margin: 15px 0 0; text-align: center; color: #8b93a6; font-size: 9px; line-height: 1.5; }

@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; }
  .welcome-panel { min-height: auto; padding: max(22px, env(safe-area-inset-top)) 22px 28px; }
  .welcome-copy { margin: 45px 0 38px; padding: 0; }
  .welcome-copy h1 { max-width: 560px; font-size: clamp(36px, 10vw, 58px); }
  .feature-row { display: none; }
  .auth-panel { padding: 28px 16px max(28px, env(safe-area-inset-bottom)); }
  .connection-state { position: static; align-self: flex-end; margin: 0 8px 15px; }
}

@media (max-width: 480px) {
  .welcome-panel { min-height: 230px; }
  .welcome-copy { margin: 34px 0 6px; }
  .welcome-copy h1 { margin: 9px 0 12px; font-size: 35px; }
  .welcome-copy > p:last-child { font-size: 12px; }
  .auth-panel { justify-content: flex-start; padding-top: 20px; }
  .auth-card { padding: 25px 20px; border-radius: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
