/* ==========================================================================
   ERPrath — Company signup page
   Uses the global design tokens defined in style.css.
   ========================================================================== */

.signup-page {
  background: #fbfbfd;
}

.signup-section {
  position: relative;
  padding: 8.5rem 0 5.5rem;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 8%, rgba(0, 113, 227, 0.07) 0%, transparent 42%),
    radial-gradient(circle at 88% 18%, rgba(0, 169, 224, 0.06) 0%, transparent 38%),
    linear-gradient(180deg, #fbfbfd 0%, #ffffff 62%, #fbfbfd 100%);
}

.signup-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(0, 113, 227, 0.1) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 62%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 62%);
  pointer-events: none;
  opacity: 0.45;
}

.signup-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(10px);
}

.signup-glow-1 {
  width: 520px;
  height: 520px;
  top: -220px;
  left: -180px;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.09) 0%, rgba(255, 255, 255, 0) 70%);
}

.signup-glow-2 {
  width: 440px;
  height: 440px;
  right: -140px;
  bottom: 2rem;
  background: radial-gradient(circle, rgba(0, 169, 224, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
}

.signup-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 560px);
  align-items: start;
  gap: clamp(2.5rem, 6vw, 6rem);
}

/* --------------------------------------------------------------------------
   Left column — value proposition
   -------------------------------------------------------------------------- */

.signup-copy {
  padding-top: 1.25rem;
  max-width: 640px;
}

.signup-copy h1 {
  margin: 1.35rem 0 1.1rem;
  font-size: clamp(2.4rem, 4vw, 3.5rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.04em;
  color: var(--text-main);
}

.signup-lead {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 58ch;
}

.signup-benefits {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 2rem 0 2.25rem;
  padding: 0;
  list-style: none;
}

.signup-benefits li {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  font-size: 0.93rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.signup-benefits strong {
  color: var(--text-main);
  font-weight: 700;
}

.benefit-icon {
  flex: 0 0 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  border-radius: 50%;
  background: rgba(6, 127, 55, 0.1);
  color: var(--accent-emerald);
}

.benefit-icon svg {
  width: 14px;
  height: 14px;
}

.signup-trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 1.1rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  max-width: 470px;
}

.signup-trust-strip > div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0 1.4rem;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
}

.signup-trust-strip > div:first-child {
  padding-left: 0;
  border-left: 0;
}

.signup-trust-strip strong {
  font-family: var(--font-main);
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.signup-trust-strip span {
  font-size: 0.76rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.signup-signin-note {
  margin-top: 1.4rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.signup-signin-note a {
  color: var(--primary);
  font-weight: 600;
}

.signup-signin-note a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Right column — form card
   -------------------------------------------------------------------------- */

.signup-card-wrap {
  width: 100%;
  max-width: 560px;
  justify-self: end;
}

.signup-card {
  position: relative;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: var(--radius-lg);
  padding: clamp(1.4rem, 2.6vw, 2.25rem);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.09), 0 2px 8px rgba(0, 0, 0, 0.03);
}

.signup-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 3px;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--accent-cyan), transparent);
  opacity: 0.8;
}

.signup-card-heading {
  margin-bottom: 1.5rem;
}

.signup-card-kicker {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--primary);
}

.signup-card h2 {
  font-size: clamp(1.45rem, 2.5vw, 1.8rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.signup-card-heading p {
  margin-top: 0.4rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Form fields
   -------------------------------------------------------------------------- */

.sf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 0.9rem;
}

.sf-field {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  min-width: 0;
}

.sf-field.full {
  grid-column: 1 / -1;
}

.sf-field > label,
.plan-fieldset > legend {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.005em;
}

.req {
  color: var(--danger);
}

.sf-field .form-control {
  width: 100%;
  padding: 0.72rem 0.9rem;
  font-size: 0.92rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.sf-field .form-control:hover {
  border-color: rgba(0, 0, 0, 0.14);
}

.sf-field .form-control:focus {
  background: #ffffff;
}

.sf-field.has-error .form-control,
.sf-field .form-control[aria-invalid="true"] {
  border-color: var(--danger);
  background: #fff7f7;
  box-shadow: 0 0 0 3px rgba(215, 0, 21, 0.08);
}

.field-hint {
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text-dim);
}

.field-error {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--danger);
}

.field-error[hidden] {
  display: none !important;
}

/* Password visibility toggle */
.password-wrap {
  position: relative;
}

.password-wrap .form-control {
  padding-right: 2.9rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.3rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--primary);
  background: rgba(0, 113, 227, 0.07);
  outline: none;
}

.password-toggle svg {
  width: 17px;
  height: 17px;
}

.password-toggle .eye-closed {
  display: none;
}

.password-toggle[aria-pressed="true"] .eye-open {
  display: none;
}

.password-toggle[aria-pressed="true"] .eye-closed {
  display: block;
}

/* Password strength meter */
.password-strength {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.15rem;
}

.password-strength[hidden] {
  display: none !important;
}

