/* ================================================================
   DESTINY MATRIX — Page shell + Calculator form
   Form design: premium dark card, gold accent (Inter).
   Scope: ONLY the calculator form. No chart / sidebar / JS changes.
   JS hooks preserved: #name, #date, #dmc-day-p/month/year (selects),
   #get_the_answer, .errorOutput.
   ================================================================ */

/* Fonts load via <link> / wp_enqueue_style. Do not @import — it delays this file. */

/* ── Theme-friendly embed — no full-page shell, inherits site layout ── */
.dm-embed,
.dm-page-shell {
  display: block;
  position: relative;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  isolation: auto;
}

.dm-page-bg {
  display: none !important;
}

.dm-page-content {
  position: static;
  margin: 0;
  padding: 0;
  background: transparent;
}

/* Kadence / theme content blocks — no extra block spacing from the plugin */
.entry-content .dm-embed,
.wp-block-kadence-column .dm-embed,
.kb-row-layout-wrap .dm-embed,
.kadence-conversion-wrap .dm-embed,
.wp-block-group .dm-embed,
.elementor-widget-shortcode .dm-embed,
.ast-container .dm-embed,
.generate-columns-container .dm-embed {
  margin-block: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* ================================================================
   CALCULATOR FORM
   ================================================================ */
.dm-form-shell {
  --dm-card:      #100A1D;
  --dm-form-border: rgba(255, 255, 255, .06);
  --dm-input-bg:  rgba(255, 255, 255, .025);
  --dm-border:    rgba(201, 168, 76, .35);
  --dm-accent:    #C9A84C;
  --dm-accent-hi: #E0C06A;
  --dm-accent-lo: #A8892E;
  --dm-text-hi:   #F3F1F9;
  --dm-text-mid:  #8D869C;
  --dm-text-dim:  #56506A;
  --dm-button-text: #1A1408;
  --dm-button-border: transparent;
  --dm-form-radius: 22px;
  --dm-radius-lg: var(--dm-form-radius, 22px);
  --dm-radius-md: 14px;

  width: 100%;
  max-width: 100%;
  margin: 0 0 1.5rem;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.dm-form-shell *,
.dm-form-shell *::before,
.dm-form-shell *::after {
  box-sizing: border-box;
}

/* ── Card ── */
html body .dm-form-shell .dm-form-card {
  position: relative;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 18px !important;
  width: 100% !important;
  padding: 26px 30px !important;
  background: var(--dm-card) !important;
  background-color: var(--dm-card) !important;
  border: 1px solid var(--dm-form-border, rgba(255, 255, 255, .06)) !important;
  border-radius: var(--dm-radius-lg) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .05) inset,
    0 0 0 1px rgba(0, 0, 0, .2),
    0 50px 90px -32px rgba(0, 0, 0, .8),
    0 14px 28px -14px rgba(0, 0, 0, .55) !important;
}

/* ── Fields ── */
html body .dm-form-shell .dm-field {
  display: flex !important;
  flex-direction: column !important;
  gap: 9px !important;
  margin: 0 !important;
  padding: 0 !important;
}

html body .dm-form-shell .dm-field--name {
  flex: 1.3 1 0 !important;
  min-width: 0 !important;
}

html body .dm-form-shell .dm-field--dob {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  position: relative !important;
}

/* ── Labels ── */
html body .dm-form-shell .dm-field > label,
html body .dm-form-shell .dm-dob__seg > label {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  font-family: inherit !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  letter-spacing: .09em !important;
  text-transform: uppercase !important;
  color: var(--dm-text-mid) !important;
}

html body .dm-form-shell .dm-dob__seg > label {
  font-size: 10px !important;
}

/* ── Name input ── */
html body .dm-form-shell .dm-input,
html body .dm-form-shell input#name {
  width: 100% !important;
  height: 52px !important;
  padding: 0 16px !important;
  margin: 0 !important;
  background: var(--dm-input-bg, rgba(255, 255, 255, .025)) !important;
  background-color: var(--dm-input-bg, rgba(255, 255, 255, .025)) !important;
  border: 1px solid var(--dm-border) !important;
  border-radius: var(--dm-radius-md) !important;
  color: var(--dm-text-hi) !important;
  -webkit-text-fill-color: var(--dm-text-hi) !important;
  font-family: inherit !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  letter-spacing: .01em !important;
  outline: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  box-shadow: none !important;
  caret-color: var(--dm-accent) !important;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease !important;
}

