/* ============================================================
   B2B Registration Module — Modern Design
   ============================================================ */

:root {
  --b2b-primary:       #2563eb;
  --b2b-primary-dark:  #1d4ed8;
  --b2b-primary-light: #eff6ff;
  --b2b-success:       #16a34a;
  --b2b-danger:        #dc2626;
  --b2b-warning:       #d97706;
  --b2b-text:          #1e293b;
  --b2b-text-muted:    #64748b;
  --b2b-border:        #e2e8f0;
  --b2b-white:         #ffffff;
  --b2b-radius:        10px;
  --b2b-shadow:        0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --b2b-shadow-md:     0 4px 12px rgba(0,0,0,.08);
}

/* ---- Wrapper ------------------------------------------------------ */
.b2b-registration-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 12px 48px;
  color: var(--b2b-text);
}

/* ---- Intro banner ------------------------------------------------- */
.b2b-intro {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--b2b-primary-light);
  border: 1px solid #bfdbfe;
  border-radius: var(--b2b-radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.b2b-intro-icon {
  color: var(--b2b-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.b2b-intro-text {
  margin: 0;
  font-size: .95rem;
  color: #1e40af;
  line-height: 1.55;
}

/* ---- Alert -------------------------------------------------------- */
.b2b-alert-error {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--b2b-radius);
  padding: 14px 18px;
  color: #991b1b;
}

.b2b-alert-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.b2b-alert-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: .9rem;
}

.b2b-alert-list li + li {
  margin-top: 4px;
}

/* ---- Section cards ------------------------------------------------ */
.b2b-section {
  background: var(--b2b-white);
  border: 1px solid var(--b2b-border);
  border-radius: var(--b2b-radius);
  box-shadow: var(--b2b-shadow);
  overflow: hidden;
  margin-bottom: 20px;
}

.b2b-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fd 100%);
  border-bottom: 1px solid #dbeafe;
}

.b2b-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--b2b-primary);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(37,99,235,.35);
}

.b2b-section-title {
  font-size: .975rem;
  font-weight: 700;
  color: #1e3a8a;
  letter-spacing: .1px;
}

.b2b-section-body {
  padding: 26px 24px 10px;
  background: var(--b2b-white);
}

/* ---- Fields ------------------------------------------------------- */
.b2b-field {
  margin-bottom: 22px;
}

/* Force left-align labels — overrides any theme style */
.b2b-registration-wrap .b2b-label,
.b2b-registration-wrap label.b2b-label {
  display: block;
  text-align: left !important;
  font-size: .85rem;
  font-weight: 600;
  color: var(--b2b-text);
  margin-bottom: 6px;
  float: none !important;
  width: auto !important;
}

.b2b-registration-wrap .b2b-label.required::after,
.b2b-registration-wrap label.b2b-label.required::after {
  content: ' *';
  color: var(--b2b-danger);
}

.b2b-input {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-size: .925rem;
  color: var(--b2b-text);
  background: #fff;
  border: 1.5px solid var(--b2b-border);
  border-radius: 8px;
  transition: border-color .18s ease, box-shadow .18s ease;
  outline: none;
  line-height: 1.5;
  box-sizing: border-box;
}