.password-strength-bars {
  display: flex;
  gap: 3px;
  flex: 1;
}

.password-strength-bars span {
  height: 4px;
  flex: 1;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  transition: background 0.2s ease;
}

.password-strength[data-level="1"] .password-strength-bars span:nth-child(-n+1) {
  background: #d70015;
}

.password-strength[data-level="2"] .password-strength-bars span:nth-child(-n+2) {
  background: #b25000;
}

.password-strength[data-level="3"] .password-strength-bars span:nth-child(-n+3) {
  background: #0071e3;
}

.password-strength[data-level="4"] .password-strength-bars span {
  background: #067f37;
}

.password-strength-label {
  flex: 0 0 auto;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
}

.password-strength[data-level="1"] .password-strength-label { color: #d70015; }
.password-strength[data-level="2"] .password-strength-label { color: #b25000; }
.password-strength[data-level="3"] .password-strength-label { color: #0071e3; }
.password-strength[data-level="4"] .password-strength-label { color: #067f37; }

/* --------------------------------------------------------------------------
   Plan selector
   -------------------------------------------------------------------------- */

.plan-fieldset {
  margin: 0.15rem 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.plan-fieldset > legend {
  padding: 0;
  margin-bottom: 0.5rem;
}

.plan-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.plan-option {
  position: relative;
  display: block;
  cursor: pointer;
  min-width: 0;
}

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

.plan-option-body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  height: 100%;
  min-height: 100px;
  padding: 0.7rem 0.65rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  background: #ffffff;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.plan-option:hover .plan-option-body {
  border-color: rgba(0, 113, 227, 0.4);
  background: rgba(0, 113, 227, 0.025);
}

.plan-option input:checked + .plan-option-body {
  border-color: var(--primary);
  background: rgba(0, 113, 227, 0.055);
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.12);
}

.plan-option input:focus-visible + .plan-option-body {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.plan-option-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.plan-name {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.plan-price {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
}

.plan-price span {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-dim);
}

.plan-desc {
  font-size: 0.67rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.plan-badge {
  display: inline-flex;
  align-self: flex-start;
  margin-top: auto;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: rgba(6, 127, 55, 0.1);
  color: var(--accent-emerald);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.plan-fieldset.has-error .plan-option-body {
  border-color: rgba(215, 0, 21, 0.45);
}

/* Terms checkbox */
.terms-field {
  margin-top: 0.1rem;
}

.checkbox-label {
  display: flex !important;
  align-items: flex-start;
  gap: 0.55rem;
  cursor: pointer;
  font-size: 0.78rem !important;
  font-weight: 500 !important;
  line-height: 1.45;
  color: var(--text-muted) !important;
}

.checkbox-label input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0.12rem 0 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.checkbox-label a {
  color: var(--primary);
  font-weight: 600;
}

.checkbox-label a:hover {
  text-decoration: underline;
}

.terms-field.has-error .checkbox-label {
  color: var(--danger) !important;
}

/* Error alert */
.signup-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 1.15rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(215, 0, 21, 0.2);
  border-radius: 12px;
  background: rgba(215, 0, 21, 0.055);
  color: var(--danger);
}

.signup-alert[hidden] {
  display: none !important;
}

.signup-alert-icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.signup-alert-body {
  min-width: 0;
}

.signup-alert-title {
  display: block;
  font-size: 0.81rem;
  font-weight: 800;
  line-height: 1.35;
}

.signup-alert-message {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #8f0010;
}

.signup-alert-list {
  margin: 0.35rem 0 0;
  padding-left: 1.05rem;
  list-style: disc;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #8f0010;
}

.signup-alert-list[hidden] {
  display: none !important;
}

/* Submit button */
.signup-submit {
  width: 100%;
  margin-top: 1.3rem;
  padding: 0.9rem 1.4rem;
  font-size: 0.95rem;
}

.signup-submit:disabled {
  cursor: wait;
  opacity: 0.8;
  transform: none;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.signup-submit-arrow {
  transition: transform 0.2s ease;
}

.signup-submit:not(:disabled):hover .signup-submit-arrow {
  transform: translateX(3px);
}

.signup-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: signupSpin 0.75s linear infinite;
  flex: 0 0 auto;
}

.signup-spinner[hidden] {
  display: none !important;
}

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

.signup-fineprint {
  margin-top: 0.9rem;
  font-size: 0.69rem;
  line-height: 1.5;
  color: var(--text-dim);
  text-align: center;
}

.signup-legal-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.45rem;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.signup-legal-links a {
  color: var(--text-muted);
  font-weight: 600;
}

.signup-legal-links a:hover {
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   Success state
   -------------------------------------------------------------------------- */

.signup-success {
  text-align: center;
}

.signup-success h2 {
  margin: 0.35rem 0 0.45rem;
}

.success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: rgba(6, 127, 55, 0.1);
  color: var(--accent-emerald);
  box-shadow: 0 0 0 7px rgba(6, 127, 55, 0.045);
}

.success-icon svg {
  width: 26px;
  height: 26px;
}

.success-message {
  margin: 0 auto 1.25rem;
  max-width: 44ch;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.company-code-block {
  padding: 1rem;
  margin-bottom: 1.25rem;
  border: 1px dashed rgba(0, 113, 227, 0.45);
  border-radius: 14px;
  background: rgba(0, 113, 227, 0.035);
}

.company-code-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
}

.company-code-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

.company-code-block code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(1.6rem, 4vw, 2.15rem);
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.2;
  color: var(--primary);
  word-break: break-all;
}

.code-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.38rem 0.6rem;
  border: 1px solid rgba(0, 113, 227, 0.22);
  border-radius: 8px;
  background: #ffffff;
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.code-copy-btn:hover,
.code-copy-btn:focus-visible {
  background: rgba(0, 113, 227, 0.07);
  border-color: rgba(0, 113, 227, 0.45);
  outline: none;
}

.code-copy-btn svg {
  width: 13px;
  height: 13px;
}

.copy-status {
  display: block;
  min-height: 1em;
  margin-top: 0.35rem;
  font-size: 0.67rem;
  font-weight: 600;
  color: var(--accent-emerald);
}

.success-details {
  margin: 0 0 1.1rem;
  padding: 0.15rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  text-align: left;
}

.success-details > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.52rem 0;
}

.success-details > div + div {
  border-top: 1px solid rgba(0, 0, 0, 0.055);
}

.success-details dt {
  flex: 0 0 auto;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-dim);
}

.success-details dd {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: right;
  overflow-wrap: anywhere;
}

.success-next {
  padding: 0.95rem 1rem;
  margin-bottom: 1.2rem;
  border-radius: 12px;
  background: var(--bg-card);
  text-align: left;
}

.success-next h3 {
  margin: 0 0 0.45rem;
  font-size: 0.79rem;
  font-weight: 800;
  color: var(--text-main);
}

.success-next ol {
  margin: 0;
  padding-left: 1.05rem;
  list-style: decimal;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.success-next strong {
  color: var(--text-main);
}

.signup-success .signup-submit {
  margin-top: 0;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .signup-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 510px);
    gap: 2.5rem;
  }

  .signup-copy h1 {
    font-size: clamp(2.2rem, 3.5vw, 3rem);
  }
}

@media (max-width: 1024px) {
  .signup-section {
    padding-top: 7.5rem;
  }

  .signup-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    max-width: 720px;
    margin: 0 auto;
  }

  .signup-copy {
    max-width: 100%;
    padding-top: 0;
  }

  .signup-copy h1 {
    font-size: clamp(2.2rem, 5.5vw, 3.2rem);
  }

  .signup-card-wrap {
    max-width: 100%;
    justify-self: stretch;
  }
}

