/* ================================================================
   ONBOARDING WIZARD — The Blueprint
   Namespaced with 'onb-' to avoid conflicts with main site CSS
   ================================================================ */

/* ---- Modal overlay and container ---- */
.onb-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.onb-modal.onb-modal-visible {
  opacity: 1;
}

.onb-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(1, 75, 173, 0.25);
  backdrop-filter: blur(6px);
}
@media (max-width: 768px) {
  .onb-modal-backdrop { display: none; }
}

.onb-modal-content {
  position: relative;
  background: #fff;
  border-radius: 1.5rem;
  box-shadow: 0 24px 80px rgba(1, 75, 173, 0.18), 0 4px 20px rgba(0,0,0,0.08);
  width: 90vw;
  max-width: 640px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.96) translateY(16px);
  transition: transform 0.25s ease;
}
.onb-modal-visible .onb-modal-content {
  transform: scale(1) translateY(0);
}

.onb-modal-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none !important;
  border: none !important;
  font-size: 1.15rem;
  color: #6B7A99;
  cursor: pointer;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
  box-shadow: none !important;
}
.onb-modal-close:hover {
  color: #0B1B46;
  background: rgba(1, 75, 173, 0.06) !important;
}

/* ---- Progress indicator ---- */
.onb-progress {
  padding: 3.5rem 2rem 0 2rem;
}
.onb-progress-track {
  display: flex;
  gap: 0.4rem;
}
.onb-progress-segment {
  flex: 1;
  height: 4px;
  background: #e0e6ef;
  border-radius: 2px;
  transition: background-color 0.3s ease;
}
.onb-progress-segment.active {
  background: #014bad;
}

/* ---- Content area ---- */
.onb-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 2rem 2rem 2rem;
  max-height: calc(90vh - 160px);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.onb-header {
  text-align: center;
  margin-bottom: 1.75rem;
}
.onb-title {
  font-family: 'Open Sans', 'Inter', sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: #0B1B46;
  margin: 0 0 0.4rem 0;
  line-height: 1.25;
}
.onb-subtitle {
  font-size: 1rem;
  color: #6B7A99;
  margin: 0;
  line-height: 1.45;
  font-weight: 400;
}

/* ---- Step animation ---- */
.onb-step-content {
  animation: onb-slide-in 0.3s ease-out;
}
@keyframes onb-slide-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Step 1: Contact method cards ---- */
.onb-method-options {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.onb-method-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #fff;
  border: 2px solid #e0e6ef;
  border-radius: 1rem;
  padding: 1.15rem 1.4rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  color: #0B1B46;
  font-family: inherit;
  font-size: 1rem;
  width: 100%;
}
.onb-method-option i {
  font-size: 1.35rem;
  color: #014bad;
  flex-shrink: 0;
  width: 2rem;
  text-align: center;
}
.onb-method-content {
  flex: 1;
}
.onb-method-content h4 {
  margin: 0 0 0.2rem 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0B1B46;
}
.onb-method-content p {
  margin: 0;
  font-size: 0.9rem;
  color: #6B7A99;
  line-height: 1.35;
  font-weight: 400;
}
.onb-method-option:hover {
  border-color: #014bad;
  background: #f5f8ff;
  box-shadow: 0 4px 16px rgba(1, 75, 173, 0.08);
  transform: translateY(-1px);
}
.onb-method-option:focus {
  outline: 2px solid #014bad;
  outline-offset: 2px;
}
.onb-method-option.selected {
  border-color: #014bad;
  background: #f0f5ff;
  box-shadow: 0 0 0 3px rgba(1, 75, 173, 0.12);
}

/* ---- Step 2: Contact forms ---- */
.onb-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.onb-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.onb-field label {
  font-weight: 600;
  color: #0B1B46;
  font-size: 0.92rem;
}
.onb-field input,
.onb-field textarea,
.onb-field select {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1rem;
  border: 2px solid #e0e6ef;
  border-radius: 0.65rem;
  padding: 0.75rem 1rem;
  background: #fff;
  color: #0B1B46;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.onb-field input:focus,
.onb-field textarea:focus,
.onb-field select:focus {
  outline: none;
  border-color: #014bad;
  box-shadow: 0 0 0 3px rgba(1, 75, 173, 0.1);
}
.onb-field input::placeholder,
.onb-field textarea::placeholder {
  color: #a0aec0;
}

/* ---- Step 3: Founded company yes/no ---- */
.onb-binary-choice {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 0.5rem;
}
.onb-choice-btn {
  flex: 1;
  max-width: 200px;
  padding: 1.25rem 1.5rem;
  border: 2px solid #e0e6ef;
  border-radius: 1rem;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  font-family: inherit;
  font-size: 1rem;
  color: #0B1B46;
}
.onb-choice-btn i {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #014bad;
}
.onb-choice-btn span {
  font-weight: 600;
  font-size: 1.05rem;
}
.onb-choice-btn:hover {
  border-color: #014bad;
  background: #f5f8ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(1, 75, 173, 0.08);
}
.onb-choice-btn.selected {
  border-color: #014bad;
  background: #f0f5ff;
  box-shadow: 0 0 0 3px rgba(1, 75, 173, 0.12);
}

/* ---- Step 4: Company details form ---- */
.onb-field-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ---- Step 5: Finish screen ---- */
.onb-finish {
  text-align: center;
  padding: 1rem 0;
}
.onb-finish-icon {
  font-size: 3rem;
  color: #014bad;
  margin-bottom: 1rem;
}
.onb-finish h3 {
  font-family: 'Open Sans', 'Inter', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #0B1B46;
  margin: 0 0 0.5rem 0;
}
.onb-finish p {
  color: #6B7A99;
  font-size: 1rem;
  line-height: 1.5;
  margin: 0 0 2rem 0;
}
.onb-finish-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}
.onb-finish-actions .onb-btn {
  width: 100%;
  max-width: 320px;
  justify-content: center;
}

