/* ===== bembem · auth ===== */
* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }
html, body { margin: 0; height: 100%; background: #000; }

:root { --dim: .15; }

.root[data-theme="midnight"] { --accent: #8aa0ff; --bg: url(assets/wall-midnight.jpg); }
.root[data-theme="crimson"]  { --accent: #e0564f; --bg: url(assets/wall-crimson.jpg); }
.root[data-theme="sakura"]   { --accent: #e98bb4; --bg: url(assets/wall-sakura.jpg); }
.root[data-theme="emerald"]  { --accent: #46d6a6; --bg: url(assets/wall-emerald.jpg); }

.root {
  position: fixed; inset: 0; overflow: hidden; background: #000;
  font-family: 'JetBrains Mono', monospace; color: #eef0f4;
}

.bg { position: absolute; inset: 0; background-image: var(--bg); background-size: cover; background-position: center; }
.overlay-dim { position: absolute; inset: 0; background: #000; opacity: var(--dim); }
.overlay-glow { position: absolute; inset: 0; background: radial-gradient(80% 60% at 50% 36%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%); }
.overlay-vignette { position: absolute; inset: 0; background: radial-gradient(130% 95% at 50% 44%, transparent 42%, rgba(0,0,0,.5) 100%); }

.wordmark { position: absolute; top: 18px; left: 20px; z-index: 10; font-size: 13px; letter-spacing: 1px; color: #c8cad4; font-weight: 600; }

.themes { position: absolute; bottom: 20px; right: 22px; z-index: 10; display: flex; gap: 9px; }
.sw { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: var(--sw); cursor: pointer; padding: 0; transition: transform .15s, box-shadow .15s; }
.sw:hover { transform: scale(1.12); }
.sw.active { box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--sw); }

.stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 60px 24px; z-index: 3; }
.card {
  position: relative; width: 356px; padding: 32px 30px 28px;
  background: rgba(15,16,21,.5);
  backdrop-filter: blur(30px) saturate(1.2); -webkit-backdrop-filter: blur(30px) saturate(1.2);
  border: 1px solid rgba(255,255,255,.1); border-radius: 24px;
  box-shadow: 0 40px 110px -30px rgba(0,0,0,.85), inset 0 1px 0 rgba(255,255,255,.05);
}
.screen { display: none; }
.screen.active { display: block; animation: fadeUp .5s cubic-bezier(.2,.8,.2,1) both; }

.head { display: flex; flex-direction: column; align-items: center; margin-bottom: 24px; }
.mark { position: relative; width: 66px; height: 66px; }
.mark.sm { width: 54px; height: 54px; }
.mark-orbit { position: absolute; inset: 0; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent); animation: orbit 26s linear infinite; }
.mark-dot { position: absolute; top: -3px; left: 50%; margin-left: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px var(--accent); }
.mark.sm .mark-dot { width: 5px; height: 5px; margin-left: -2.5px; }
.mark-core { position: absolute; inset: 15px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--accent) 90%, #fff), var(--accent)); box-shadow: 0 0 26px -2px color-mix(in srgb, var(--accent) 70%, transparent); animation: softGlow 5s ease-in-out infinite; }
.mark.sm .mark-core { inset: 13px; }

.title { margin-top: 18px; font-size: 16px; letter-spacing: .3px; color: #f1f3f7; text-align: center; }
.head .title { margin-top: 18px; }
.subtitle { margin-top: 6px; font-size: 11px; color: #9a9ba6; text-align: center; line-height: 1.6; }
.bright { color: #d2d4dc; }

.field-label { font-size: 11px; letter-spacing: .4px; color: #9a9ba6; }
.field-label.block { display: block; margin: 0 0 9px 2px; }
.field-label-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; }
.toggle-show { background: none; border: none; padding: 0; cursor: pointer; font: inherit; font-size: 10.5px; color: #82838f; transition: color .15s; }
.toggle-show:hover { color: #d2d4dc; }

.input {
  width: 100%; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.11);
  border-radius: 13px; padding: 13px 16px; color: #f1f3f7; font-family: inherit; font-size: 14px;
  outline: none; margin-bottom: 14px; transition: border-color .18s, box-shadow .18s, background .18s;
}
.input[type=password] { letter-spacing: .5px; }
.input:focus { border-color: var(--accent); background: rgba(255,255,255,.07); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.input::placeholder { color: rgba(226,228,236,.28); }

[data-screen="login"] .input { margin-bottom: 0; }

.meta-row { display: flex; align-items: center; justify-content: space-between; font-size: 11px; margin-top: 15px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; color: #9fa0ab; }
.check-box { width: 16px; height: 16px; border-radius: 5px; border: 1px solid rgba(255,255,255,.22); display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.03); }
.check-fill { width: 8px; height: 8px; border-radius: 2px; background: var(--accent); display: none; }
.check-box.on .check-fill { display: block; }
.link-dim { background: none; border: none; padding: 0; cursor: pointer; font: inherit; font-size: 11px; color: #9fa0ab; transition: color .15s; }
.link-dim:hover { color: var(--accent); }

.strength { display: flex; align-items: center; gap: 10px; margin: 10px 0 14px; }
.strength-bar { flex: 1; height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.strength-fill { height: 100%; border-radius: 4px; width: 0; transition: width .25s, background .25s; }
.strength-label { font-size: 10px; color: #9a9ba6; min-width: 54px; text-align: right; }

.otp { display: flex; gap: 8px; justify-content: space-between; margin-bottom: 18px; }
.otp-cell { width: 44px; height: 54px; text-align: center; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.11); border-radius: 13px; color: #f1f3f7; font-family: inherit; font-size: 21px; font-weight: 600; outline: none; transition: border-color .18s, box-shadow .18s, background .18s; }
.otp-cell:focus { border-color: var(--accent); background: rgba(255,255,255,.07); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.resend { text-align: center; font-size: 11px; color: #82838f; margin-bottom: 20px; }
.resend button { background: none; border: none; padding: 0; cursor: pointer; font: inherit; font-size: 11px; color: var(--accent); font-weight: 600; }

.btn {
  width: 100%; border: none; border-radius: 13px; padding: 14px; background: var(--accent);
  color: #15161c; font-family: inherit; font-weight: 600; font-size: 13px; letter-spacing: .3px;
  cursor: pointer; transition: filter .15s, transform .06s;
}
.login-gap { margin-top: 22px; }
[data-screen="login"] .btn, [data-screen="reset"] .btn { margin-top: 22px; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.alt { margin-top: 20px; text-align: center; font-size: 11px; color: #82838f; }
.link { background: none; border: none; padding: 0 0 0 5px; cursor: pointer; font: inherit; font-size: 11px; color: var(--accent); font-weight: 600; transition: filter .15s; }
.link:hover { filter: brightness(1.1); }

.done { text-align: center; }
.done-mark { width: 68px; height: 68px; margin: 6px auto 0; border-radius: 50%; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--accent) 90%, #fff), var(--accent)); display: flex; align-items: center; justify-content: center; color: #15161c; font-size: 30px; box-shadow: 0 16px 42px -12px color-mix(in srgb, var(--accent) 60%, transparent); }
.done .title { margin-top: 20px; font-size: 17px; font-weight: 600; }
.done .btn { margin-top: 26px; }
.root[data-done="register"] .done-reset { display: none; }
.root[data-done="reset"] .done-register { display: none; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes orbit { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes softGlow { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }

/* экран загрузки */
.auth-loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: #000; z-index: 50; }
.auth-loading span { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 28px; font-weight: 700; letter-spacing: 6px; color: #ffffff; animation: authPulse 1.4s ease-in-out infinite; }
@keyframes authPulse { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }
#root.auth-ready .auth-loading { display: none; }
