*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg-obsidian: #05070b;
  --ice-bright: #eef3fb;
  --ice-soft: rgba(232, 239, 250, 0.8);
  --ice-muted: rgba(164, 179, 201, 0.58);
  --line: rgba(198, 214, 236, 0.22);
  --line-focus: rgba(238, 244, 255, 0.88);
  --display: "Unbounded", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sans: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-obsidian);
  color: var(--ice-bright);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}


.bg-layer {
  position: fixed;
  inset: -2%;
  z-index: 0;
  pointer-events: none;
  background-color: #030408;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0;
  will-change: transform;
  transition: opacity 0.75s ease;
}

.bg-layer.is-ready {
  opacity: 1;
}

.bg-gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.bg-gl.is-ready {
  opacity: 1;
}

.frosted-scene {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.ambient-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(70px);
}

.ambient-glow--slate {
  width: 58vw;
  height: 66vh;
  left: 8vw;
  top: 16vh;
  background: radial-gradient(circle, rgba(29, 48, 76, 0.52) 0%, rgba(14, 23, 38, 0.18) 60%, transparent 100%);
  animation: slowDriftA 16s ease-in-out infinite alternate;
}

.ambient-glow--ice {
  width: 48vw;
  height: 64vh;
  right: 6vw;
  top: 14vh;
  background: radial-gradient(circle, rgba(226, 236, 250, 0.24) 0%, rgba(148, 170, 200, 0.1) 52%, transparent 82%);
  animation: slowDriftB 19s ease-in-out infinite alternate;
}

@keyframes slowDriftA {
  0%   { transform: translate3d(-1.5%, -1%, 0) scale(1); }
  100% { transform: translate3d(1.5%, 1.5%, 0) scale(1.05); }
}

@keyframes slowDriftB {
  0%   { transform: translate3d(1%, -1.5%, 0) scale(1); }
  100% { transform: translate3d(-2%, 1%, 0) scale(1.06); }
}

.atmosphere-canvas {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}


.deck-shell {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(22px, 3.4vh, 42px) clamp(26px, 4.4vw, 72px);
}


.deck-header {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 36px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  text-decoration: none;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), filter 0.3s ease;
}

.brand-mark:hover {
  transform: rotate(45deg) scale(1.08);
  filter: drop-shadow(0 0 12px rgba(215, 230, 255, 0.55));
}

.brand-star {
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 2px 10px rgba(190, 212, 245, 0.28));
}

.deck-nav {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 3.6vw, 48px);
}

.deck-nav-btn {
  position: relative;
  border: 0;
  background: transparent;
  height: 30px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.03em;
  color: var(--ice-muted);
  cursor: pointer;
  transition: color 0.25s ease;
}

.deck-nav-btn:hover {
  color: var(--ice-soft);
}

.deck-nav-btn.is-active {
  color: var(--ice-bright);
  font-weight: 400;
}

.deck-nav-btn.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(235, 242, 255, 0.88), transparent);
}


.deck-main {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
}

.auth-column {
  display: flex;
  flex-direction: column;
  gap: 2.1rem;
  width: min(460px, 100%);
  animation: fadeRise 0.75s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fadeRise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.headline-block {
  display: flex;
  flex-direction: column;
}

.deck-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.4rem, 4.1vw, 3.85rem);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--ice-bright);
}


.deck-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-width: 430px;
}

.field-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.72rem 0 0.66rem;
  border-bottom: 1px solid var(--line);
  max-height: 3.6rem;
  transition: border-color 0.25s ease, max-height 0.3s ease, opacity 0.25s ease, padding 0.3s ease, margin 0.3s ease;
  cursor: text;
}

.field-row::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 0%;
  height: 1px;
  background: var(--line-focus);
  transition: width 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.field-row:focus-within::after {
  width: 100%;
}

.field-row--collapsible.is-collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: -0.9rem;
  border-bottom-color: transparent;
  overflow: hidden;
  pointer-events: none;
}

