/* ── OTP Input ────────────────────────────────────────────────── */
.fn-otp-field {
  position: relative;
  width: 100%;
}

.fn-otp-real {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  font-size: 1rem;
  letter-spacing: 2em;
  caret-color: transparent;
  z-index: 2;
}

.fn-otp-boxes {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  pointer-events: none;
}

.fn-otp-box {
  width: 48px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--neutral-400, #d1d5db);
  border-radius: 0.25rem;
  font-size: 1.25rem;
  font-weight: 600;
  background: var(--neutral-100, #fff);
  transition: border-color 0.15s, background-color 0.15s;
}

.fn-otp-box.is-active {
  border-color: var(--neutral-900, #111);
}

.fn-otp-box.is-filled {
  background-color: var(--neutral-200, #f5f5f5);
  border-color: var(--neutral-900, #111);
}

/* ── OTP status / resend ─────────────────────────────────────── */
.fn-otp-status {
  text-align: center;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--neutral-600, #6b7280);
}

.fn-otp-status-success {
  color: var(--green-600, #16a34a);
}

.fn-otp-resend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 0.75rem;
}

.fn-otp-resend button {
  font-size: 0.8125rem;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

.fn-otp-resend button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  text-decoration: none;
}

.fn-otp-resend-timer {
  font-size: 0.75rem;
  color: var(--neutral-600, #6b7280);
}

/* ── Error block ─────────────────────────────────────────────── */
.fn-otp-error-block {
  margin-top: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.375rem;
  background-color: var(--red-50, #fef2f2);
  border: 1px solid var(--red-200, #fecaca);
  color: var(--red-700, #b91c1c);
  font-size: 0.8125rem;
  text-align: center;
}

.fn-otp-error-block:empty {
  display: none;
}

/* ── Phone entry ─────────────────────────────────────────────── */
.fn-phone-prefix {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0 0.75rem;
  border-right: 1px solid var(--neutral-400, #d1d5db);
  font-size: 0.875rem;
  white-space: nowrap;
  user-select: none;
}

.fn-phone-input-wrap {
  display: flex;
  align-items: center;
  overflow: hidden;
  border-radius: 0.25rem;
  border: 1px solid var(--neutral-400, #d1d5db);
  transition: border-color 0.15s;
}

.fn-phone-input-wrap:focus-within {
  border-color: var(--neutral-900, #111);
}

.fn-phone-input-wrap input {
  flex: 1;
  border: none;
  padding: 0.75rem;
  font-size: 1rem;
  background: var(--neutral-100, #fff);
  outline: none;
}

/* ── Wrong-number link ───────────────────────────────────────── */
.fn-otp-wrong-number {
  text-align: center;
  margin-top: 0.5rem;
}

.fn-otp-wrong-number button {
  font-size: 0.75rem;
  color: var(--neutral-600, #6b7280);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

/* ── Register success ────────────────────────────────────────── */
.fn-register-success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem auto 1rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--neutral-900, #111);
  color: var(--neutral-100, #fff);
}

/* ── Password rule indicators ───────────────────────────────── */
.fn-auth-x.is-valid {
  color: var(--green-600, #16a34a);
}

/* ── Auth email-fallback link ────────────────────────────────── */
.fn-auth-email-link {
  display: block;
  text-align: center;
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--neutral-600, #6b7280);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

/* ── White loading dots on dark auth buttons ─────────────────── */
.fn-auth-panel .button-loading::after,
.fn-auth-panel .disabled\:button-loading:disabled::after {
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='3'%3E%3Ccircle r='1.5' cx='1.5' cy='1.5' fill='%23fff'%3E%3Canimate attributeName='opacity' begin='0' values='0;0.8;0' dur='1s' repeatCount='indefinite'/%3E%3C/circle%3E%3Ccircle r='1.5' cx='8.5' cy='1.5' fill='%23fff'%3E%3Canimate attributeName='opacity' begin='0.1s' values='0;0.8;0' dur='1s' repeatCount='indefinite'/%3E%3C/circle%3E%3Ccircle r='1.5' cx='15.5' cy='1.5' fill='%23fff'%3E%3Canimate attributeName='opacity' begin='0.2s' values='0;0.8;0' dur='1s' repeatCount='indefinite'/%3E%3C/circle%3E%3Ccircle r='1.5' cx='22.5' cy='1.5' fill='%23fff'%3E%3Canimate attributeName='opacity' begin='0.3s' values='0;0.8;0' dur='1s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") 50%/24px 3px no-repeat;
}

/* ── OTP verifying state ── */
.fn-otp-field.is-verifying .fn-otp-boxes {
  opacity: 0.5;
  pointer-events: none;
}
.fn-otp-field.is-verifying::after {
  content: '';
  display: block;
  width: 20px;
  height: 20px;
  margin: 12px auto 0;
  border: 2px solid var(--neutral-300, #d4d4d4);
  border-top-color: var(--neutral-900, #111);
  border-radius: 50%;
  animation: mc-otp-spin 0.6s linear infinite;
}
@keyframes mc-otp-spin {
  to { transform: rotate(360deg); }
}