@media (max-width: 640px) {
  .signup-section {
    padding: 7rem 0 3.5rem;
  }

  .signup-copy h1 {
    font-size: clamp(2rem, 8vw, 2.6rem);
  }

  .signup-lead {
    font-size: 0.95rem;
  }

  .signup-card {
    padding: 1.25rem;
    border-radius: 20px;
  }

  .sf-grid {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .sf-field {
    grid-column: 1 / -1;
  }

  .plan-options {
    grid-template-columns: 1fr;
  }

  .plan-option-body {
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.2rem 0.75rem;
  }

  .plan-option-top {
    display: contents;
  }

  .plan-name {
    grid-column: 1;
    grid-row: 1;
  }

  .plan-price {
    grid-column: 2;
    grid-row: 1;
  }

  .plan-desc {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .plan-badge {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    margin-top: 0;
  }

  .signup-trust-strip {
    max-width: 100%;
    justify-content: space-between;
  }

  .signup-trust-strip > div {
    padding: 0 0.9rem;
  }

  .signup-trust-strip strong {
    font-size: 1rem;
  }

  .company-code-row {
    flex-direction: column;
    gap: 0.45rem;
  }
}

@media (max-width: 400px) {
  .signup-trust-strip > div {
    padding: 0 0.7rem;
  }

  .signup-trust-strip span {
    font-size: 0.68rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .signup-spinner {
    animation-duration: 1.5s;
  }

  .plan-option-body,
  .signup-submit-arrow {
    transition: none;
  }
}


/* Dual OTP Verification UI */
.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.otp-verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

.otp-input-row,
.otp-box-row {
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
}

.otp-input-row .form-control,
.otp-box-row .form-control {
  flex: 1;
  min-width: 0;
}

.otp-send-btn,
.otp-verify-btn {
  white-space: nowrap;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 8px;
}

.otp-send-btn {
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

.otp-send-btn:hover:not(:disabled) {
  background: #e2e8f0;
}

.otp-send-btn:disabled,
.otp-verify-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.otp-box {
  margin-top: 0.6rem;
  padding: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.otp-status {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: #475569;
}

.otp-status.is-error {
  color: #dc2626;
}

.otp-status.is-success {
  color: #047857;
}