.field-label {
  flex-shrink: 0;
  width: 5.5rem;
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: var(--ice-muted);
}

.field-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ice-bright);
  font-family: var(--sans);
  font-size: 0.96rem;
  font-weight: 400;
  letter-spacing: 0.005em;
  outline: none;
  user-select: text;
}

.field-input::placeholder {
  color: rgba(154, 170, 194, 0.46);
  font-weight: 300;
}

.field-input.is-blurred {
  filter: blur(5.5px);
  transition: filter 0.18s ease;
}

.field-input:not(.is-blurred) {
  filter: none;
  transition: filter 0.18s ease;
}

.nick-suggest-hint {
  margin: -0.45rem 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: rgba(168, 198, 238, 0.85);
  max-height: 3.4rem;
  overflow: hidden;
  opacity: 1;
  transition: max-height 0.25s ease, opacity 0.25s ease, margin 0.25s ease;
}

.nick-suggest-hint.is-collapsed {
  max-height: 0;
  margin-top: -0.9rem;
  opacity: 0;
  pointer-events: none;
}


.peek-guard {
  position: fixed;
  left: 58.2%;
  top: 17.5%;
  transform: translate(-50%, -50%) scale(0.97);
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.65s ease, transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
}

.peek-guard.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

body.devtools-lock-active > *:not(#peek-guard) {
  visibility: hidden !important;
  pointer-events: none !important;
}

.peek-guard-halo {
  position: absolute;
  inset: -26px -44px;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(215, 230, 250, 0.24) 0%, rgba(150, 175, 208, 0.08) 52%, transparent 78%);
  filter: blur(18px);
  animation: handPressGlow 7.1s ease-in-out infinite;
}

.peek-guard-shadow,
.peek-guard-core {
  display: block;
  font-family: var(--display);
  font-size: clamp(0.95rem, 1.55vw, 1.38rem);
  font-weight: 400;
  letter-spacing: 0.04em;
}

.peek-guard-shadow {
  color: rgba(6, 10, 17, 0.86);
  filter: blur(4.2px);
  animation: handGlassPress 7.1s ease-in-out infinite;
}

.peek-guard-core {
  position: absolute;
  inset: 0;
  color: rgba(220, 234, 252, 0.56);
  filter: blur(1.8px);
  text-shadow: 0 0 18px rgba(214, 230, 252, 0.36);
  animation: handGlassPressCore 7.1s ease-in-out infinite;
}

@keyframes handGlassPress {
  0%, 100% { filter: blur(6.2px); opacity: 0.7; transform: scale(0.97) translateY(2px); }
  50%      { filter: blur(2.4px); opacity: 0.96; transform: scale(1.015) translateY(-1px); }
}

@keyframes handGlassPressCore {
  0%, 100% { filter: blur(3.4px); opacity: 0.32; transform: scale(0.97) translateY(2px); }
  50%      { filter: blur(0.9px); opacity: 0.72; transform: scale(1.015) translateY(-1px); }
}

@keyframes handPressGlow {
  0%, 100% { opacity: 0.45; transform: scale(0.95); }
  50%      { opacity: 0.92; transform: scale(1.06); }
}

.field-mini {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  padding: 2px 0;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--ice-muted);
  cursor: pointer;
  transition: color 0.2s ease;
}

.field-mini:hover {
  color: var(--ice-bright);
}


.pw-meter {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  max-height: 1.6rem;
  overflow: hidden;
  transition: max-height 0.28s ease, opacity 0.25s ease;
}

.pw-meter.is-collapsed {
  max-height: 0;
  opacity: 0;
}

.pw-track {
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: rgba(180, 198, 224, 0.15);
  overflow: hidden;
}

.pw-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: #8fb4e8;
  transition: width 0.32s ease, background 0.32s ease;
}

