/* ─────────────────────────────────────────────
   nijinn.io — Sign-up Modal Styles (`signup/signup-modal.css`)
   Matches modern green brand (#059669) aesthetics and screenshot specs.
   ───────────────────────────────────────────── */

/* ───── Overlay Backdrop ───── */
.signup-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: rgba(8, 18, 14, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 240ms cubic-bezier(0.16, 1, 0.3, 1), visibility 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.signup-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

/* ───── Modal Container Card ───── */
.signup-modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 
    0 24px 48px -12px rgba(0, 0, 0, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.05);
  padding: 32px 36px;
  box-sizing: border-box;
  transform: scale(0.94) translateY(12px);
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--font-ui, 'Inter', system-ui, -apple-system, sans-serif);
  color: #1A1A1A;
}

.signup-backdrop.is-open .signup-modal {
  transform: scale(1) translateY(0);
}

/* ───── Close Button ───── */
.signup-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9CA3AF;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.signup-close-btn:hover {
  background-color: #F3F4F6;
  color: #1A1A1A;
}

/* ───── Header Navigation (Back Arrow & Logo) ───── */
.signup-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin-bottom: 20px;
}

.signup-back-btn {
  background: transparent;
  border: none;
  color: #6B7280;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 140ms ease, background-color 140ms ease;
}

.signup-back-btn:hover {
  color: #1A1A1A;
  background-color: #F3F4F6;
}

.signup-back-btn[hidden] {
  visibility: hidden;
  pointer-events: none;
}

.signup-brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.signup-brand-logo img {
  height: 30px;
  width: auto;
}

/* ───── Step Container Animation ───── */
.signup-step {
  display: none;
  animation: signupFadeIn 220ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.signup-step.is-active {
  display: block;
}

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

/* ───── Titles & Headings ───── */
.signup-title {
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  margin: 0 0 20px 0;
  letter-spacing: -0.015em;
  color: #111827;
}

.signup-subtitle {
  font-size: 13.5px;
  color: #6B7280;
  text-align: center;
  margin: -12px 0 24px 0;
  line-height: 1.45;
}

.signup-subtitle strong {
  color: #111827;
  font-weight: 600;
}

/* ───── Form Groups & Inputs ───── */
.signup-form-group {
  margin-bottom: 16px;
  text-align: left;
}

.signup-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

.signup-label .required-star {
  color: #DC2626;
  margin-left: 2px;
}

.signup-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.signup-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #111827;
  background-color: #FFFFFF;
  box-sizing: border-box;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.signup-input::placeholder {
  color: #9CA3AF;
}

.signup-input:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.signup-input.has-error {
  border-color: #DC2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.signup-toggle-password {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: #9CA3AF;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 140ms ease;
}

.signup-toggle-password:hover {
  color: #4B5563;
}

.signup-field-error {
  display: block;
  color: #DC2626;
  font-size: 12px;
  margin-top: 5px;
  line-height: 1.3;
}

/* ───── Password Requirements Checklist ───── */
.signup-requirements {
  margin: 16px 0 20px 0;
  background: #F9FAFB;
  border: 1px solid #F3F4F6;
  border-radius: 8px;
  padding: 12px 14px;
}

.signup-req-title {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.signup-req-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #6B7280;
  margin-bottom: 6px;
  transition: color 160ms ease;
}

.signup-req-item:last-child {
  margin-bottom: 0;
}

.signup-req-item.is-valid {
  color: #059669;
  font-weight: 500;
}

.signup-req-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #E5E7EB;
  color: #6B7280;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
  transition: background-color 160ms ease, color 160ms ease;
}

.signup-req-item.is-valid .signup-req-icon {
  background: #059669;
  color: #FFFFFF;
}

/* ───── Primary Button ───── */
.signup-submit-btn {
  width: 100%;
  height: 44px;
  background: #059669;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 160ms ease, transform 100ms ease, opacity 160ms ease;
}

.signup-submit-btn:hover:not(:disabled) {
  background: #047857;
}

.signup-submit-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.signup-submit-btn:disabled {
  background: #E5E7EB;
  color: #9CA3AF;
  cursor: not-allowed;
}

/* Spinner inside button */
.signup-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: signupSpin 0.7s linear infinite;
}

@keyframes signupSpin {
  to { transform: rotate(360deg); }
}

/* ───── API Error Alert Box ───── */
.signup-api-error {
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  color: #991B1B;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.4;
  text-align: left;
}

/* ───── OTP 6-Digit Inputs Grid ───── */
.signup-otp-grid {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 24px 0 16px 0;
}

.signup-otp-box {
  width: 48px;
  height: 54px;
  border: 1.5px solid #D1D5DB;
  border-radius: 10px;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  font-family: var(--font-mono, monospace);
  color: #111827;
  background: #FFFFFF;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.signup-otp-box:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 3.5px rgba(5, 150, 105, 0.18);
}

.signup-otp-box.has-error {
  border-color: #DC2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

/* ───── Resend Code & Auxiliary Links ───── */
.signup-resend-wrap {
  text-align: center;
  margin-bottom: 24px;
  font-size: 13px;
}

.signup-resend-btn {
  background: transparent;
  border: none;
  color: #059669;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 140ms ease, background-color 140ms ease;
}

.signup-resend-btn:hover:not(:disabled) {
  color: #047857;
  background-color: #ECFDF5;
}

.signup-resend-btn:disabled {
  color: #9CA3AF;
  cursor: not-allowed;
  font-weight: 500;
}

.signup-goback-btn {
  display: inline-block;
  background: transparent;
  border: none;
  color: #374151;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  margin-top: 16px;
  text-align: center;
  width: 100%;
  padding: 8px 0;
  transition: color 140ms ease;
}

.signup-goback-btn:hover {
  color: #059669;
}

/* ───── Legal Footer Disclaimer ───── */
.signup-legal-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #F3F4F6;
  font-size: 11px;
  color: #9CA3AF;
  text-align: center;
  line-height: 1.45;
}

.signup-legal-footer a {
  color: #6B7280;
  text-decoration: underline;
}

.signup-legal-footer a:hover {
  color: #059669;
}

/* ───── Step 3: Success Screen (Inspired by PasswordChangedModal.png) ───── */
.signup-success-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 0 8px 0;
}

.signup-success-icon-wrap {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #059669;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  box-shadow: 0 8px 20px rgba(5, 150, 105, 0.25);
}

.signup-success-icon-wrap svg {
  width: 34px;
  height: 34px;
}

.signup-success-title {
  font-size: 22px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 10px 0;
  line-height: 1.3;
}

.signup-success-desc {
  font-size: 14px;
  color: #6B7280;
  margin: 0 0 28px 0;
  line-height: 1.5;
}

.signup-success-btn {
  width: 100%;
  height: 46px;
  background: #059669;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 160ms ease, transform 100ms ease;
}

.signup-success-btn:hover {
  background: #047857;
}

.signup-success-btn:active {
  transform: translateY(1px);
}

/* ───── Header Nav Sign-up Button ───── */
.site-header .nav-signup-btn {
  background: #059669;
  color: #FFFFFF;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 160ms ease, transform 100ms ease;
}

.site-header .nav-signup-btn:hover {
  background: #047857;
  color: #FFFFFF;
}

.site-header .nav-signup-btn:active {
  transform: translateY(1px);
}

/* Responsive tweaks */
@media (max-width: 480px) {
  .signup-modal {
    padding: 24px 20px;
  }

  .signup-otp-grid {
    gap: 5px;
  }

  .signup-otp-box {
    width: 40px;
    height: 48px;
    font-size: 18px;
  }
}