/* ---- Calendar embed ---- */
.onb-calendar-embed {
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid #e0e6ef;
}

/* ---- Validation ---- */
.onb-validation-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 0.5rem;
  padding: 0.65rem 1rem;
  margin: 0 2rem 0.75rem 2rem;
  font-size: 0.9rem;
  text-align: center;
  display: none;
}

.onb-skip-link {
  color: #6B7A99;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s;
}
.onb-skip-link:hover {
  color: #014bad;
}

/* ---- Footer ---- */
.onb-footer {
  padding: 1.25rem 2rem;
  border-top: 1px solid #e0e6ef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: #fafbfd;
}

/* ---- Buttons ---- */
.onb-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 0.75rem;
  padding: 0.7rem 1.35rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.onb-btn:focus {
  outline: 2px solid #014bad;
  outline-offset: 2px;
}
.onb-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}
.onb-btn i {
  font-size: 0.85em;
}
.onb-btn-primary {
  background: #014bad;
  color: #fff;
  box-shadow: 0 2px 8px rgba(1, 75, 173, 0.15);
}
.onb-btn-primary:hover:not(:disabled) {
  background: #013d8e;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(1, 75, 173, 0.2);
}
.onb-btn-secondary {
  background: #fff;
  color: #0B1B46;
  border: 2px solid #e0e6ef;
}
.onb-btn-secondary:hover:not(:disabled) {
  border-color: #014bad;
  color: #014bad;
  transform: translateY(-1px);
}
.onb-btn-ghost {
  background: transparent;
  color: #6B7A99;
  border: none;
  padding: 0.5rem 0.75rem;
}
.onb-btn-ghost:hover:not(:disabled) {
  color: #0B1B46;
}

/* ---- Consent checkbox ---- */
.onb-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #6B7A99;
  line-height: 1.4;
}
.onb-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.onb-checkbox-mark {
  width: 18px;
  height: 18px;
  border: 2px solid #e0e6ef;
  border-radius: 4px;
  position: relative;
  transition: all 0.2s;
  flex-shrink: 0;
  margin-top: 2px;
}
.onb-checkbox-mark::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 5px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.2s;
}
.onb-checkbox input:checked + .onb-checkbox-mark {
  background: #014bad;
  border-color: #014bad;
}
.onb-checkbox input:checked + .onb-checkbox-mark::after {
  transform: rotate(45deg) scale(1);
}

/* ---- Body scroll lock ---- */
body.onb-modal-open {
  overflow: hidden;
}

/* ---- Responsive: tablet ---- */
@media (max-width: 768px) {
  .onb-modal {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
  }
  .onb-modal-content {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
    transform: none;
  }
  .onb-modal-visible .onb-modal-content {
    transform: none;
  }
  .onb-content {
    flex: 1;
    padding: 1.25rem 1.5rem;
    max-height: none;
  }
  .onb-progress {
    padding: 3.5rem 1.5rem 0 1.5rem;
  }
  .onb-footer {
    padding: 1.25rem 1.5rem;
    flex-direction: column-reverse;
    gap: 0.75rem;
  }
  .onb-footer .onb-btn {
    width: 100%;
    justify-content: center;
  }
  .onb-field input,
  .onb-field textarea {
    font-size: 16px; /* prevent iOS zoom */
    min-height: 44px;
  }
  .onb-btn {
    min-height: 44px;
    touch-action: manipulation;
  }
  .onb-field-group {
    grid-template-columns: 1fr;
  }
  .onb-title {
    font-size: 1.4rem;
  }
  .onb-binary-choice {
    flex-direction: column;
    align-items: center;
  }
  .onb-choice-btn {
    max-width: 100%;
    width: 100%;
  }
}

/* ---- Responsive: small phone ---- */
@media (max-width: 480px) {
  .onb-modal-close {
    width: 44px;
    height: 44px;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.25rem;
  }
  .onb-content {
    padding: 1rem 1.25rem;
  }
  .onb-progress {
    padding: 3.5rem 1.25rem 0 1.25rem;
  }
  .onb-footer {
    padding: 1rem 1.25rem 2rem 1.25rem;
  }
  .onb-title {
    font-size: 1.25rem;
  }
  .onb-subtitle {
    font-size: 0.92rem;
  }
  .onb-validation-error {
    margin: 0 1.25rem 0.5rem 1.25rem;
  }
}

/* ---- High contrast ---- */
@media (prefers-contrast: high) {
  .onb-btn-primary {
    background: #003380;
    border: 2px solid #003380;
  }
  .onb-btn-secondary {
    border-color: #0B1B46;
  }
  .onb-field input,
  .onb-field textarea {
    border-color: #0B1B46;
  }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .onb-modal,
  .onb-modal-content,
  .onb-step-content,
  .onb-btn,
  .onb-method-option,
  .onb-choice-btn {
    transition: none;
  }
  @keyframes onb-slide-in {
    from, to { opacity: 1; transform: translateY(0); }
  }
}
