/* content.css — interaction patch styles for the content / account pages.
 *
 * Loaded from the page fragments themselves (guide, quote-cart, auth-login,
 * auth-register), because scripts/build.py only auto-injects
 * site/assets/css/<route-directory-name>.css and these routes are about/,
 * guide/booster-box-formats/, quote-cart/, auth/login/, auth/register/.
 *
 * Rule of thumb: every selector below is inert until content.js has created
 * the element or set the state it targets, so a page that is only looked at
 * still renders exactly like the captured original. The one exception is the
 * password reveal button, which is intentionally visible (it is the patch the
 * brief asked for) and is sized so it never crowds the field's placeholder.
 */

/* ----------------------------------- shared ---------------------------------- */

/* No `html { scroll-behavior: smooth }` here on purpose: it would also animate
   every programmatic window.scrollTo(), including the scroll-through that
   scripts/snapshot.mjs and scripts/verify/t4-pages.mjs use to force lazy images
   to load. The guide's anchor jumps are animated from content.js with
   scrollIntoView({ behavior: 'smooth' }) instead, which touches nothing else. */

.demo-notice {
  margin-top: 0.75rem;
  padding: 0.625rem 0.8125rem;
  border-radius: 0.75rem;
  background: var(--color-surface-container-low);
  color: var(--color-on-surface-variant);
  font-size: 0.8125rem;
  line-height: 1.45;
  box-shadow: inset 0 0 0 1px #c4cad659;
}

.demo-notice[hidden] {
  display: none !important;
}

.demo-notice strong {
  color: var(--color-on-surface);
  font-weight: 700;
}

/* ------------------------------------ guide ---------------------------------- */

/* Programmatic focus after an in-page jump: keep the section from drawing a
   stray ring, but still show one for keyboard users. */
[data-guide-section]:focus {
  outline: none;
}

[data-guide-section]:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 0.75rem;
  border-radius: 0.75rem;
}

/* ------------------------------------ auth ----------------------------------- */

.has-pw-toggle {
  position: relative;
}

.has-pw-toggle .field {
  padding-right: 2.5rem;
}

.pw-toggle {
  position: absolute;
  top: 50%;
  right: 0.375rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--color-outline);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.pw-toggle:hover {
  color: var(--color-on-surface);
  background: var(--color-surface-container);
}

.pw-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
  color: var(--color-on-surface);
}

.field.is-invalid {
  box-shadow: inset 0 0 0 2px #c1121f;
}

.field-error {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: #c1121f;
}

/* --------------------------------- quote cart -------------------------------- */

/* The filled state is a real element that is hidden by default; [hidden] alone
   loses to Tailwind's display utilities, hence the explicit rules. */
[data-quote-filled][hidden],
[data-quote-empty][hidden],
[data-summary-fee-row][hidden] {
  display: none !important;
}

.qx-rows > .qx-row + .qx-row {
  border-top: 1px solid #c4cad659;
}

.qx-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 1rem 0;
}

.qx-thumb {
  flex: 0 0 auto;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.875rem;
  object-fit: cover;
  background: var(--color-surface-container-low);
  box-shadow: inset 0 0 0 1px #c4cad659;
}

.qx-meta {
  flex: 1 1 9rem;
  min-width: 0;
}

.qx-name {
  display: block;
  font-weight: 600;
  color: var(--color-ink);
  line-height: 1.3;
  transition: color 0.15s ease;
}

a.qx-name:hover {
  color: var(--color-primary);
}

.qx-unit {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--color-on-surface-variant);
}

.qx-actions {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.qx-total {
  margin-left: auto;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--color-ink);
  white-space: nowrap;
}

.qx-total small {
  display: block;
  font-weight: 400;
  font-size: 0.6875rem;
  color: var(--color-outline);
}

.qx-qty {
  width: 2.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-on-surface);
  outline: none;
  -moz-appearance: textfield;
}

.qx-qty::-webkit-outer-spin-button,
.qx-qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qx-remove {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: var(--color-outline);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.qx-remove:hover {
  color: #c1121f;
  background: var(--color-surface-container);
}

.qx-remove:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.qx-step {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem;
  border-radius: 0.5rem;
  background: var(--color-surface-container);
  box-shadow: inset 0 0 0 1px #c4cad659;
}

.qx-step button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--color-on-surface-variant);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.qx-step button:hover:not(:disabled) {
  background: var(--color-surface-container-high);
  color: var(--color-on-surface);
}

.qx-step button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.qx-step button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

@media (min-width: 640px) {
  .qx-row {
    flex-wrap: nowrap;
  }

  .qx-actions {
    flex: 0 0 auto;
  }

  .qx-remove {
    order: 9;
  }

  .qx-total {
    min-width: 5.25rem;
  }
}
