/* Native adaptation of 21st.dev/diarmuradi/sign-in-3 in the Lutheos Room system.
   One critical stylesheet covers every existing authentication mode. */
html:has(#login-screen:not([hidden])){scrollbar-gutter:stable both-edges}
#login-screen{display:flex;align-items:center;justify-content:center;min-height:100svh;padding:32px 20px;background:var(--outer);color:var(--fg)}
#login-screen .auth-main{display:flex;flex-direction:column;width:100%;max-width:448px;min-width:0;padding:24px;background:var(--bg);border:1px solid var(--border);border-radius:16px}
#login-screen .auth-topbar{display:flex;align-items:center;justify-content:space-between;gap:20px;min-height:44px;flex:none}
#login-screen .auth-brand{display:inline-flex;align-items:center;gap:9px;font-size:18px;font-weight:650;letter-spacing:-.03em}
#login-screen .auth-brand img{width:24px;height:24px}
#login-screen .auth-preferences{position:static;display:flex;align-items:center;gap:6px;flex:none}
#login-screen .auth-preferences .language-control{min-width:0}
#login-screen .auth-preferences .select-trigger{display:flex;align-items:center;gap:6px;min-height:36px;padding:6px 8px;border:0;background:transparent;box-shadow:none;border-radius:8px;font-size:12px}
#login-screen .auth-preferences .select-trigger:hover,#login-screen .theme-toggle:hover{background:var(--muted)}
#login-screen .theme-toggle{display:grid;place-items:center;min-width:36px;width:36px;height:36px;border-radius:8px;padding:8px;color:var(--fg3)}
#login-screen .theme-toggle svg{display:block;width:18px;height:18px}
#login-screen .auth-content{width:100%;max-width:384px;min-width:0;margin:0 auto;padding:28px 0 24px;animation:auth-enter .38s var(--ease) both}
#login-screen .auth-symbol{width:44px;height:44px;border:1px solid var(--border);border-radius:50%;background:var(--subtle);display:grid;place-items:center;margin:0 auto 16px;color:var(--fg2)}
#login-screen .auth-symbol svg{display:block;width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
#login-screen .auth-heading{text-align:center;margin-bottom:24px}
#login-screen .auth-heading h1{font-size:24px;line-height:32px;font-weight:600;letter-spacing:-.025em;text-wrap:balance;overflow-wrap:anywhere}
#login-screen .auth-heading p{margin-top:8px;color:var(--fg3);font-size:14px;line-height:22px;text-wrap:pretty}
#login-screen #login-form{display:grid;gap:18px}
#login-screen .auth-field{display:grid;gap:7px;min-width:0}
#login-screen .auth-field label{font-size:13px;line-height:20px;font-weight:500}
#login-screen .password-label-row{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap}
#login-screen .password-label-row .auth-link{font-size:12px;line-height:20px}
#login-screen .auth-content input:not([type=radio]):not([type=checkbox]){width:100%;min-width:0;height:44px;min-height:44px;padding:10px 12px;border:1px solid var(--strong);border-radius:8px;background:transparent;color:var(--fg);font-size:14px;line-height:22px;outline:0;box-shadow:none;caret-color:var(--fg);transition:border-color .16s,box-shadow .16s}
#login-screen .auth-content input:not([type=radio]):not([type=checkbox]):hover{border-color:var(--fg3)}
#login-screen .auth-content input:not([type=radio]):not([type=checkbox]):focus{border-color:var(--fg3);box-shadow:0 0 0 2px color-mix(in srgb,var(--fg) 12%,transparent)}
#login-screen .auth-content input::placeholder{color:var(--fg3);opacity:1}
#login-screen .auth-content input:user-invalid{border-color:var(--danger)}
#login-screen .password-control{position:relative;min-width:0}
#login-screen .password-control input{padding-right:48px!important}
#login-screen .password-control button{position:absolute;right:2px;top:2px;width:40px;height:40px;display:grid;place-items:center;padding:10px;border-radius:6px;color:var(--fg3);background:transparent;transition:color .15s,background .15s}
#login-screen .password-control button svg{width:18px;height:18px;display:block;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
#login-screen .password-control button:hover{background:var(--muted);color:var(--fg)}
#login-screen #password-help{font-size:12px;line-height:18px;color:var(--fg3);margin:0}
#login-screen .auth-link{display:inline-flex;align-items:center;justify-content:center;gap:6px;max-width:100%;padding:0;color:var(--fg);font-weight:500;text-decoration:none;text-underline-offset:4px;transition:color .15s;overflow-wrap:anywhere}
#login-screen .auth-link:hover{color:var(--fg2);text-decoration:underline}
#login-screen .auth-link svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
#login-screen #login-submit{width:100%;min-height:44px;display:flex;align-items:center;justify-content:center;padding:10px 16px;border:0;border-radius:999px;background:var(--inverse);color:var(--inverse-fg);font-size:14px;line-height:22px;font-weight:550;transition:opacity .16s,transform .16s var(--ease)}
#login-screen #login-submit:hover:not(:disabled){opacity:.86}
#login-screen #login-submit:active:not(:disabled){transform:scale(.985)}
#login-screen #login-submit:disabled{opacity:.48}
#login-screen .auth-switch,#login-screen .auth-resend{display:flex;justify-content:center;align-items:baseline;flex-wrap:wrap;gap:6px 8px;margin-top:24px;color:var(--fg3);font-size:13px;line-height:20px;text-align:center}
#login-screen .auth-status,#login-screen #login-error{padding:12px 14px;margin-top:18px;border:1px solid var(--border);border-radius:10px;font-size:13px;line-height:21px;overflow-wrap:anywhere}
#login-screen .auth-status{color:var(--fg2);background:var(--subtle)}
#login-screen #login-error{color:var(--danger);background:var(--danger-bg);border-color:color-mix(in srgb,var(--danger) 26%,var(--border))}
#login-screen .auth-captcha{min-width:0;margin:0}
#login-screen .auth-captcha-feedback{display:flex;align-items:center;justify-content:space-between;gap:8px}
#login-screen .auth-captcha-feedback .helper{font-size:12px;line-height:18px;color:var(--fg3)}
#login-screen .auth-captcha-feedback .icon-button{display:grid;place-items:center;width:36px;height:36px;border:1px solid var(--border);border-radius:8px;flex:none}
#login-screen .auth-captcha-feedback .icon-button:hover{background:var(--muted)}
#login-screen .legal-checks{display:grid;gap:12px;margin:0}
#login-screen .legal-check{display:flex;align-items:flex-start;gap:9px;color:var(--fg3);font-size:12px;line-height:19px;min-width:0}
#login-screen .legal-check input{width:16px;height:16px;margin:2px 0 0;flex:none;accent-color:var(--inverse);cursor:pointer}
#login-screen .legal-check span{min-width:0}
#login-screen .legal-check a{color:var(--fg);text-decoration:underline;text-underline-offset:3px}
#login-screen .telegram-auth{display:grid;gap:12px;margin-top:24px}
#login-screen .auth-alternative{display:flex;align-items:center;gap:12px;color:var(--fg3);font-size:12px;line-height:18px;text-align:center}
#login-screen .auth-alternative::before,#login-screen .auth-alternative::after{content:"";height:1px;background:var(--border);flex:1}
#login-screen #telegram-login-native{display:flex;align-items:center;justify-content:center;gap:9px;min-height:44px;padding:10px 14px;border:1px solid var(--strong);border-radius:8px;background:transparent;font-size:14px;color:var(--fg);transition:background .16s}
#login-screen #telegram-login-native:hover:not(:disabled){background:var(--muted)}
#login-screen #telegram-login-native svg{fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
#login-screen .telegram-auth>.auth-link{font-size:12px;line-height:20px}
#login-screen .auth-footer{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:2px 16px;min-height:44px;padding:0;color:var(--fg3);font-size:11px;line-height:18px;text-align:center;flex:none}
#login-screen .auth-footer a,#login-screen .auth-footer button{display:inline-flex;align-items:center;min-height:36px;max-width:100%;font:inherit;color:inherit;overflow-wrap:anywhere}
#login-screen .auth-footer a:hover,#login-screen .auth-footer button:hover{color:var(--fg);text-decoration:underline;text-underline-offset:4px}
#telegram-recovery-dialog h2{font-size:18px;line-height:26px;margin-bottom:16px}
#telegram-recovery-dialog>p{font-size:13px;line-height:21px;color:var(--fg3);overflow-wrap:anywhere}
#telegram-recovery-dialog>p+p{margin-top:12px}
#telegram-recovery-dialog .dialog-actions{flex-wrap:wrap;margin-top:20px;padding-top:16px;gap:8px}
#telegram-recovery-dialog .button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;max-width:100%;padding:9px 14px;border:1px solid var(--strong);border-radius:8px;background:transparent;color:var(--fg);font-size:13px;line-height:20px;transition:background .16s,opacity .16s;text-align:center}
#telegram-recovery-dialog .button.primary{border-color:transparent;border-radius:999px;background:var(--inverse);color:var(--inverse-fg)}
#telegram-recovery-dialog .button.secondary:hover{background:var(--muted)}
#telegram-recovery-dialog .button.primary:hover{opacity:.86}
@keyframes auth-enter{from{opacity:.3;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:480px){#login-screen{padding:20px 12px}#login-screen .auth-main{padding:20px}#login-screen .auth-topbar{gap:10px}#login-screen .auth-brand{font-size:16px;gap:7px}#login-screen .auth-brand img{width:22px;height:22px}#login-screen .auth-preferences{gap:2px}#login-screen .auth-preferences .select-trigger,#login-screen .theme-toggle{min-height:44px;height:44px}#login-screen .theme-toggle{width:44px;min-width:44px}#login-screen .auth-content{padding:24px 0 20px}#login-screen .auth-content input:not([type=radio]):not([type=checkbox]){font-size:16px}#login-screen .auth-link{min-height:44px}#login-screen .password-control button{width:44px;height:44px;right:0;top:0}#login-screen .auth-captcha-feedback .icon-button{width:44px;height:44px}#login-screen .legal-check{min-height:44px}#login-screen .auth-switch .auth-link,#login-screen .auth-resend .auth-link{min-height:44px}#login-screen .auth-footer{gap:0 12px}#login-screen .auth-footer a,#login-screen .auth-footer button{min-height:44px}}
@media(prefers-reduced-motion:reduce){#login-screen .auth-content{animation:none}#login-screen *,#login-screen *::before,#login-screen *::after{transition:none!important;animation:none!important;scroll-behavior:auto!important}}
@media(max-width:360px){html:has(#login-screen:not([hidden])){scrollbar-gutter:auto}}
@media(max-width:480px){#telegram-recovery-dialog .dialog-actions{display:grid;grid-template-columns:minmax(0,1fr)}#telegram-recovery-dialog .button{min-height:44px;width:100%}#telegram-recovery-close{order:2}}
