/* REVO entry: one form, monochrome surfaces, a living backdrop. */
:root {
    color-scheme: dark;
    --bg: #08090b;
    --text: #f0f1f4;
    --muted: #a0a4ad;
    --line: rgba(255, 255, 255, .105);
    --voice: #8fe6b9;
    --mono: 'JetBrains Mono', monospace;
    --ease-out: cubic-bezier(.22, 1, .36, 1);
    --ease-spring: cubic-bezier(.34, 1.45, .64, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: 'Sora', sans-serif; -webkit-font-smoothing: antialiased; }
body { padding-top: var(--tb-height, 0px); }
button, input { font: inherit; color: inherit; }
button, a { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
button svg { pointer-events: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #d6dce6; outline-offset: 4px; }

@keyframes entry-reveal { from { opacity: 0; transform: translateY(6px); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(143, 230, 185, .55); } 70%, 100% { box-shadow: 0 0 0 7px rgba(143, 230, 185, 0); } }
@keyframes sweep { from { transform: translateX(-120%) skewX(-18deg); } to { transform: translateX(260%) skewX(-18deg); } }

.login-shell { position: relative; isolation: isolate; min-height: calc(100dvh - var(--tb-height, 0px)); display: grid; grid-template-rows: 88px 1fr 66px; padding: 0 clamp(28px, 5vw, 90px); overflow: hidden; }
.login-backdrop {
    position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background:
        linear-gradient(90deg, rgba(8, 9, 11, 0) 10%, rgba(8, 9, 11, .2) 45%, rgba(8, 9, 11, .96) 74%),
        linear-gradient(0deg, #08090b 0%, rgba(8, 9, 11, 0) 28%, rgba(8, 9, 11, .13) 72%, rgba(8, 9, 11, .8)),
        url('/img/atmosphere/revo-eclipse.png') 75% 50% / cover;
    --ambient-scene-opacity: .58;
    animation: fade-in 1.2s var(--ease-out) both;
}
.login-backdrop::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 40%, rgba(8, 9, 11, .6) 65%, rgba(8, 9, 11, .9) 85%); pointer-events: none; }

.login-nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; animation: fade-in .8s .1s var(--ease-out) both; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 28px; font-weight: 500; letter-spacing: -1.5px; }
.brand__mark svg { width: 28px; height: 28px; fill: none; stroke: #d5dbe4; stroke-width: 1.8; stroke-linecap: round; transition: transform .5s var(--ease-spring); }
.brand:hover .brand__mark svg { transform: scaleY(1.14); }
.brand__dot { color: #9ea7b5; }
.nav-actions { display: flex; align-items: center; gap: 24px; font-size: 12.5px; color: #b6bbc4; }
.nav-actions a { transition: color .2s; }
.nav-actions a:hover { color: #fff; }
.nav-actions a span { display: inline-block; margin-left: 8px; transition: transform .3s var(--ease-out); }
.nav-actions a:hover span { transform: translate(2px, -2px); }
.nav-create { padding: 11px 15px; border: 1px solid rgba(255, 255, 255, .15); border-radius: 10px; background: rgba(255, 255, 255, .03); font-size: 12px; font-weight: 500; transition: background .2s, border-color .2s, transform .2s var(--ease-out); }
.nav-create:hover { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .26); transform: translateY(-1px); }
.nav-create > span { margin-right: 7px; }

.login-main { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 60px; align-items: center; width: 100%; max-width: 1500px; margin: auto; padding: 40px 0 55px; }
.welcome { align-self: end; max-width: 450px; padding-bottom: 34px; animation: rise-in 1s .5s var(--ease-out) both; }
.welcome__rule { display: block; width: 40px; height: 1px; margin-bottom: 22px; background: rgba(182, 189, 203, .4); }
.welcome p { margin: 0 0 17px; font-size: 19px; font-weight: 300; letter-spacing: -.5px; }
.welcome__edition { font: 500 8px var(--mono); letter-spacing: 2px; color: #939cae; }

.entry-card { position: relative; width: 100%; max-width: 400px; margin: auto; padding: 24px 0; }
/* The card assembles itself: heading, identity, choices, form. */
.entry-card > * { animation: rise-in .8s var(--ease-out) both; }
.entry-card > :nth-child(1) { animation-delay: .12s; }
.entry-card > :nth-child(2) { animation-delay: .2s; }
.entry-card > :nth-child(3) { animation-delay: .26s; }
.entry-card > :nth-child(4) { animation-delay: .32s; }
.entry-card > :nth-child(n+5) { animation-delay: .38s; }
.card-kicker { font: 500 9px var(--mono); letter-spacing: 2.2px; color: #8f99a9; }
.entry-heading h1 { margin: 17px 0 12px; font-size: 36px; font-weight: 300; line-height: 1.2; letter-spacing: -1.6px; background: linear-gradient(180deg, #fff 30%, #c1cad6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.entry-heading > p { margin: 0 0 34px; font-size: 13px; line-height: 1.7; color: #a7adb9; }

.identity { display: flex; align-items: center; gap: 17px; }
.avatar { position: relative; flex-shrink: 0; }
.avatar__btn { position: relative; display: grid; place-items: center; width: 54px; height: 54px; padding: 0; border: 1px solid rgba(187, 198, 209, .15); border-radius: 14px; background: linear-gradient(140deg, #343d4b, #222936); font-size: 21px; font-weight: 500; transition: transform .3s var(--ease-spring), box-shadow .3s, border-color .3s; }
.avatar__btn:hover { transform: translateY(-2px) rotate(-3deg); border-color: rgba(214, 222, 232, .4); box-shadow: 0 10px 24px rgba(0, 0, 0, .4); }
.avatar__btn img { width: 100%; height: 100%; object-fit: cover; border-radius: 13px; }
.avatar__edit { position: absolute; right: -5px; bottom: -5px; display: grid; place-items: center; width: 19px; height: 19px; border: 2px solid #0b0e13; border-radius: 6px; background: #d1d8e3; color: #18202a; font-size: 13px; line-height: 1; transition: transform .3s var(--ease-spring); }
.avatar__btn:hover .avatar__edit { transform: scale(1.15) rotate(90deg); }
.avatar__clear { position: absolute; left: 0; bottom: -21px; width: 100%; border: 0; background: none; font-size: 10px; color: #a8b1bf; }
.avatar__clear:hover { color: #fff; }

.identity .field-group { flex: 1; min-width: 0; margin: 0; }
.field-group { margin-bottom: 20px; }
.field-group label { display: block; margin-bottom: 10px; font-size: 12px; font-weight: 500; color: #c0c6d0; transition: color .2s; }
.field-group:focus-within label { color: #fff; }
.field-group label > span { float: right; font-size: 10px; font-weight: 400; color: #8e98a8; }
.field-group input { width: 100%; min-width: 0; padding: 13px 14px; border: 1px solid rgba(255, 255, 255, .15); border-radius: 10px; background: rgba(255, 255, 255, .025); font-size: 13.5px; transition: border-color .2s, background .2s, box-shadow .25s; }
.field-group input::placeholder { color: #788391; }
.field-group input:hover { border-color: rgba(255, 255, 255, .24); }
.field-group input:focus { outline: none; border-color: rgba(183, 194, 208, .6); background: rgba(255, 255, 255, .05); box-shadow: 0 0 0 4px rgba(183, 194, 208, .1); }
.field-group input[aria-invalid=true] { border-color: #d58a97; box-shadow: 0 0 0 4px rgba(213, 138, 151, .12); animation: shake .42s var(--ease-out); }
.field-note, .form-error { margin: 8px 0; font-size: 11.5px; line-height: 1.7; color: #efa5b3; }
.field-note { animation: entry-reveal .3s var(--ease-out); }
.form-error { margin: 17px 0; padding: 11px 14px; border: 1px solid rgba(213, 133, 150, .2); border-radius: 10px; background: rgba(156, 64, 82, .09); animation: shake .42s var(--ease-out); }
.form-error p { margin: 0; }
.field-hint { margin: 9px 0; font-size: 11px; line-height: 1.7; color: #939fac; }

/* login.js sets --tab; the pill glides under the chosen mode. */
.modes { position: relative; isolation: isolate; display: flex; gap: 4px; margin: 31px 0 24px; padding: 0 0 9px; border-bottom: 1px solid var(--line); }
.modes::before { content: ''; position: absolute; z-index: -1; top: 0; bottom: 9px; left: 0; width: calc((100% - 8px) / 3); border-radius: 8px; border: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .06); transform: translateX(calc(var(--tab, 0) * (100% + 4px))); transition: transform .45s var(--ease-spring); }
.mode-tab { flex: 1; padding: 11px 3px; border: 0; border-radius: 8px; background: transparent; font-size: 11.5px; font-weight: 500; color: #929caa; white-space: nowrap; transition: color .2s; }
.mode-tab.active { color: #f1f4f8; }
.mode-tab:hover { color: #fff; }

.mode-form { display: none; }
.mode-form.active { display: block; animation: entry-reveal .35s var(--ease-out); }
.public-room { display: flex; align-items: center; gap: 13px; padding: 13px 0; }
.public-room__icon { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid rgba(189, 199, 210, .16); border-radius: 11px; background: rgba(255, 255, 255, .03); color: #c4cedc; }
.public-room__icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.public-room__copy { display: flex; flex-direction: column; gap: 6px; }
.public-room__copy strong { font-size: 13.5px; font-weight: 600; }
.public-room__copy > span { font-size: 10.5px; color: #8f9bab; }
.room-count { display: flex; align-items: center; gap: 7px; margin-left: auto; font: 500 11px var(--mono); }
.room-count > span { width: 6px; height: 6px; border-radius: 50%; background: var(--voice); animation: live-pulse 2.6s ease-out infinite; }
.room-presence { margin: 9px 0 27px; font-size: 10.5px; line-height: 1.7; color: #93a1b5; }

.btn { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 15px 17px; border: 1px solid rgba(232, 237, 243, .3); border-radius: 11px; background: linear-gradient(180deg, #eef2f7, #d4dbe5); color: #1a202b; font-size: 13.5px; font-weight: 600; box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset; transition: transform .25s var(--ease-out), box-shadow .3s; }
.btn::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent); transform: translateX(-120%) skewX(-18deg); pointer-events: none; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 12px 30px rgba(210, 220, 235, .16); }
.btn:hover::after { animation: sweep .9s var(--ease-out); }
.btn:active { transform: translateY(0) scale(.99); }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform .35s var(--ease-spring); }
.btn:hover svg { transform: translateX(3px); }
.entry-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 23px 0 0; font-size: 10.5px; color: #8d98a9; }
.entry-note svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.create-hint { display: flex; align-items: center; gap: 12px; margin: 0 0 24px; font-size: 13px; line-height: 1.7; color: #c6cedb; }
.create-hint svg { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: #acb9cc; stroke-width: 1.5; }
.create-hint small { display: block; margin-top: 6px; font-size: 10.5px; color: #94a0b1; }

.login-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid rgba(255, 255, 255, .055); font-size: 9.5px; color: #838e9e; animation: fade-in 1s .6s both; }
.login-footer > span { font-size: 10.5px; color: #a0a9b7; }
.login-footer a { white-space: nowrap; transition: color .2s; }
.login-footer p { margin: 0; }
.login-footer a:hover { color: white; }

html[data-wallpaper=silk] .login-backdrop { background: radial-gradient(ellipse at 22% 45%, rgba(52, 58, 67, .22), transparent 65%), #08090b; --ambient-scene-opacity: .9; }
html[data-wallpaper=plain] .login-backdrop { background: radial-gradient(ellipse at 25% 50%, #1c2228, #08090b 70%); }
html[data-wallpaper=plain] .ambient-scene__canvas { display: none !important; }
@media (min-width: 1600px) { .login-main { grid-template-columns: minmax(0, 1fr) 440px; } .entry-card { max-width: 440px; } .entry-heading h1 { font-size: 40px; } }
@media (max-width: 1100px) { .login-shell { padding: 0 36px; } .login-main { grid-template-columns: minmax(0, 1fr) 370px; gap: 30px; } .login-backdrop { background-position: 0 0, 0 0, 65% 50%; } .welcome p { font-size: 16px; } }
@media (max-width: 760px) {
    .login-shell { grid-template-rows: 72px 1fr auto; padding: 0 24px; }
    .login-nav { gap: 15px; }
    .brand { gap: 8px; font-size: 24px; }
    .brand__mark svg { width: 23px; height: 23px; }
    .nav-actions { font-size: 11.5px; }
    .nav-create { display: none; }
    .login-main { display: block; padding: 35px 0 48px; }
    .welcome { display: none; }
    .entry-card { max-width: 410px; padding: 28px 20px; border: 1px solid rgba(255, 255, 255, .09); border-radius: 18px; background: rgba(10, 13, 18, .8); backdrop-filter: blur(16px); animation: rise-in .8s .1s var(--ease-out) both; }
    .entry-heading h1 { margin: 13px 0; font-size: 31px; }
    .entry-heading > p { margin-bottom: 28px; font-size: 12px; }
    .login-backdrop { opacity: .6; background: linear-gradient(0deg, #08090b 5%, rgba(8, 9, 11, .33) 60%, rgba(8, 9, 11, .6)), url('/img/atmosphere/revo-eclipse.png') 54% 0 / auto 85vh no-repeat; --ambient-scene-opacity: .5; }
    .login-backdrop::after { background: linear-gradient(0deg, #08090b, transparent 80%); }
    .login-footer { flex-wrap: wrap; gap: 12px; padding: 18px 0; font-size: 9.5px; }
    .login-footer p { order: 3; width: 100%; font-size: 8.5px; line-height: 1.7; }
    .login-footer > span { font-size: 9.5px; }
    .mode-tab { font-size: 10.5px; }
    .entry-note { font-size: 9.5px; }
}
@media (max-width: 370px) {
    .login-shell { padding: 0 16px; }
    .entry-card { padding: 24px 16px; }
    .identity { gap: 12px; }
    .avatar__btn { width: 46px; height: 46px; }
    .field-group label { font-size: 11px; }
    .field-group input { padding: 12px; font-size: 12.5px; }
    .public-room__copy > span { font-size: 9.5px; }
    .entry-heading h1 { font-size: 29px; }
}
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