.b2b-input:focus {
  border-color: var(--b2b-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.b2b-input::placeholder {
  color: #a8b5c8;
  font-size: .88rem;
}

.b2b-input.is-valid   { border-color: var(--b2b-success); }
.b2b-input.is-invalid { border-color: var(--b2b-danger); }

.b2b-hint {
  display: block;
  font-size: .8rem;
  color: var(--b2b-text-muted);
  margin-top: 4px;
  text-align: left;
}

/* ---- Row spacing fix ---------------------------------------------- */
.b2b-section-body .row {
  margin-left: -10px;
  margin-right: -10px;
}

.b2b-section-body .row > [class*="col-"] {
  padding-left: 10px;
  padding-right: 10px;
}

/* ---- Password input with eye toggle ------------------------------ */
.b2b-input-group {
  position: relative;
}

.b2b-input-group .b2b-input {
  padding-right: 44px;
}

/* Override ALL theme/Bootstrap button styles on eye button */
.b2b-registration-wrap .b2b-eye-btn,
.b2b-registration-wrap .b2b-eye-btn:hover,
.b2b-registration-wrap .b2b-eye-btn:focus,
.b2b-registration-wrap .b2b-eye-btn:active {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 4px;
  cursor: pointer;
  color: var(--b2b-text-muted);
  display: flex;
  align-items: center;
  line-height: 1;
  width: auto;
  height: auto;
  border-radius: 0;
  text-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

.b2b-registration-wrap .b2b-eye-btn:hover {
  color: var(--b2b-primary) !important;
}

/* ---- Password strength bar --------------------------------------- */
.b2b-pwd-strength { min-height: 22px; }

/* ---- Google Maps hint -------------------------------------------- */
.b2b-gmaps-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  color: #1e40af;
  background: var(--b2b-primary-light);
  border-left: 3px solid var(--b2b-primary);
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 16px;
}

/* ---- Consent section --------------------------------------------- */
.b2b-consent-header {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-bottom-color: #bbf7d0;
}

.b2b-consent-header-icon {
  color: #16a34a;
  flex-shrink: 0;
}

.b2b-consent-header .b2b-section-title {
  color: #14532d;
}

.b2b-consents-body {
  padding: 8px 24px 16px;
}

.b2b-consent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  margin: 0;
  width: 100%;
  user-select: none;
}

.b2b-consent-row:last-child {
  border-bottom: none;
  padding-bottom: 4px;
}

.b2b-consent-row:hover .b2b-chk-box {
  border-color: var(--b2b-primary);
}

/* Hidden native checkbox */
.b2b-chk-native {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Custom checkbox box */
.b2b-chk-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  transition: background .15s, border-color .15s, box-shadow .15s;
}

.b2b-chk-box svg {
  opacity: 0;
  transform: scale(.6);
  transition: opacity .15s, transform .15s;
}

.b2b-chk-native:checked ~ .b2b-chk-box {
  background: var(--b2b-primary);
  border-color: var(--b2b-primary);
}

.b2b-chk-native:checked ~ .b2b-chk-box svg {
  opacity: 1;
  transform: scale(1);
}

.b2b-chk-native:focus ~ .b2b-chk-box {
  box-shadow: 0 0 0 3px rgba(37,99,235,.2);
}

.b2b-consent-text {
  flex: 1;
  font-size: .88rem;
  color: #374151;
  line-height: 1.45;
  text-align: left;
}

.b2b-consent-link {
  color: var(--b2b-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}

.b2b-consent-link:hover { color: var(--b2b-primary-dark); }

.b2b-badge {
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.b2b-badge-required {
  background: #fee2e2;
  color: #b91c1c;
}

.b2b-badge-optional {
  background: #dcfce7;
  color: #15803d;
}

/* ---- Submit ------------------------------------------------------- */
.b2b-submit-wrap {
  text-align: center;
  padding: 28px 0 8px;
}

#b2b-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--b2b-primary) 0%, var(--b2b-primary-dark) 100%);
  color: #fff !important;
  border: none;
  border-radius: 10px;
  padding: 14px 44px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .2px;
  cursor: pointer;
  min-width: 220px;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(37,99,235,.35);
  transition: transform .15s, box-shadow .15s, opacity .15s;
  text-decoration: none;
  -webkit-appearance: none;
}

#b2b-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,99,235,.45);
  color: #fff !important;
}

#b2b-submit-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
}

#b2b-submit-btn:disabled {
  opacity: .65;
  cursor: not-allowed;
  transform: none;
}

/* ---- Success screen ---------------------------------------------- */
.b2b-success-screen {
  padding: 48px 20px;
}

.b2b-success-icon-wrap {
  display: inline-block;
}

.b2b-success-icon-wrap svg circle,
.b2b-success-icon-wrap svg path {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: b2b-draw .7s ease forwards;
}

.b2b-success-icon-wrap svg path {
  animation-delay: .3s;
}

@keyframes b2b-draw {
  to { stroke-dashoffset: 0; }
}

.b2b-success-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--b2b-success);
  margin-bottom: 12px;
}

.b2b-success-text {
  font-size: 1rem;
  color: var(--b2b-text);
  margin-bottom: 8px;
}

.b2b-success-sub {
  font-size: .9rem;
  color: var(--b2b-text-muted);
}

.b2b-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--b2b-primary), var(--b2b-primary-dark));
  color: #fff !important;
  padding: 12px 32px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none !important;
  box-shadow: 0 3px 10px rgba(37,99,235,.3);
  transition: transform .15s, box-shadow .15s;
}

.b2b-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(37,99,235,.4);
}

/* ---- Google autocomplete dropdown -------------------------------- */
.pac-container {
  z-index: 9999 !important;
  border-radius: 8px;
  box-shadow: var(--b2b-shadow-md);
  border: 1px solid var(--b2b-border);
}

.pac-item {
  padding: 8px 12px;
  font-size: .88rem;
}

.pac-item:hover { background: var(--b2b-primary-light); }

/* ---- Responsive -------------------------------------------------- */
@media (max-width: 576px) {
  .b2b-section-body       { padding: 18px 16px 6px; }
  .b2b-section-header     { padding: 12px 16px; }
  .b2b-consents-body      { padding: 4px 16px 12px; }
  .b2b-section-body .row  { margin-left: -8px; margin-right: -8px; }
  .b2b-section-body .row > [class*="col-"] { padding-left: 8px; padding-right: 8px; }

  #b2b-submit-btn {
    width: 100%;
    padding: 14px 24px;
  }

  .b2b-intro  { padding: 12px 14px; }
  .b2b-badge  { display: none; }
}
