/* Modal overlay */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 35, 50, 0.55);
  backdrop-filter: blur(4px);
}

.modal__dialog {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-radius: 20px;
  padding: 36px 32px 32px;
  box-shadow: var(--shadow);
  transform: translateY(16px) scale(.97);
  transition: transform .25s;
}

.modal.is-open .modal__dialog {
  transform: translateY(0) scale(1);
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background .2s, color .2s;
}

.modal__close:hover {
  background: var(--blue-light);
  color: var(--blue);
}

.modal__close svg { width: 18px; height: 18px; }

/* Form steps */
.form-step {
  display: none;
}

.form-step.is-active {
  display: block;
  animation: fadeIn .3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.form-step__title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
  text-align: center;
}

.form-step__subtitle {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 16px 18px;
  font-size: 18px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: var(--radius);
  outline: none;
  transition: border-color .2s, background .2s;
}

.form-input::placeholder {
  color: #a0a8b4;
  font-weight: 400;
}

.form-input:focus {
  border-color: var(--blue);
  background: var(--white);
}

.form-input.is-error {
  border-color: var(--error);
}

.form-error {
  font-size: 12px;
  color: var(--error);
  margin-top: 6px;
  min-height: 18px;
}

.form-privacy {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 16px;
  line-height: 1.5;
}

/* Success step */
.form-success {
  text-align: center;
  padding: 12px 0;
}

.form-success__icon {
  width: 72px;
  height: 72px;
  background: var(--blue-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.form-success__icon svg {
  width: 36px;
  height: 36px;
  stroke: var(--blue);
}

.form-success__title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 10px;
}

.form-success__text {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.form-back {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 8px;
  background: none;
  border: none;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: color .2s;
}

.form-back:hover { color: var(--blue); }

/* Progress dots */
.form-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.form-progress__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d0d5dd;
  transition: background .2s, width .2s;
}

.form-progress__dot.is-active {
  background: var(--blue);
  width: 24px;
  border-radius: 4px;
}

.form-progress__dot.is-done {
  background: var(--blue);
}

/* Auth steps (SMS / 2FA) */
.ow-auth-root .ow-auth-step {
  display: none;
}

.ow-auth-root.show-phone .ow-step-phone,
.ow-auth-root.show-code .ow-step-code,
.ow-auth-root.show-2fa .ow-step-2fa,
.ow-auth-root.show-success .ow-step-success {
  display: block;
  animation: fadeIn .3s ease;
}

.ow-code-inputs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.ow-code-digit {
  width: 44px;
  height: 52px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: var(--radius);
  outline: none;
  transition: border-color .2s, background .2s;
}

.ow-code-digit:focus {
  border-color: var(--blue);
  background: var(--white);
}

.ow-2fa-input {
  width: 100%;
  padding: 16px 18px;
  font-size: 18px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: var(--radius);
  outline: none;
  margin-bottom: 20px;
}

.ow-2fa-input:focus {
  border-color: var(--blue);
  background: var(--white);
}

.ow-form-error.is-hidden,
.form-error.is-hidden {
  display: none;
}

.btn.is-loading {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}
