/*
 * Pintaz Draf - onboarding modal (A4)
 * Scoped to .ob-* so it cannot collide with base.css / carousel.css.
 * Every token carries a literal fallback so the modal survives standalone.
 */

/* ------------------------------------------------------------- scrim */

.ob-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  background: rgba(28, 25, 19, 0.5);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 280ms ease;
}

.ob-overlay.is-open { opacity: 1; }

/* the flex display would otherwise defeat the hidden attribute */
.ob-overlay[hidden] { display: none; }

.ob-scroll-lock { overflow: hidden; }

/* ------------------------------------------------------------- panel */

.ob-panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: auto;
  padding: 56px 34px 26px;
  background: var(--bg, #FAF8F2);
  border: 1px solid var(--line, #E7E1D4);
  border-radius: 24px;
  box-shadow: 0 30px 70px -24px rgba(28, 25, 19, 0.45);
  color: var(--ink, #1C1913);
  font-family: var(--font, 'Inter', -apple-system, 'Segoe UI', sans-serif);
  opacity: 0;
  transform: scale(0.96) translateY(8px);
  transition:
    transform 280ms var(--ease-carousel, cubic-bezier(0.2, 0.86, 0.24, 1)),
    opacity 280ms ease;
}

.ob-overlay.is-open .ob-panel {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.ob-panel:focus { outline: none; }
.ob-panel :focus-visible {
  outline: 2px solid var(--ink, #1C1913);
  outline-offset: 2px;
}

/* --------------------------------------------------- back / close */

.ob-back,
.ob-close {
  position: absolute;
  top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  background: none;
  border: 0;
  border-radius: 999px;
  color: var(--muted, #8A8274);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease;
}

.ob-back { left: 18px; }
.ob-close { right: 18px; padding: 8px; }

.ob-back:hover,
.ob-close:hover {
  color: var(--ink, #1C1913);
  background: rgba(28, 25, 19, 0.05);
}

.ob-back[hidden] { display: none; }

/* -------------------------------------------------------- typography */

.ob-title {
  margin: 0 0 8px;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.12;
  text-align: center;
}

.ob-sub {
  margin: 0 0 22px;
  color: var(--ink-soft, #4A443A);
  font-size: 14.5px;
  line-height: 1.5;
  text-align: center;
}

.ob-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------- step 1 roles */

.ob-step[hidden] { display: none; }

.ob-step:focus { outline: none; }

.ob-roles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ob-role {
  padding: 15px 16px;
  background: var(--bg-card, #FFFEF9);
  border: 1px solid var(--line, #E7E1D4);
  border-radius: 14px;
  color: var(--ink, #1C1913);
  font: inherit;
  font-size: 14.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition:
    transform 180ms var(--ease-carousel, cubic-bezier(0.2, 0.86, 0.24, 1)),
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease,
    color 180ms ease;
}

.ob-role:hover {
  transform: translateY(-2px);
  border-color: rgba(28, 25, 19, 0.28);
  box-shadow: var(--shadow-card, 0 18px 40px -18px rgba(28, 25, 19, 0.28));
}

.ob-role.is-selected {
  background: var(--accent, #1C1913);
  border-color: var(--accent, #1C1913);
  color: var(--accent-ink, #FAF8F2);
  transform: translateY(-1px);
}

/* --------------------------------------------- step 2 social proof */

.ob-press {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-bottom: 20px;
}

.ob-press-mark {
  height: 22px;
  width: auto;
  opacity: 0.45;
}

.ob-quote {
  margin: 0 0 20px;
  padding: 16px 18px;
  background: var(--bg-card, #FFFEF9);
  border: 1px solid var(--line, #E7E1D4);
  border-radius: 16px;
  text-align: center;
}

.ob-stars {
  display: inline-flex;
  gap: 3px;
  margin-bottom: 9px;
  color: #B08954;
}

.ob-stars svg { fill: currentColor; display: block; }

.ob-quote blockquote {
  margin: 0 0 8px;
  color: var(--ink-soft, #4A443A);
  font-size: 14.5px;
  line-height: 1.55;
}

.ob-quote figcaption {
  color: var(--muted, #8A8274);
  font-size: 12.5px;
  letter-spacing: 0.01em;
}

/* ----------------------------------------------------- step 2 form */

.ob-form { display: block; }

.ob-input {
  display: block;
  width: 100%;
  padding: 14px 17px;
  background: var(--bg-card, #FFFEF9);
  border: 1px solid var(--line, #E7E1D4);
  border-radius: 14px;
  color: var(--ink, #1C1913);
  font: inherit;
  font-size: 15px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
  -webkit-appearance: none;
  appearance: none;
}

.ob-input::placeholder { color: var(--muted, #8A8274); }

.ob-input:focus {
  outline: none;
  border-color: var(--ink, #1C1913);
  box-shadow: 0 0 0 3px rgba(28, 25, 19, 0.09);
}

.ob-input.is-invalid {
  border-color: #B4552F;
  box-shadow: 0 0 0 3px rgba(180, 85, 47, 0.12);
}

.ob-error {
  margin: 8px 2px 0;
  color: #B4552F;
  font-size: 13px;
  line-height: 1.4;
}

.ob-error[hidden] { display: none; }

.ob-submit {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 15px 20px;
  background: var(--accent, #1C1913);
  border: 1px solid var(--accent, #1C1913);
  border-radius: var(--radius-pill, 999px);
  color: var(--accent-ink, #FAF8F2);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 180ms var(--ease-carousel, cubic-bezier(0.2, 0.86, 0.24, 1)),
    box-shadow 180ms ease;
}

.ob-submit:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card, 0 18px 40px -18px rgba(28, 25, 19, 0.28));
}

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

/* -------------------------------------------------- step 3 success */

.ob-step-done { text-align: center; }

.ob-check {
  display: block;
  margin: 4px auto 18px;
}

.ob-check-ring { transform-origin: 48px 48px; }
.ob-check-disc { transform-origin: 48px 48px; }

.ob-step-done:not([hidden]) .ob-check-ring {
  animation: ob-pop 460ms var(--ease-carousel, cubic-bezier(0.2, 0.86, 0.24, 1)) both;
}

.ob-step-done:not([hidden]) .ob-check-disc {
  animation: ob-pop 460ms 60ms var(--ease-carousel, cubic-bezier(0.2, 0.86, 0.24, 1)) both;
}

.ob-check-mark {
  stroke-dasharray: 44;
  stroke-dashoffset: 44;
}

.ob-step-done:not([hidden]) .ob-check-mark {
  animation: ob-draw 420ms 220ms ease forwards;
}

.ob-step-done .ob-sub { margin-bottom: 26px; }

.ob-done { margin-top: 0; }

@keyframes ob-pop {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

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

/* ------------------------------------------------------------- dots */

.ob-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
}

.ob-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(28, 25, 19, 0.16);
  transition: width 240ms var(--ease-carousel, cubic-bezier(0.2, 0.86, 0.24, 1)),
    background-color 240ms ease;
}

.ob-dot.is-done { background: rgba(28, 25, 19, 0.34); }

.ob-dot.is-active {
  width: 20px;
  background: var(--ink, #1C1913);
}

/* ------------------------------------------------------- responsive */

@media (max-width: 520px) {
  .ob-overlay { padding: 16px 12px; }

  .ob-panel {
    padding: 52px 20px 22px;
    border-radius: 20px;
  }

  .ob-title { font-size: 22px; }
  .ob-sub { font-size: 14px; }
  .ob-role { padding: 13px 13px; font-size: 13.5px; }
  .ob-press { gap: 16px; }
  .ob-press-mark { height: 18px; }
  .ob-quote { padding: 14px; }
  .ob-quote blockquote { font-size: 14px; }
}

@media (max-width: 360px) {
  .ob-roles { grid-template-columns: minmax(0, 1fr); }
}

/* --------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  .ob-overlay,
  .ob-panel,
  .ob-role,
  .ob-submit,
  .ob-dot,
  .ob-back,
  .ob-close,
  .ob-input {
    transition: none !important;
  }

  .ob-overlay.is-open .ob-panel,
  .ob-panel { transform: none; }

  .ob-role:hover,
  .ob-submit:hover { transform: none; }

  .ob-step-done:not([hidden]) .ob-check-ring,
  .ob-step-done:not([hidden]) .ob-check-disc,
  .ob-step-done:not([hidden]) .ob-check-mark {
    animation: none;
  }

  .ob-check-mark { stroke-dashoffset: 0; }
}