.pw-label {
  font-size: 0.76rem;
  color: var(--ice-muted);
  min-width: 7.6rem;
  text-align: right;
}


.form-error {
  margin: 0;
  max-height: 0;
  overflow: hidden;
  font-size: 0.84rem;
  font-weight: 400;
  color: #f29cb0;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.25s ease;
}

.form-error.is-visible {
  max-height: 2.5rem;
  opacity: 1;
}

.auth-column.is-shaking {
  animation: panelShake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes panelShake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}


.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.4rem;
  margin-top: 0.65rem;
}

.btn-capsule {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 152px;
  padding: 0.86rem 1.7rem;
  border-radius: 9999px;
  border: 1px solid rgba(214, 226, 245, 0.26);
  background: linear-gradient(135deg, rgba(235, 242, 252, 0.95) 0%, rgba(196, 210, 230, 0.88) 100%);
  color: #070b12;
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(3, 6, 12, 0.45);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease, background 0.22s ease;
}

.btn-capsule:hover {
  transform: translateY(-1px);
  background: #ffffff;
  box-shadow: 0 16px 38px rgba(185, 206, 238, 0.22);
}

.btn-capsule:active {
  transform: translateY(0) scale(0.985);
}

.secondary-links {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}

.link-clean {
  border: 0;
  background: transparent;
  padding: 4px 0;
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--ice-soft);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.link-clean:hover {
  color: #ffffff;
}

.link-sep {
  color: rgba(164, 179, 201, 0.34);
  font-size: 0.84rem;
}


.welcome {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.welcome-line {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--ice-soft);
}

.dots i {
  display: inline-block;
  font-style: normal;
  animation: dotBounce 1.1s ease-in-out infinite;
}
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }

@keyframes dotBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-3px); opacity: 1; }
}

.auth-column.is-success .deck-form {
  position: absolute;
  height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-column.is-success .welcome {
  display: flex;
  animation: fadeRise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}


.deck-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.footer-tg {
  font-family: var(--display);
  font-size: 0.74rem;
  font-weight: 300;
  color: var(--ice-muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.22s ease, text-shadow 0.22s ease;
}

.footer-tg:hover {
  color: var(--ice-bright);
  text-shadow: 0 0 14px rgba(210, 228, 255, 0.38);
}


.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 10px);
  z-index: 30;
  padding: 0.6rem 1.25rem;
  border-radius: 9999px;
  font-family: var(--sans);
  font-size: 0.84rem;
  color: var(--ice-bright);
  background: rgba(12, 18, 28, 0.88);
  border: 1px solid rgba(205, 220, 242, 0.22);
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 720px) {
  .field-input,
  input,
  textarea,
  select {
    font-size: 16px !important;
  }
}

.deck-shell {
  animation: authPageFade 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.is-hidden {
  display: none !important;
}

.login-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0;
}

.remember-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--ice-soft);
  cursor: pointer;
}

.remember-check input[type="checkbox"] {
  accent-color: #c9defa;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.forgot-link-btn {
  border: 0;
  background: transparent;
  padding: 2px 0;
  font-family: var(--sans);
  font-size: 0.84rem;
  color: #f3b0c3;
  cursor: pointer;
  animation: authPageFade 0.25s ease both;
}

.forgot-link-btn:hover {
  color: #ffd5e0;
  text-decoration: underline;
}

.forgot-pw-panel {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-width: 430px;
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(10, 15, 24, 0.72);
  border: 1px solid rgba(198, 214, 236, 0.16);
  box-shadow: 0 0 28px rgba(130, 170, 235, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(18px);
  animation: authPageFade 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.forgot-pw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.forgot-pw-title {
  font-family: var(--display);
  font-size: 0.84rem;
  color: var(--ice-bright);
}

.btn-capsule,
.toast {
  box-shadow: 0 0 20px rgba(140, 180, 240, 0.09);
}

@keyframes authPageFade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
