/* ============================================
   Bemorex Onboarding Wizard — Dark Theme
   Firebase Studio inspired glow background
   ============================================ */

:root {
  --ob-primary: #FF9000;
  --ob-primary-dark: #E07E00;
  --ob-primary-light: rgba(255, 144, 0, 0.12);
  --ob-primary-glow: rgba(255, 144, 0, 0.2);
  --ob-text: #F3F4F6;
  --ob-text-secondary: #9CA3AF;
  --ob-text-muted: #6B7280;
  --ob-bg-page: #000000;
  --ob-bg-card: #111111;
  --ob-bg-input: #1A1A1A;
  --ob-bg-input-hover: #222222;
  --ob-border: #2A2A2A;
  --ob-border-hover: #3A3A3A;
  --ob-success: #10B981;
  --ob-error: #EF4444;
  --ob-radius: 12px;
  --ob-radius-lg: 20px;
  --ob-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Page with glow background ---- */
.ob-page {
  min-height: 100vh;
  background: var(--ob-bg-page);
  font-family: "xSans", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ob-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Background glow layer */
.ob-bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ob-bg-glow img {
  position: absolute;
  width: 100%;
  opacity: 0.6;
  object-fit: cover;
}

.ob-bg-glow .ob-glow-main {
  /* bottom: -10%; */
  left: 0;
  height: 100%;
}

/* ---- Header ---- */
.ob-header {
  position: relative;
  z-index: 10;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ob-header img {
  height: 28px;
  width: auto;
  filter: brightness(0) invert(1);
}

/* ---- Card wrapper (everything on top of glow) ---- */
.ob-card-wrapper {
  position: relative;
  z-index: 10;
  max-width: 580px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

.ob-card {
  background: var(--ob-bg-card);
  border: 1px solid var(--ob-border);
  border-radius: var(--ob-radius-lg);
  overflow: hidden;
  box-shadow: 0 0 80px rgba(255, 144, 0, 0.03), 0 25px 60px rgba(0, 0, 0, 0.5);
}

/* ---- Progress bar (inside card) ---- */
.ob-progress {
  padding: 20px 24px;
  border-bottom: 1px solid var(--ob-border);
}

.ob-progress-track {
  height: 4px;
  background: var(--ob-border);
  border-radius: 2px;
  overflow: hidden;
}

.ob-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ob-primary), #FFB347);
  border-radius: 2px;
  width: 20%;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.ob-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 12px;
  color: var(--ob-text-muted);
}

.ob-progress-label strong {
  color: var(--ob-primary);
  font-weight: 600;
}

/* ---- Card content ---- */
.ob-card-content {
  padding: 28px 24px 32px;
}

/* ---- Hero inside card ---- */
.ob-hero {
  text-align: center;
  margin-bottom: 28px;
}

.ob-hero h1 {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--ob-text);
  line-height: 1.25;
}

.ob-hero p {
  font-size: 14px;
  color: var(--ob-text-secondary);
  margin: 0;
}

/* ---- Step ---- */
.ob-step {
  display: none;
  animation: obFadeIn 0.35s ease-out;
}

.ob-step.active {
  display: block;
}

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

.ob-step-title {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(90deg, var(--ob-primary), #FFB347);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 4px;
  line-height: 1.3;
}

.ob-step-subtitle {
  font-size: 13px;
  color: var(--ob-text-muted);
  margin: 0 0 24px;
}

/* ---- Form fields ---- */
.ob-field {
  margin-bottom: 20px;
}

.ob-field > label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ob-text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.ob-field label .ob-required {
  color: var(--ob-primary);
  margin-left: 2px;
}

.ob-field-hint {
  font-size: 11px;
  color: var(--ob-text-muted);
  margin-bottom: 6px;
  line-height: 1.4;
}

.ob-field input[type="text"],
.ob-field input[type="email"],
.ob-field input[type="tel"],
.ob-field select,
.ob-field textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--ob-text);
  background: var(--ob-bg-input);
  border: 1px solid var(--ob-border);
  border-radius: var(--ob-radius);
  outline: none;
  transition: border-color var(--ob-transition), box-shadow var(--ob-transition), background var(--ob-transition);
  font-family: inherit;
  box-sizing: border-box;
}

.ob-field input::placeholder,
.ob-field textarea::placeholder {
  color: var(--ob-text-muted);
}

.ob-field input:focus,
.ob-field select:focus,
.ob-field textarea:focus {
  border-color: var(--ob-primary);
  box-shadow: 0 0 0 3px var(--ob-primary-light);
  background: var(--ob-bg-input-hover);
}

.ob-field input.ob-invalid,
.ob-field select.ob-invalid,
.ob-field textarea.ob-invalid {
  border-color: var(--ob-error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.ob-field textarea {
  min-height: 90px;
  resize: vertical;
}

.ob-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B7280' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.ob-field select option {
  background: var(--ob-bg-input);
  color: var(--ob-text);
}

.ob-field-error {
  font-size: 11px;
  color: var(--ob-error);
  margin-top: 4px;
  display: none;
}

.ob-field.has-error .ob-field-error {
  display: block;
}

/* ---- Phone field with +591 prefix ---- */
.ob-phone-wrapper {
  display: flex;
  align-items: center;
  border: 1px solid var(--ob-border);
  border-radius: var(--ob-radius);
  background: var(--ob-bg-input);
  overflow: hidden;
  transition: border-color var(--ob-transition), box-shadow var(--ob-transition);
}

.ob-phone-wrapper:focus-within {
  border-color: var(--ob-primary);
  box-shadow: 0 0 0 3px var(--ob-primary-light);
}

.ob-field.has-error .ob-phone-wrapper {
  border-color: var(--ob-error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.ob-phone-prefix {
  padding: 12px 10px 12px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ob-text-muted);
  background: rgba(255, 255, 255, 0.03);
  border-right: 1px solid var(--ob-border);
  white-space: nowrap;
  user-select: none;
}

.ob-phone-wrapper input[type="tel"] {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding-left: 10px;
  flex: 1;
  min-width: 0;
}

/* ---- Checkbox group (multi-select) ---- */
.ob-checkbox-group,
.ob-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ob-checkbox-item,
.ob-radio-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--ob-bg-input);
  border: 1px solid var(--ob-border);
  border-radius: var(--ob-radius);
  cursor: pointer;
  transition: border-color var(--ob-transition), background var(--ob-transition);
  font-size: 14px;
  color: var(--ob-text-secondary);
}

