/* Merchant signup — aligned with wigope-merchant (Signup.jsx + ui/input) */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap");

:root {
  --wm-background: #ffffff;
  --wm-foreground: #0a0a0a;
  --wm-primary: hsl(25, 100%, 50%);
  --wm-primary-hover: hsl(25, 100%, 46%);
  --wm-muted: hsl(30, 100%, 96%);
  --wm-muted-fg: hsl(0, 0%, 45%);
  --wm-border: hsl(30, 30%, 90%);
  --wm-input-border: hsl(30, 30%, 90%);
  --wm-ring: hsl(25, 100%, 50%);
  --wm-destructive: hsl(0, 84%, 60%);
  --wm-radius: 1.25rem;
  --wm-radius-md: 0.625rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.auth-register-page {
  min-height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  margin: 0;
  font-family: "Poppins", sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  color: var(--wm-foreground);
  background: linear-gradient(to bottom right, hsl(25 100% 50% / 0.09), var(--wm-muted), var(--wm-muted));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

body.auth-register-page::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.28;
  background-image: linear-gradient(var(--wm-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--wm-border) 1px, transparent 1px);
  background-size: 28px 28px;
}

.reg-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: calc(100dvh - 2rem);
}

.reg-card {
  background: var(--wm-background);
  border: 1px solid var(--wm-border);
  border-radius: var(--wm-radius);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
  padding: 1.75rem 1.75rem 1.25rem;
  max-height: calc(100dvh - 2rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.reg-brand {
  text-align: center;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.reg-brand .wigope-logo--auth {
  max-height: 48px;
  margin: 0 auto;
}

.reg-brand-tagline {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--wm-foreground);
}

.reg-brand-sub {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--wm-muted-fg);
  font-weight: 400;
}

.reg-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-shrink: 0;
}

.reg-progress-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--wm-muted-fg);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.reg-step-label {
  display: none;
}

@media (min-width: 480px) {
  .reg-step-label {
    display: inline;
  }
}

.reg-progress-item .dot {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  border: 1px solid var(--wm-border);
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 0.6875rem;
  font-weight: 500;
}

.reg-progress-item.active .dot {
  border-color: var(--wm-primary);
  background: var(--wm-primary);
  color: #fff;
}

.reg-progress-item.done .dot {
  border-color: hsl(25 100% 50% / 0.35);
  background: hsl(25 100% 50% / 0.12);
  color: var(--wm-primary);
}

.reg-progress-line {
  width: 1.25rem;
  height: 1px;
  background: var(--wm-border);
}

.reg-progress-line.done {
  background: var(--wm-primary);
}

.reg-form-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.reg-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.reg-panels {
  flex: 1;
  min-height: 0;
}

.reg-panel {
  display: none;
}

.reg-panel.is-active {
  display: block;
  animation: regFade 0.2s ease;
}

@keyframes regFade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.reg-panel-title {
  text-align: center;
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.3;
  margin: 0 0 0.25rem;
  color: var(--wm-foreground);
}

.reg-panel-desc {
  text-align: center;
  font-size: 0.875rem;
  color: var(--wm-muted-fg);
  margin: 0 0 1rem;
}

.reg-fields {
  width: 100%;
}

.reg-form .form-group {
  margin-bottom: 1rem;
}

.reg-form label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  color: var(--wm-foreground);
  margin-bottom: 0.5rem;
}

/* wigope-merchant Input — wm-input avoids global .form-control in wigope-brand.css */
.reg-form .wm-input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 2.25rem;
  min-height: 2.25rem;
  border-radius: var(--wm-radius-md);
  border: 1px solid var(--wm-input-border);
  background-color: #ffffff;
  padding: 0.375rem 0.75rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.25rem;
  color: var(--wm-foreground);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.15s, border-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.reg-form .wm-input::placeholder {
  color: var(--wm-muted-fg);
  opacity: 1;
}

.reg-form .wm-input:focus {
  outline: none;
  border-color: var(--wm-ring);
  box-shadow: 0 0 0 1px var(--wm-ring);
}

