.reg-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: reg-fade-in 0.22s ease;
}

.reg-overlay {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  cursor: pointer;
  background: rgba(5, 5, 5, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.reg-modal {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  max-height: min(92vh, 720px);
  overflow-y: auto;
  padding: 2rem 1.6rem 1.75rem;
  border-radius: 24px;
  background: linear-gradient(160deg, #1a1a1a 0%, #0c0c0c 70%);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(132, 87, 255, 0.08);
  isolation: isolate;
  animation: reg-pop-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.reg-glow {
  position: absolute;
  top: -20%;
  left: 50%;
  width: 320px;
  height: 220px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--violet-soft), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.reg-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--glass-bg);
  color: var(--hint);
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.reg-close:hover {
  background: var(--glass-bg-strong);
  color: var(--text);
}

.reg-title {
  position: relative;
  z-index: 1;
  margin: 0.2rem 0 0.35rem;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
}

.reg-subtitle {
  position: relative;
  z-index: 1;
  margin: 0 0 1.6rem;
  text-align: center;
  color: var(--hint);
  font-size: 0.92rem;
}

.reg-form {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.reg-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.reg-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--hint);
  letter-spacing: 0.02em;
}

.reg-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.reg-input::placeholder {
  color: var(--hint-dim);
}

.reg-input:focus {
  border-color: var(--violet-border);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px var(--violet-soft);
}

.reg-field.is-invalid .reg-input {
  border-color: rgba(248, 113, 113, 0.75);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}

.reg-error {
  font-size: 0.78rem;
  color: #f87171;
  line-height: 1.35;
}

.reg-password-wrap {
  position: relative;
  display: block;
}

.reg-input--password {
  padding-right: 2.8rem;
}

.reg-eye {
  position: absolute;
  top: 50%;
  right: 0.55rem;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--hint);
  cursor: pointer;
}

.reg-eye:hover {
  color: var(--text);
  background: var(--glass-bg);
}

.reg-reqs {
  margin-top: -0.25rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.reg-reqs-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hint-dim);
  margin-bottom: 0.55rem;
}

.reg-reqs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.reg-reqs-list li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--hint);
}

.reg-reqs-list li.is-ok {
  color: #86efac;
}

.reg-reqs-list li.is-missing {
  color: var(--hint-dim);
}

.reg-submit {
  margin-top: 0.35rem;
  width: 100%;
}

.reg-submit:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.reg-submit:disabled:hover {
  opacity: 0.42;
}

@keyframes reg-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes reg-pop-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reg-root,
  .reg-modal {
    animation: none;
  }
}

@media (max-width: 480px) {
  .reg-modal {
    width: 100%;
    padding: 1.6rem 1.15rem 1.35rem;
    border-radius: 20px;
  }
}

.reg-root[hidden] { display: none !important; }

