/* ════════════════════════════════════════════════════
   MAPO — Registration page styles
   ════════════════════════════════════════════════════ */

.reg-shell {
  min-height: 100vh;
  background: linear-gradient(180deg, #fafafa 0%, #f0f0f0 100%);
  display: flex;
  flex-direction: column;
  font-family: 'Barlow', sans-serif;
  color: #1a1a1a;
}

/* ── Top bar ── */
.reg-topbar {
  background: #fff;
  border-bottom: 2px solid var(--red);
  padding: 0 24px;
  height: 66px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}
.reg-topbar .brand-wide { height: 50px; }
.reg-topbar .brand-wide img { height: 50px; width: auto; }
.reg-topbar-sub {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-left: 4px;
}
.reg-topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}
.reg-topbar-right a {
  color: var(--red);
  text-decoration: none;
  font-weight: 600;
}
.reg-topbar-right a:hover { text-decoration: underline; }

/* ── Main body ── */
.reg-body {
  flex: 1 1 auto;
  padding: 32px 24px 60px;
  display: flex;
  justify-content: center;
}
.reg-container {
  width: 100%;
  max-width: 1080px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Hero */
.reg-hero {
  background: #fff;
  border: 1px solid #ececec;
  border-left: 4px solid var(--red);
  border-radius: 10px;
  padding: 22px 28px;
}
.reg-hero-eyebrow {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--red);
  text-transform: uppercase;
}
.reg-hero-title {
  font-family: 'Barlow', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 4px 0 6px;
  letter-spacing: 0.3px;
}
.reg-hero-sub {
  font-size: 14px;
  color: #555;
  line-height: 1.5;
  max-width: 720px;
}

/* Section card */
.reg-section {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 10px;
  padding: 22px 24px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}
.reg-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.reg-section-head .badge-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.reg-section-title {
  font-family: 'Barlow', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
}
.reg-section-sub {
  font-size: 13px;
  color: #666;
  margin-bottom: 16px;
  margin-left: 36px;
}

/* Region grid — matches the country picker on the login flow */
.reg-region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.reg-region-card {
  background: #fff;
  border: 1.5px solid #ececec;
  border-radius: 10px;
  padding: 16px 12px 14px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  text-align: center;
  font-family: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}