.reg-form .wm-input.is-invalid {
  border-color: var(--wm-destructive);
  box-shadow: 0 0 0 1px var(--wm-destructive);
}

.wm-password-wrap {
  position: relative;
  width: 100%;
}

.wm-password-wrap .wm-input--password {
  padding-right: 2.5rem;
}

.wm-password-toggle {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--wm-muted-fg);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.wm-password-toggle:hover {
  color: var(--wm-foreground);
  background: hsl(30 30% 90% / 0.45);
}

.wm-password-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(25 100% 50% / 0.35);
}

.wm-password-toggle .wm-icon-eye-off {
  display: none;
}

.wm-password-toggle.is-visible .wm-icon-eye {
  display: none;
}

.wm-password-toggle.is-visible .wm-icon-eye-off {
  display: block;
}

.reg-phone-row {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.reg-phone-prefix {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  box-sizing: border-box;
  min-height: 2.25rem;
  padding: 0 0.75rem;
  border: 1px solid var(--wm-input-border);
  border-right: 0;
  border-radius: var(--wm-radius-md) 0 0 var(--wm-radius-md);
  background: var(--wm-muted);
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--wm-muted-fg);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.reg-form .wm-input.wm-input-phone {
  width: auto;
  flex: 1;
  min-width: 0;
  border-radius: 0 var(--wm-radius-md) var(--wm-radius-md) 0;
}

.reg-phone-row:focus-within .reg-phone-prefix {
  border-color: var(--wm-ring);
}

.reg-phone-row:focus-within .wm-input.wm-input-phone {
  border-color: var(--wm-ring);
  box-shadow: 0 0 0 1px var(--wm-ring);
}

.reg-form .field-error {
  display: none;
  margin-top: 0.35rem;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--wm-destructive);
}

.reg-form .field-error.show {
  display: block;
}

.reg-form .auth-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  cursor: pointer;
  margin-top: 0.25rem;
}

.reg-form .auth-checkbox input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.reg-form .auth-checkbox .checkmark {
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  margin-top: 0.125rem;
  border: 1px solid var(--wm-input-border);
  border-radius: 0.25rem;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  position: relative;
}

.reg-form .auth-checkbox input:checked + .checkmark {
  background: var(--wm-primary);
  border-color: var(--wm-primary);
}

.reg-form .auth-checkbox input:checked + .checkmark::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.reg-form .auth-checkbox span:last-child {
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--wm-muted-fg);
}

.reg-form .auth-checkbox a {
  color: var(--wm-primary);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.reg-form .auth-checkbox a:hover {
  text-decoration: none;
}

.password-strength {
  margin-top: 0.35rem;
}

.password-strength .strength-bar {
  height: 3px;
  background: var(--wm-border);
  border-radius: 2px;
  overflow: hidden;
}

.password-strength .strength-bar-fill {
  height: 100%;
  width: 0;
  transition: width 0.2s;
}

.strength-weak {
  width: 25%;
  background: var(--wm-destructive);
}
.strength-fair {
  width: 50%;
  background: #f59e0b;
}
.strength-good {
  width: 75%;
  background: var(--wm-primary);
}
.strength-strong {
  width: 100%;
  background: #16a34a;
}

.password-strength .strength-text {
  font-size: 0.75rem;
  color: var(--wm-muted-fg);
  margin-top: 0.25rem;
  display: block;
}

.reg-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-shrink: 0;
}

