/* Background scene blur when vault is open */
#page-scene {
  transform-origin: 50% var(--vault-origin, 50vh);
  transition: transform 500ms var(--ease), filter 500ms var(--ease);
}
body.vault-open #page-scene {
  transform: scale(0.97) translateY(-8px);
  filter: blur(6px) brightness(0.48);
  pointer-events: none;
}

/* Vault bottom sheet modal */
#audit-dialog {
  position: fixed;
  inset: auto 0 0;
  width: min(1040px, 94vw);
  max-width: 94vw;
  height: auto;
  max-height: 86dvh;
  margin: 0 auto;
  padding: 0;
  border: 1px solid rgba(200, 169, 110, 0.22);
  border-top-color: rgba(200, 169, 110, 0.45);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  background: #0f100e;
  box-shadow: 0 -25px 80px rgba(0, 0, 0, 0.78), inset 0 1px 0 rgba(230, 210, 170, 0.14);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 9999;
}

#audit-dialog[open] {
  animation: vault-rise 500ms var(--ease) both;
}

#audit-dialog.is-closing {
  animation: vault-fall 320ms var(--ease) both;
}

#audit-dialog::backdrop {
  background: rgba(10, 11, 9, 0.72);
  backdrop-filter: blur(4px);
  animation: vault-backdrop 500ms ease both;
}

#audit-dialog.is-closing::backdrop {
  animation: vault-backdrop 320ms ease reverse both;
}

/* Inner container */
.drawer-inner {
  position: relative;
  padding: 44px 44px 38px;
}

/* Minimal Close button */
.drawer-top {
  position: absolute;
  top: 24px;
  right: 24px;
  margin: 0;
  z-index: 10;
}

#close-audit.close-minimal {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(235, 230, 221, 0.16);
  background: rgba(20, 21, 19, 0.6);
  color: #a39e93;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
  padding: 0;
}

#close-audit.close-minimal:hover {
  border-color: #c8a96e;
  color: #ebe6dd;
  transform: scale(1.05);
}

#close-audit.close-minimal:focus {
  outline: none;
}

#close-audit.close-minimal:focus-visible {
  outline: 1px solid rgba(200, 169, 110, 0.5);
  outline-offset: 2px;
}

/* 2-column layout */
.vault-layout {
  display: grid;
  grid-template-columns: 0.88fr 1.32fr;
  gap: 48px;
  align-items: start;
}

/* Left Manifesto / Pitch */
.vault-manifesto {
  position: relative;
}

.vault-coordinate {
  font: 400 9px/1.8 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #c8a96e;
  margin: 0 0 16px;
}

#audit-dialog .vault-manifesto h2 {
  font: 300 clamp(32px, 2.7vw, 42px)/1.08 var(--display);
  color: #ebe6dd;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}

#audit-dialog .vault-manifesto h2 em {
  color: #d8be8a;
  font-style: italic;
  font-weight: 300;
}

.vault-manifesto .drawer-intro {
  font: 300 13.5px/1.75 var(--sans);
  color: #9a9588;
  margin: 0;
}

/* Form Structure */
#audit-form {
  position: relative;
}

#audit-form fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 24px;
  min-width: 0;
}

#audit-form fieldset:last-of-type {
  margin-bottom: 0;
}

.minimal-legend {
  display: block;
  font: 400 9px/1.8 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a867c;
  margin-bottom: 10px;
  padding: 0;
}

/* Identity Inputs */
.identity-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

#audit-form input:not([type=radio]) {
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(235, 230, 221, 0.16);
  padding: 10px 0;
  font: 300 13px var(--sans);
  color: #ebe6dd;
  border-radius: 0;
  min-height: 42px;
  transition: border-color 0.2s;
  outline: none;
}

#audit-form input:not([type=radio]):focus {
  border-bottom-color: #c8a96e;
}

#audit-form input:not([type=radio])::placeholder {
  color: #68665f;
  font-weight: 300;
}

/* Budget Selector Pills */
.budget-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.budget-options label {
  position: relative;
  display: flex;
  cursor: pointer;
  margin: 0;
}

.budget-options input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.budget-options .budget-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  box-sizing: border-box;
  border: 1px solid rgba(235, 230, 221, 0.14);
  border-radius: 999px;
  font: 400 11.5px var(--sans);
  color: #9a9588;
  background: transparent;
  text-align: center;
  white-space: nowrap;
  transition: all 0.2s ease;
  user-select: none;
}

.budget-options label:hover .budget-pill {
  border-color: rgba(200, 169, 110, 0.45);
  color: #ebe6dd;
  background: rgba(200, 169, 110, 0.04);
}

.budget-options input:checked + .budget-pill {
  border-color: #c8a96e;
  background: rgba(200, 169, 110, 0.12);
  color: #ebe6dd;
  font-weight: 500;
  box-shadow: inset 0 0 0 1px rgba(200, 169, 110, 0.25);
}

.budget-options input:focus-visible + .budget-pill {
  outline: 2px solid #c8a96e;
  outline-offset: 2px;
}

/* Subtle budget warning */
.budget-warning {
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(200, 169, 110, 0.05);
  border: 1px solid rgba(200, 169, 110, 0.18);
  border-radius: 6px;
  animation: dossier-enter 0.25s ease both;
}