html body .dm-form-shell .dm-input::placeholder,
html body .dm-form-shell input#name::placeholder {
  color: var(--dm-text-dim) !important;
  -webkit-text-fill-color: var(--dm-text-dim) !important;
  font-weight: 400 !important;
  opacity: 1 !important;
}

html body .dm-form-shell .dm-input:focus,
html body .dm-form-shell input#name:focus {
  border-color: var(--dm-accent) !important;
  background: var(--dm-input-bg, rgba(255, 255, 255, .025)) !important;
  background-color: var(--dm-input-bg, rgba(255, 255, 255, .025)) !important;
  color: var(--dm-text-hi) !important;
  -webkit-text-fill-color: var(--dm-text-hi) !important;
  box-shadow: none !important;
}

html body .dm-form-shell .dm-input:focus-visible {
  outline: none !important;
}

html body .dm-form-shell input#name:-webkit-autofill,
html body .dm-form-shell input#name:-webkit-autofill:hover,
html body .dm-form-shell input#name:-webkit-autofill:focus,
html body .dm-form-shell input#name:-webkit-autofill:active {
  -webkit-text-fill-color: var(--dm-text-hi) !important;
  transition: background-color 9999s ease-in-out 0s !important;
  box-shadow: 0 0 0 1000px rgba(20, 14, 32, 1) inset !important;
  border: 1px solid var(--dm-border) !important;
  caret-color: var(--dm-text-hi) !important;
}

/* ── Unified date control ── */
html body .dm-form-shell .dm-dob {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1.5fr !important;
  align-items: stretch !important;
  width: 100% !important;
  background: var(--dm-input-bg, rgba(255, 255, 255, .025)) !important;
  border: 1px solid var(--dm-border) !important;
  border-radius: var(--dm-radius-md) !important;
  overflow: hidden !important;
  transition: border-color .16s ease, box-shadow .16s ease !important;
}

html body .dm-form-shell .dm-dob:focus-within {
  border-color: var(--dm-accent) !important;
}

html body .dm-form-shell .dm-dob__seg {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 5px !important;
  padding: 9px 16px 11px !important;
  margin: 0 !important;
  position: relative !important;
}

html body .dm-form-shell .dm-dob__seg + .dm-dob__seg {
  border-left: 1px solid var(--dm-border) !important;
}

/* Typed date segments — match the design's inline inputs */
html body .dm-form-shell .dmc-date-input {
  width: 100% !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  color: var(--dm-text-hi) !important;
  -webkit-text-fill-color: var(--dm-text-hi) !important;
  font-family: inherit !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  line-height: 1.25 !important;
  letter-spacing: .02em !important;
  font-variant-numeric: tabular-nums !important;
  font-feature-settings: 'tnum' 1 !important;
  text-align: left !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  transition: color .16s ease !important;
}

html body .dm-form-shell .dmc-date-input::placeholder {
  color: var(--dm-text-dim) !important;
  -webkit-text-fill-color: var(--dm-text-dim) !important;
  font-weight: 400 !important;
  opacity: 1 !important;
}

html body .dm-form-shell .dmc-date-input:focus,
html body .dm-form-shell .dmc-date-input:focus-visible {
  color: var(--dm-text-hi) !important;
  -webkit-text-fill-color: var(--dm-text-hi) !important;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

html body .dm-form-shell .dmc-date-input::-webkit-outer-spin-button,
html body .dm-form-shell .dmc-date-input::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

/* Hidden ISO date field (JS writes here) */
html body .dm-form-shell .dmc-hidden-input,
html body .dm-form-shell #date {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  border: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip: rect(0, 0, 0, 0) !important;
}