.btn-reg {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.75rem;
  padding: 0 1rem;
  border-radius: var(--wm-radius-md);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.btn-reg-ghost {
  background: var(--wm-background);
  color: var(--wm-foreground);
  border: 1px solid var(--wm-input-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-reg-ghost:hover {
  background: var(--wm-muted);
}

.btn-reg-primary {
  background: var(--wm-primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.btn-reg-primary:hover {
  background: var(--wm-primary-hover);
}

.btn-reg-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-reg-ghost.hidden {
  display: none !important;
}

.reg-actions:not(:has(.btn-reg-ghost:not(.hidden))) .btn-reg-primary {
  flex: 1;
  width: 100%;
}

.reg-footer {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--wm-muted-fg);
  flex-shrink: 0;
}

.reg-footer a {
  color: var(--wm-primary);
  font-weight: 500;
  text-decoration: none;
}

.reg-footer a:hover {
  text-decoration: underline;
}

.reg-form-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.reg-forgot-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--wm-primary);
  text-decoration: none;
  white-space: nowrap;
}

.reg-forgot-link:hover {
  text-decoration: underline;
}

.reg-form .auth-checkbox--inline {
  align-items: center;
  margin-top: 0;
}

.reg-step-section {
  display: none;
}

.reg-step-section.is-active {
  display: block;
  animation: regFade 0.2s ease;
}

/* Top-right toasts (wigope-merchant / react-hot-toast style) */
.wm-toast-host {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  pointer-events: none;
  max-width: min(22rem, calc(100vw - 2rem));
}

.wm-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  background: var(--wm-background);
  border: 1px solid var(--wm-border);
  border-radius: var(--wm-radius-md);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.06);
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--wm-foreground);
  opacity: 0;
  transform: translateX(0.75rem);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.wm-toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.wm-toast__icon {
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  margin-top: 0.35rem;
  border-radius: 9999px;
}

.wm-toast--error .wm-toast__icon {
  background: var(--wm-destructive);
}

.wm-toast--success .wm-toast__icon {
  background: var(--wm-primary);
}

.wm-toast__text {
  flex: 1;
  min-width: 0;
}

/* OTP verify (same shell as signup) */
.reg-mobile-pill {
  display: flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0 auto 1rem;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  background: var(--wm-muted);
  border: 1px solid var(--wm-border);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--wm-foreground);
  letter-spacing: 0.02em;
}

.reg-mobile-pill__prefix {
  color: var(--wm-muted-fg);
  font-weight: 500;
}

.reg-otp-group {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  width: 100%;
}

.reg-otp-box {
  box-sizing: border-box;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 2.75rem;
  text-align: center;
  border-radius: var(--wm-radius-md);
  border: 1px solid var(--wm-input-border);
  background-color: #ffffff;
  font-family: inherit;
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1;
  color: var(--wm-foreground);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
  padding: 0;
}

.reg-otp-box:focus {
  outline: none;
  border-color: var(--wm-ring);
  box-shadow: 0 0 0 1px var(--wm-ring);
}

.reg-otp-box.filled {
  border-color: hsl(25 100% 50% / 0.45);
}

.reg-otp-box.is-invalid {
  border-color: var(--wm-destructive);
  box-shadow: 0 0 0 1px var(--wm-destructive);
}

.reg-otp-group.shake {
  animation: regOtpShake 0.45s ease;
}

@keyframes regOtpShake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-6px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(4px);
  }
}

.reg-otp-timer {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--wm-muted-fg);
}

.reg-otp-timer .timer-count {
  color: var(--wm-primary);
  font-weight: 500;
}

.reg-otp-resend {
  display: inline;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--wm-primary);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.reg-otp-resend:hover {
  color: var(--wm-primary-hover);
}

.reg-dev-hint {
  text-align: center;
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--wm-muted-fg);
  background: hsl(25 100% 50% / 0.08);
  border: 1px solid hsl(25 100% 50% / 0.2);
  border-radius: var(--wm-radius-md);
}

.reg-dev-hint code {
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--wm-primary);
}

.btn-reg.is-loading {
  opacity: 0.75;
  pointer-events: none;
}

@media (max-width: 380px) {
  .reg-otp-box {
    width: 2.35rem;
    height: 2.35rem;
    flex: 0 0 2.35rem;
    font-size: 1rem;
  }
  .reg-otp-group {
    gap: 0.35rem;
  }
}

@media (max-height: 700px) {
  .reg-card {
    padding: 1.25rem 1.25rem 1rem;
  }
  .reg-form .form-group {
    margin-bottom: 0.75rem;
  }
}