.budget-warning[hidden] {
  display: none !important;
}

.budget-warning p {
  font: 300 11px/1.6 var(--sans);
  color: #b8b2a6;
  margin: 0;
}

/* Delivery Row & Button */
.delivery-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
}

#submit-audit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  min-height: 42px;
  padding: 0 20px;
  white-space: nowrap;
  border: 1px solid #c8a96e;
  border-radius: 999px;
  background: rgba(200, 169, 110, 0.15);
  color: #ebe6dd;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  margin: 0;
}

#submit-audit:hover {
  background: rgba(200, 169, 110, 0.25);
  color: #ffffff;
}

#submit-audit:active {
  transform: scale(0.98);
}

#submit-audit:disabled {
  cursor: wait;
  opacity: 0.65;
}

#submit-audit .submit-label {
  font-size: 11.5px;
  color: inherit;
}

.audit-honey {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.drawer-whatsapp {
  display: inline-block;
  font: 400 12.5px/1.6 var(--sans);
  color: #c8a96e;
  padding: 10px 0 2px;
  margin-top: 14px;
  border-bottom: 1px solid rgba(200, 169, 110, 0.35);
  transition: border-color 0.2s, color 0.2s;
}

.drawer-whatsapp:hover {
  color: #ebe6dd;
  border-bottom-color: #ebe6dd;
}

#audit-error {
  margin-top: 14px;
  color: #e0a596;
  font: 400 12px/1.6 var(--sans);
}

/* Success View */
#audit-success {
  max-width: 680px;
  margin: 10px auto 0;
  padding: 10px 0;
  animation: dossier-enter 0.35s ease both;
  outline: none;
}

.audit-status {
  font: 400 9px/1.8 var(--mono);
  letter-spacing: 0.12em;
  color: #76a88e;
  margin: 0 0 16px;
}

#audit-success h2 {
  font: 300 36px/1.15 var(--display);
  color: #ebe6dd;
  margin: 0 0 20px;
}

.audit-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding: 16px 20px;
  background: rgba(235, 230, 221, 0.03);
  border: 1px solid rgba(200, 169, 110, 0.18);
  border-radius: 8px;
  margin: 20px 0;
}

.audit-summary div {
  display: block;
}

.audit-summary dt {
  font: 400 8.5px/1.8 var(--mono);
  letter-spacing: 0.1em;
  color: #8a867c;
}

.audit-summary dd {
  margin: 4px 0 0;
  font-size: 13px;
  color: #ebe6dd;
}

/* Animations */
@keyframes vault-rise {
  from { transform: translateY(102%); }
  to { transform: translateY(0); }
}

@keyframes vault-fall {
  to { transform: translateY(102%); }
}

@keyframes vault-backdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes dossier-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Responsive Queries */
@media (max-width: 900px) {
  #audit-dialog {
    width: 100vw;
    max-width: 100vw;
    max-height: 92dvh;
    border-radius: 18px 18px 0 0;
  }

  .drawer-inner {
    padding: 32px 20px max(24px, env(safe-area-inset-bottom));
  }

  .drawer-top {
    top: 16px;
    right: 16px;
  }

  .vault-layout {
    display: block;
  }

  .vault-manifesto {
    margin-bottom: 26px;
    padding-right: 36px;
  }

  #audit-dialog .vault-manifesto h2 {
    font-size: clamp(28px, 6vw, 34px);
    line-height: 1.15;
  }

  .vault-manifesto .drawer-intro {
    font-size: 13px;
    margin-bottom: 0;
  }

  .identity-fields {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  #audit-form input:not([type=radio]) {
    font-size: 15px;
    padding: 11px 0;
    min-height: 44px;
  }

  .budget-options {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .budget-options .budget-pill {
    min-height: 44px;
    font-size: 11.5px;
  }

  .delivery-fields {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  #submit-audit {
    width: 100%;
    margin-top: 8px;
    height: 46px;
    min-height: 46px;
  }

  .audit-summary {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px 16px;
  }
}

@media (max-width: 480px) {
  .drawer-inner {
    padding: 28px 18px max(20px, env(safe-area-inset-bottom));
  }

  #audit-dialog .vault-manifesto h2 {
    font-size: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #page-scene { transition: none; }
  #audit-dialog[open],
  #audit-dialog.is-closing,
  #audit-dialog::backdrop {
    animation: none;
  }
}

html[data-reduced-motion] #page-scene {
  transition: none;
}

/* Quiet qualification note within the minimum-budget option. */
.budget-options .budget-pill-limited{flex-direction:column;gap:4px;min-height:52px;padding:8px 10px}
.budget-contact-note{font:500 7.5px/1.2 var(--mono);letter-spacing:.1em;color:#cf9b90}
.budget-options input:checked+.budget-pill-limited{border-color:#b97f70;background:#b97f7010;box-shadow:inset 0 0 0 1px #b97f7030}
.budget-options input:checked+.budget-pill-limited .budget-contact-note{color:#e0b1a6}

.drawer-intro .text-highlight{color:#ede7da;font-weight:500;text-shadow:0 0 16px rgba(200,169,110,0.22)}