.reg-region-card:hover {
  border-color: var(--red);
  box-shadow: 0 4px 14px rgba(171, 22, 27, 0.08);
  transform: translateY(-1px);
}
.reg-region-card.selected {
  border-color: var(--red);
  background: var(--red-light, #fde9ea);
  box-shadow: 0 0 0 3px rgba(171, 22, 27, 0.12);
}
.reg-region-card.selected::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  background: var(--red);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.reg-region-flag-wrap {
  width: 64px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  background: transparent;
}
.reg-region-flag-wrap.no-flag { background: transparent; }
.reg-region-flag {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  background: transparent;
}
.reg-region-code {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--red, #ab161b);
  line-height: 1;
}
.reg-region-name {
  font-size: 12px;
  color: #555;
  margin-top: 2px;
  font-weight: 500;
}

/* Audience / "Who are you?" grid */
.reg-audience-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.reg-audience-card {
  background: #fff;
  border: 1.5px solid #ececec;
  border-radius: 10px;
  padding: 16px 14px 14px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  text-align: center;
  font-family: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}
.reg-audience-card:hover {
  border-color: var(--red);
  box-shadow: 0 4px 14px rgba(171, 22, 27, 0.08);
  transform: translateY(-1px);
}
.reg-audience-card.selected {
  border-color: var(--red);
  background: var(--red-light, #fde9ea);
  box-shadow: 0 0 0 3px rgba(171, 22, 27, 0.12);
}
.reg-audience-card.selected::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  background: var(--red);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.reg-audience-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--red-light, #fde9ea);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 2px;
}
.reg-audience-card.selected .reg-audience-icon {
  background: var(--red);
  color: #fff;
}
.reg-audience-label {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: #1a1a1a;
  line-height: 1.25;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reg-audience-desc {
  font-size: 11px;
  color: #666;
  line-height: 1.35;
}

/* Empty state shown in the solution grid before an audience is picked */
.reg-sol-empty {
  grid-column: 1 / -1;
  padding: 22px 20px;
  background: var(--bg-subtle, #f7f7f7);
  border: 1px dashed #d0d0d0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  color: #666;
  text-align: center;
}
.reg-sol-empty i { color: var(--red); font-size: 20px; }

/* Solutions grid */
.reg-sol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.reg-sol-card {
  background: #fff;
  border: 1.5px solid #ececec;
  border-radius: 10px;
  padding: 14px 14px 12px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  text-align: left;
  font-family: inherit;
  color: inherit;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reg-sol-card:hover {
  border-color: var(--red);
  box-shadow: 0 4px 14px rgba(171, 22, 27, 0.08);
  transform: translateY(-1px);
}
.reg-sol-card.selected {
  border-color: var(--red);
  background: var(--red-light, #fde9ea);
  box-shadow: 0 0 0 3px rgba(171, 22, 27, 0.12);
}
.reg-sol-card.selected::after {
  content: '✓';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  background: var(--red);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.reg-sol-banner {
  height: 34px;
  display: flex;
  align-items: center;
}
.reg-sol-banner img {
  height: 34px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left;
}
.reg-sol-label {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #1a1a1a;
  line-height: 1.1;
}
.reg-sol-desc {
  font-size: 12px;
  color: #666;
  line-height: 1.4;
}

/* Forms */
.reg-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.reg-form-grid.one-col { grid-template-columns: 1fr; }
.reg-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.reg-field.span-2 { grid-column: 1 / -1; }
.reg-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.reg-label .req { color: var(--red); margin-left: 2px; }
.reg-input,
.reg-select,
.reg-textarea {
  background: #fff;
  border: 1.5px solid #dcdcdc;
  border-radius: 6px;
  padding: 9px 12px;
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  color: #1a1a1a;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
  box-sizing: border-box;
}
.reg-input:focus,
.reg-select:focus,
.reg-textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(171, 22, 27, 0.12);
}
.reg-input.invalid,
.reg-select.invalid { border-color: var(--red); }
.reg-hint {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
}
.reg-error {
  font-size: 12px;
  color: var(--red);
  margin-top: 2px;
  display: none;
}
.reg-error.show { display: block; }

/* Address helpers — Pin on Google Maps + pinned status */
.reg-address-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.reg-map-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: #fff;
  border: 1.5px solid var(--red);
  color: var(--red);
  border-radius: 6px;
  font-family: 'Barlow', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.reg-map-btn:hover {
  background: var(--red-light, #fde9ea);
}
.reg-map-btn i { font-size: 15px; }
.reg-address-pinned {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  background: #e8f4ea;
  border: 1px solid #c2dec7;
  color: #2c7a3a;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.reg-address-pinned i { font-size: 14px; }
.reg-map-clear {
  background: none;
  border: none;
  color: #2c7a3a;
  cursor: pointer;
  padding: 0 2px;
  display: inline-flex;
  align-items: center;
}
.reg-map-clear:hover { color: var(--red); }

/* Mobile number — dial-code select + number input side-by-side */
.reg-phone-wrap {
  display: flex;
  gap: 8px;
}
.reg-phone-code {
  width: auto;
  min-width: 110px;
  flex-shrink: 0;
  font-weight: 600;
  padding-right: 28px;
}
.reg-phone-num {
  flex: 1 1 auto;
  min-width: 0;
}

/* Password input with visibility toggle */
.reg-pw-wrap {
  position: relative;
  display: flex;
}
.reg-pw-wrap .reg-input { padding-right: 40px; }
.reg-pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 6px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reg-pw-toggle:hover { color: var(--red); }

/* Organization toggle */
.reg-org-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-subtle, #f7f7f7);
  border: 1px solid #ececec;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  margin-bottom: 14px;
}
.reg-org-toggle input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}
.reg-org-toggle-label {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
}
.reg-org-toggle-hint {
  font-size: 12px;
  color: #666;
  margin-left: auto;
}
.reg-org-fields { display: none; }
.reg-org-fields.show { display: block; }

/* T&C section */
.reg-tc {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-subtle, #f7f7f7);
  border: 1px solid #ececec;
  border-radius: 8px;
}
.reg-tc input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  margin-top: 2px;
  flex-shrink: 0;
}
.reg-tc-text {
  font-size: 13px;
  color: #333;
  line-height: 1.5;
}
.reg-tc-link {
  color: var(--red);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
}
.reg-tc-link:hover { color: #8d1216; }

/* Submit + footer */
.reg-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 4px;
}
.reg-btn-primary {
  padding: 12px 26px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s, transform .15s, opacity .15s;
}
.reg-btn-primary:hover:not(:disabled) {
  background: #8d1216;
  transform: translateY(-1px);
}
.reg-btn-primary:disabled {
  background: #d9d9d9;
  cursor: not-allowed;
  opacity: 0.7;
}
.reg-btn-primary .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: regSpin 0.8s linear infinite;
  display: none;
}
.reg-btn-primary.loading .spinner { display: inline-block; }
.reg-btn-primary.loading .btn-text { opacity: 0.7; }
@keyframes regSpin { to { transform: rotate(360deg); } }

.reg-btn-secondary {
  padding: 12px 22px;
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #dcdcdc;
  border-radius: 8px;
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color .15s;
}
.reg-btn-secondary:hover {
  border-color: var(--red);
  color: var(--red);
}

/* Error banner */
.reg-error-banner {
  padding: 12px 16px;
  background: #fdecea;
  border: 1px solid #f5c2c0;
  border-left: 4px solid var(--red);
  border-radius: 8px;
  color: #8d1216;
  font-size: 13px;
  display: none;
  align-items: center;
  gap: 8px;
}
.reg-error-banner.show { display: flex; }

/* Success card */
.reg-success {
  background: #fff;
  border: 1px solid #c2dec7;
  border-left: 4px solid #27ae60;
  border-radius: 10px;
  padding: 32px 30px;
  text-align: center;
}
.reg-success-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #e8f4ea;
  color: #27ae60;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 12px;
}
.reg-success-title {
  font-family: 'Barlow', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 6px;
}
.reg-success-sub {
  font-size: 14px;
  color: #555;
  line-height: 1.5;
  margin-bottom: 20px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* T&C modal */
.reg-tc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.reg-tc-overlay.open { display: flex; }
.reg-tc-modal {
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  background: #fff;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
}
.reg-tc-head {
  padding: 18px 24px;
  border-bottom: 1px solid #ececec;
  display: flex;
  align-items: center;
  gap: 12px;
}
.reg-tc-head-title {
  font-family: 'Barlow', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  flex: 1;
}
.reg-tc-close {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 20px;
  padding: 4px 6px;
  display: flex;
  align-items: center;
}
.reg-tc-close:hover { color: var(--red); }
.reg-tc-body {
  padding: 22px 26px;
  overflow-y: auto;
  font-size: 13.5px;
  line-height: 1.6;
  color: #333;
  flex: 1 1 auto;
}
.reg-tc-body h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 20px 0 8px;
}
.reg-tc-body h3:first-child { margin-top: 0; }
.reg-tc-body p { margin: 0 0 10px; }
.reg-tc-body ul { padding-left: 20px; margin: 0 0 10px; }
.reg-tc-foot {
  padding: 14px 24px;
  border-top: 1px solid #ececec;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #fafafa;
}

/* Mobile */
@media (max-width: 720px) {
  .reg-form-grid { grid-template-columns: 1fr; }
  .reg-topbar { padding: 0 14px; height: 60px; }
  .reg-topbar .brand-wide,
  .reg-topbar .brand-wide img { height: 42px; }
  .reg-body { padding: 20px 12px 40px; }
  .reg-section { padding: 18px 16px; }
  .reg-hero { padding: 18px 20px; }
  .reg-hero-title { font-size: 22px; }
}

/* ── Existing-organization matches ─────────────────────────────
   Not in the mapo-v2 original: surfaces companies already registered
   under the typed name (the /Registration/CheckOrganization check that
   the previous Register page did with a Syncfusion grid), so the user
   can ask to join rather than create a duplicate organization. */
.reg-org-matches {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--red-light);
  border-left: 3px solid var(--red);
  border-radius: 6px;
  background: var(--bg-subtle);
}
.reg-org-matches-head {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 6px;
}
.reg-org-matches-sub {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}
.reg-org-matches-list {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-secondary);
}
.reg-org-matches-list li { margin: 2px 0; }

/* ── Individual (no organization) notice ───────────────────────
   Shown in place of the company fields when the Mobile Solution is
   selected: it is a consumer subscription an individual can take out
   on their own, so no organization is captured or verified. */
.reg-org-individual {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 4px;
  padding: 14px 16px;
  border: 1px solid var(--red-light);
  border-left: 3px solid var(--red);
  border-radius: 6px;
  background: var(--bg-subtle);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.reg-org-individual i {
  color: var(--red);
  font-size: 18px;
  flex: 0 0 auto;
  margin-top: 1px;
}