/* ── CTA ── */
html body .dm-form-shell .dm-cta,
html body .dm-form-shell button#get_the_answer {
  position: relative !important;
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100% !important;
  height: 52px !important;
  padding: 0 26px !important;
  margin: 0 !important;
  border: 1px solid var(--dm-button-border, transparent) !important;
  border-radius: var(--dm-radius-md) !important;
  background: var(--dm-accent) !important;
  background-color: var(--dm-accent) !important;
  background-image: none !important;
  color: var(--dm-button-text, #FFFFFF) !important;
  font-family: inherit !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: .005em !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .16) inset,
    0 16px 32px -14px rgba(201, 168, 76, .5) !important;
  transition: background-color .16s ease, transform .12s ease, box-shadow .16s ease !important;
}

html body .dm-form-shell .dm-cta__arrow {
  display: inline-flex !important;
  transform: translateX(0);
  transition: transform .22s cubic-bezier(.2, .8, .2, 1) !important;
}

html body .dm-form-shell .dm-cta:hover,
html body .dm-form-shell button#get_the_answer:hover {
  background: var(--dm-accent-hi) !important;
  background-color: var(--dm-accent-hi) !important;
  transform: translateY(-1px) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .2) inset,
    0 20px 36px -14px rgba(201, 168, 76, .6) !important;
}

html body .dm-form-shell .dm-cta:hover .dm-cta__arrow {
  transform: translateX(3px) !important;
}

html body .dm-form-shell .dm-cta:active,
html body .dm-form-shell button#get_the_answer:active {
  background: var(--dm-accent-lo) !important;
  background-color: var(--dm-accent-lo) !important;
  transform: translateY(0) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .1) inset,
    0 8px 18px -10px rgba(168, 137, 46, .5) !important;
}

html body .dm-form-shell .dm-cta:focus-visible,
html body .dm-form-shell button#get_the_answer:focus-visible {
  outline: 2px solid var(--dm-accent-hi) !important;
  outline-offset: 2px !important;
}

/* Loading state (script_person.js toggles .is-loading on #get_the_answer) */
html body .dm-form-shell #get_the_answer.is-loading {
  pointer-events: none !important;
  color: transparent !important;
}

html body .dm-form-shell #get_the_answer.is-loading .dm-cta__label,
html body .dm-form-shell #get_the_answer.is-loading .dm-cta__arrow {
  opacity: 0 !important;
}

html body .dm-form-shell #get_the_answer.is-loading::after {
  content: '' !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: 18px !important;
  height: 18px !important;
  margin: -9px 0 0 -9px !important;
  border: 2px solid rgba(26, 20, 8, .35) !important;
  border-top-color: var(--dm-button-text, #FFFFFF) !important;
  border-radius: 50% !important;
  animation: dm-spin .65s linear infinite !important;
}

@keyframes dm-spin {
  to { transform: rotate(360deg); }
}

/* ── Error message (below the card) ── */
html body .dm-form-shell .errorOutput {
  margin: 16px 0 0 !important;
  min-height: 0 !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.5 !important;
  color: #FF7A7A !important;
  text-align: center !important;
}

html body .dm-form-shell .errorOutput p {
  margin: 0 0 4px !important;
  color: #FF7A7A !important;
}

html body .dm-form-shell .errorOutput p:last-child {
  margin-bottom: 0 !important;
}

/* ── Responsive ── */
@media (max-width: 720px) {
  html body .dm-form-shell .dm-form-card {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 28px 24px !important;
    border-radius: 20px !important;
    gap: 18px !important;
  }
  html body .dm-form-shell .dm-field--name,
  html body .dm-form-shell .dm-field--dob {
    flex: 1 1 auto !important;
  }
  html body .dm-form-shell .dm-cta,
  html body .dm-form-shell button#get_the_answer {
    width: 100% !important;
  }
  html body .dm-form-shell .dm-dob {
    grid-template-columns: 1fr 1fr 1.2fr !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body .dm-form-shell .dm-input,
  html body .dm-form-shell .dm-dob,
  html body .dm-form-shell .dm-cta,
  html body .dm-form-shell button#get_the_answer {
    transition: none !important;
  }
  html body .dm-form-shell .dm-cta:hover,
  html body .dm-form-shell .dm-cta:active {
    transform: none !important;
  }
}
