/* ══════════════════════════════════════════════════════════════
   SWIFTCRAM — ONBOARDING FLOW
   Shared by the marketing landing page (index.html) and the app
   workspace (SwiftCram_html.html). Self-contained: falls back to
   hard-coded values when the host page does not define the app
   design tokens.
   ══════════════════════════════════════════════════════════════ */

.ob-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  background: rgba(8, 8, 14, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity 0.25s ease;
  font-family: 'Inter', system-ui, sans-serif;
  overflow-y: auto;
}
.ob-overlay.open { display: flex; }
.ob-overlay.visible { opacity: 1; }

.ob-modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: auto;
  background: #131322;
  border: 1px solid rgba(157, 111, 255, 0.22);
  border-radius: 24px;
  padding: 32px 32px 28px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
  transform: translateY(18px) scale(0.98);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.ob-overlay.visible .ob-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Purple hairline along the top edge */
.ob-modal::before {
  content: '';
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(157, 111, 255, 0.55), transparent);
}

/* ─── Header ────────────────────────────────────────────── */
.ob-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.ob-step-count {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #9d6fff;
}
.ob-skip {
  background: none;
  border: none;
  padding: 4px 2px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #7f7fa0;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.2s ease;
}
.ob-skip:hover { color: #f0f0f8; }
.ob-skip:focus-visible { outline: 2px solid #9d6fff; outline-offset: 2px; }

/* ─── Progress rail ─────────────────────────────────────── */
.ob-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 26px;
}
.ob-progress-seg {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.ob-progress-seg::after {
  content: '';
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, #9d6fff, #b490ff);
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.ob-progress-seg.filled::after { width: 100%; }

/* ─── Question copy ─────────────────────────────────────── */
.ob-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.7px;
  line-height: 1.2;
  color: #f0f0f8;
  margin: 0 0 8px;
}
.ob-sub {
  font-size: 14px;
  line-height: 1.6;
  color: #7f7fa0;
  margin: 0 0 24px;
}

/* ─── Option list ───────────────────────────────────────── */
.ob-options {
  display: grid;
  gap: 10px;
  margin-bottom: 26px;
}
.ob-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 18px;
  text-align: left;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #f0f0f8;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid #2c2c3e;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.ob-option:hover {
  background: rgba(157, 111, 255, 0.09);
  border-color: rgba(157, 111, 255, 0.42);
}
.ob-option:focus-visible {
  outline: 2px solid #9d6fff;
  outline-offset: 2px;
}
.ob-option.selected {
  background: rgba(157, 111, 255, 0.14);
  border-color: rgba(157, 111, 255, 0.65);
}

.ob-option-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: rgba(157, 111, 255, 0.1);
  border: 1px solid rgba(157, 111, 255, 0.2);
  color: #b490ff;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.ob-option-icon svg { width: 20px; height: 20px; }
.ob-option:hover .ob-option-icon,
.ob-option.selected .ob-option-icon {
  background: rgba(157, 111, 255, 0.2);
  border-color: rgba(157, 111, 255, 0.4);
}

.ob-option-text { flex: 1; min-width: 0; }
.ob-option-label { display: block; }
.ob-option-hint {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  font-weight: 400;
  color: #7f7fa0;
  line-height: 1.45;
}

.ob-option-check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid #2c2c3e;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.ob-option-check svg { width: 12px; height: 12px; }
.ob-option.selected .ob-option-check {
  background: #9d6fff;
  border-color: #9d6fff;
  color: #fff;
}

/* ─── Footer ────────────────────────────────────────────── */
.ob-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ob-back {
  background: none;
  border: none;
  padding: 10px 4px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #7f7fa0;
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.2s ease;
}
.ob-back:hover { color: #f0f0f8; }
.ob-back:focus-visible { outline: 2px solid #9d6fff; outline-offset: 2px; }
.ob-back[hidden] { visibility: hidden; display: block; }

.ob-next {
  padding: 12px 26px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: #9d6fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(157, 111, 255, 0.3);
  transition: background 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.ob-next:hover:not(:disabled) {
  background: #b490ff;
  box-shadow: 0 10px 32px rgba(157, 111, 255, 0.45);
}
.ob-next:focus-visible { outline: 2px solid #d4b3ff; outline-offset: 3px; }
.ob-next:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}

/* ─── Step transition ───────────────────────────────────── */
/* Matches the app-wide fadeInUp so onboarding feels like the same product. */
.ob-step { animation: fadeInUp 0.25s ease-out both; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.view-anim { animation: fadeInUp 0.25s ease-out both; }

/* ─── Personalizing / loading state ─────────────────────── */
.ob-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 26px 0 14px;
  animation: fadeInUp 0.25s ease-out both;
}
.ob-spinner {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 3px solid rgba(157, 111, 255, 0.15);
  border-top-color: #9d6fff;
  animation: obSpin 0.85s linear infinite;
  margin-bottom: 22px;
}
@keyframes obSpin { to { transform: rotate(360deg); } }

.ob-loading-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #f0f0f8;
  margin-bottom: 8px;
}
.ob-loading-sub {
  font-size: 13.5px;
  color: #7f7fa0;
  line-height: 1.6;
  max-width: 320px;
  margin-bottom: 26px;
}
.ob-loading-bar {
  width: 100%;
  max-width: 320px;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.ob-loading-bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, #9d6fff, #d4b3ff);
  transition: width 2s cubic-bezier(0.33, 0.7, 0.4, 1);
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 560px) {
  .ob-overlay { padding: 16px 14px; }
  .ob-modal { padding: 26px 20px 22px; border-radius: 20px; }
  .ob-title { font-size: 21px; }
  .ob-option { padding: 13px 14px; font-size: 14.5px; }
  .ob-option-icon { width: 34px; height: 34px; }
}

/* ─── Reduced motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ob-overlay,
  .ob-modal,
  .ob-step,
  .ob-loading { transition: none; animation: none; }
  .ob-modal { transform: none; opacity: 1; }
  .ob-spinner { animation-duration: 2.4s; }
  .ob-loading-bar span,
  .ob-progress-seg::after { transition: none; }
}