.ob-checkbox-item:hover,
.ob-radio-item:hover {
  border-color: var(--ob-border-hover);
  background: var(--ob-bg-input-hover);
}

.ob-checkbox-item.selected,
.ob-radio-item.selected {
  border-color: var(--ob-primary);
  background: var(--ob-primary-light);
  color: var(--ob-text);
}

.ob-checkbox-item input[type="checkbox"],
.ob-radio-item input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--ob-primary);
  flex-shrink: 0;
  cursor: pointer;
}

.ob-checkbox-item span,
.ob-radio-item span {
  line-height: 1.3;
}

/* ---- Buttons ---- */
.ob-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

.ob-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--ob-radius);
  border: none;
  cursor: pointer;
  transition: all var(--ob-transition);
  font-family: inherit;
  line-height: 1;
}

.ob-btn-primary {
  background: var(--ob-primary);
  color: #000;
  flex: 1;
}

.ob-btn-primary:hover {
  background: var(--ob-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--ob-primary-glow);
}

.ob-btn-primary:active {
  transform: translateY(0);
}

.ob-btn-back {
  background: transparent;
  color: var(--ob-text-muted);
  border: 1px solid var(--ob-border);
  padding: 14px 18px;
}

.ob-btn-back:hover {
  border-color: var(--ob-border-hover);
  color: var(--ob-text-secondary);
}

.ob-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Spinner */
.ob-btn .ob-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: obSpin 0.7s linear infinite;
}

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

/* ---- Terms ---- */
.ob-terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  font-size: 12px;
  color: var(--ob-text-muted);
}

.ob-terms input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--ob-primary);
  flex-shrink: 0;
  margin-top: 1px;
  cursor: pointer;
}

.ob-terms a {
  color: var(--ob-primary);
  text-decoration: underline;
  text-decoration-color: rgba(255, 144, 0, 0.3);
}

.ob-terms a:hover {
  text-decoration-color: var(--ob-primary);
}

/* ---- Success screen ---- */
.ob-success {
  display: none;
  text-align: center;
  padding: 48px 24px;
  animation: obFadeIn 0.5s ease-out;
}

.ob-success.active {
  display: block;
}

.ob-success-icon {
  width: 72px;
  height: 72px;
  background: var(--ob-success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  animation: obPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 0 40px rgba(16, 185, 129, 0.3);
}

@keyframes obPop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

.ob-success-icon svg {
  width: 36px;
  height: 36px;
  fill: #fff;
}

.ob-success h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--ob-text);
}

.ob-success p {
  font-size: 14px;
  color: var(--ob-text-secondary);
  margin: 0 0 6px;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

.ob-success-cta {
  margin-top: 24px;
}

.ob-success-cta a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ob-primary);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: opacity var(--ob-transition);
}

.ob-success-cta a:hover {
  opacity: 0.8;
}

.ob-success-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
  align-items: center;
}

.ob-success-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all var(--ob-transition);
  border-radius: var(--ob-radius);
  padding: 14px 24px;
}

.ob-btn-whatsapp {
  background: #25D366;
  color: #fff;
  width: 100%;
  max-width: 280px;
}

.ob-btn-whatsapp:hover {
  background: #1ebe5d;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
}

.ob-btn-whatsapp svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.ob-btn-secondary {
  background: transparent;
  color: var(--ob-text-muted);
  border: 1px solid var(--ob-border);
  width: 100%;
  max-width: 280px;
}

.ob-btn-secondary:hover {
  border-color: var(--ob-border-hover);
  color: var(--ob-text-secondary);
}

.ob-btn-secondary svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.ob-btn-primary {
  background: var(--ob-primary);
  color: #fff;
  width: 100%;
  max-width: 280px;
}

.ob-btn-primary:hover {
  background: var(--ob-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(255, 144, 0, 0.3);
}

.ob-btn-primary svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.ob-success-subtitle {
  font-size: 13px;
  color: var(--ob-text-secondary);
  margin-top: 16px;
  margin-bottom: 4px;
}

.ob-success-footer {
  font-size: 12px;
  color: var(--ob-text-muted);
  margin-top: 24px;
}

/* ---- Snackbar ---- */
.ob-snackbar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  max-width: 90%;
  color: #fff;
  background: var(--ob-error);
}

.ob-snackbar.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ---- Footer ---- */
.ob-footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 20px;
  font-size: 11px;
  /* color: var(--ob-text-muted); */
}

.ob-footer a {
  color: var(--ob-primary);
  text-decoration: none;
}

/* ---- Responsive ---- */
@media (min-width: 640px) {
  .ob-card-wrapper {
    padding: 0 20px 48px;
  }

  .ob-card-content {
    padding: 32px 32px 36px;
  }

  .ob-progress {
    padding: 20px 32px;
  }

  .ob-hero h1 {
    font-size: 26px;
  }

  .ob-step-title {
    font-size: 22px;
  }

  .ob-header img {
    height: 32px;
  }
}
