/* ── Diagnostic Morphofacial – Front styles ── */

.psdiag-widget {
  max-width: 680px;
  margin: 0 auto;
  font-family: inherit;
  color: #1a1a1a;
}

#cms .psdiag-actions .psdiag-btn--next {
    background: #8F6052!important;
}

/* ── Welcome screen ────────────────────────────────── */
.psdiag-screen.psdiag-screen--welcome {
  margin-top: -40px; /* cancel .page-content top margin */
  padding: 0;
}

/* Full-width hero when an image is uploaded */
.psdiag-welcome-hero {
  position: relative;
  width: 100vw;
  left: 50%;
  transform: translateX(-50%);
  overflow: hidden;
  line-height: 0;
  height: 100svh; /* Full viewport height */
  height: 100vh;  /* Fallback */
}

.psdiag-welcome-hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.psdiag-welcome-hero__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 48px 24px 44px;
  text-align: center;
  background: linear-gradient(to top, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.15) 60%, transparent 100%);
}

/* No image fallback */
.psdiag-welcome-inner {
  text-align: center;
  padding: 64px 24px;
}

.psdiag-welcome-tagline {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #999;
  margin: 0 0 18px;
}

/* Title & subtitle adapt to context (on image = white, fallback = dark) */
.psdiag-welcome-hero__overlay .psdiag-welcome-title,
.psdiag-welcome-hero__overlay .psdiag-welcome-subtitle {
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.35);
}

.psdiag-welcome-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 14px;
  line-height: 1.3;
  color: #1a1a1a;
}

.psdiag-welcome-subtitle {
  font-size: 15px;
  color: #555;
  margin: 0 0 32px;
  line-height: 1.65;
}

/* Old image wrap (no longer used but kept for safety) */
.psdiag-welcome-image-wrap { display: none; }
.psdiag-welcome-image { display: none; }

/* ── All screens ────────────────────────────────────── */
.psdiag-screen {
  padding: 44px 24px;
}

.psdiag-counter {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #aaa;
  margin: 0 0 20px;
}

.psdiag-section-title {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #aaa;
  margin: 0 0 12px;
  text-align: center;
}

.psdiag-question-title {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 32px;
  line-height: 1.4;
}

/* ── Radio buttons ──────────────────────────────────── */
.psdiag-radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 40px;
}

.psdiag-radio-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid #e2e2e2;
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.12s;
  font-size: 15px;
  line-height: 1.4;
  user-select: none;
}

.psdiag-radio-option:hover {
  border-color: #1a1a1a;
  background: #fafafa;
}

.psdiag-radio-option.is-selected,
.psdiag-radio-option:has(input:checked) {
  border-color: #1a1a1a;
  background: #f4f4f4;
  font-weight: 500;
}

.psdiag-radio-option input[type="radio"] {
  accent-color: #1a1a1a;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin: 0;
  cursor: pointer;
}

/* ── Text / email inputs ────────────────────────────── */
.psdiag-input-text {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #e2e2e2;
  border-radius: 3px;
  font-size: 16px;
  color: #1a1a1a;
  background: #fff;
  margin-bottom: 40px;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.psdiag-input-text:focus {
  border-color: #1a1a1a;
}

.psdiag-input-text.psdiag-input--error,
.psdiag-radio-group.psdiag-group--error {
  border-color: #e00;
  animation: psdiag-shake 0.25s;
}

@keyframes psdiag-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ── Email screen ───────────────────────────────────── */
.psdiag-email-subtitle {
  font-size: 15px;
  color: #666;
  margin: -20px 0 28px;
  line-height: 1.6;
}

/* ── Buttons ────────────────────────────────────────── */
.psdiag-btn {
  display: inline-block;
  border: none;
  background: none;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
  padding: 0;
  line-height: 1;
}

.psdiag-btn--start {
  background: #fff;
  color: #1a1a1a;
  padding: 15px 44px;
  border-radius: 2px;
}

.psdiag-btn--start:hover,
.psdiag-btn--start:focus {
  background: #f0f0f0;
  color: #1a1a1a;
}

.psdiag-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}

.psdiag-btn--prev {
  color: #888;
  text-decoration: none;
  background: none;
  border: none;
  padding: 10px 0;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.psdiag-btn--prev:hover {
  color: #1a1a1a;
}

.psdiag-btn--next,
.psdiag-btn--submit {
  background: #1a1a1a;
  color: #fff;
  padding: 13px 32px;
  border-radius: 2px;
  margin-left: auto;
}

.psdiag-btn--next:hover,
.psdiag-btn--submit:hover,
.psdiag-btn--next:focus,
.psdiag-btn--submit:focus {
  background: #333;
  color: #fff;
}

/* ── Media ──────────────────────────────────────────── */
.psdiag-question-media {
  margin-bottom: 20px;
}

.psdiag-question-image,
.psdiag-question-video {
  display: block;
  width: 100%;
  max-width: 600px;
  border-radius: 6px;
  background: #f7f7f7;
  margin-bottom: 12px;
}

/* ── Results ────────────────────────────────────────── */
.psdiag-results {
  padding: 40px 24px;
}

.psdiag-result-greeting {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 20px;
}

.psdiag-results-intro {
  font-size: 16px;
  color: #555;
  line-height: 1.65;
  margin-bottom: 28px;
}

.psdiag-products {
  display: grid;
  gap: 12px;
}

.psdiag-product {
  padding: 16px 20px;
  border: 1px solid #e2e2e2;
  border-radius: 3px;
}

.psdiag-product a {
  color: #1a1a1a;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
}

.psdiag-product a:hover {
  text-decoration: underline;
}

.psdiag-add-to-cart {
  margin-top: 18px;
}

.psdiag-add-to-cart.is-loading,
.psdiag-add-to-cart.is-added {
  opacity: 0.75;
  cursor: default;
}

.psdiag-add-to-cart-message {
  min-height: 20px;
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.4;
}

.psdiag-add-to-cart-message.is-success {
  color: #2f6f3e;
}

.psdiag-add-to-cart-message.is-error {
  color: #721c24;
}

.psdiag-no-results {
  padding: 20px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 3px;
  color: #555;
  font-size: 15px;
}

.psdiag-loading {
  text-align: center;
  padding: 48px 0;
  color: #999;
  font-size: 15px;
}

.psdiag-error {
  padding: 20px;
  background: #fdecea;
  border: 1px solid #f5c6cb;
  border-radius: 3px;
  color: #721c24;
  font-size: 15px;
}

/* ── Progress indicator ────────────────────────────── */
.psdiag-progress {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding: 12px 24px 0 80px; /* left offset to avoid cookie/chat widgets */
  background: #fff;
}

.psdiag-progress__label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7a3d2c;
  margin-bottom: 8px;
}

.psdiag-progress__track {
  height: 3px;
  background: #f0ede8;
  width: 100%;
}

.psdiag-progress__fill {
  height: 100%;
  background: #7a3d2c;
  transition: width 0.35s ease;
}


/* ── Advice blocks (rich text from rules) ───────────── */
.psdiag-advice-intro, .psdiag-products-intro {
  margin-bottom: 30px !important;
}

.psdiag-advice-blocks {
  margin-bottom: 32px;
}

.psdiag-advice-block {
  padding: 20px 24px;
  background: #f9f6f2;
  border-left: 3px solid #8F6052;
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.7;
  color: #333;
}

.psdiag-advice-block img {
  max-width: 100%;
  height: auto;
  border-radius: 3px;
  margin: 10px 0;
}

.psdiag-advice-block p { margin: 0 0 10px; }
.psdiag-advice-block p:last-child { margin-bottom: 0; }
