/* ============================================================================
   commissions.css — Commissions page styles (Phase 3). Loaded only on /commissions.

   Sections:
     1. Sticky price bar
     2. Category sections + option grid (3 columns like the brief's sketch)
     3. Option controls (choices, units, animation)
     4. Reveal / contact fields / honeypot
     5. ToS box
   Themeable values live in :root here.
   ============================================================================ */

:root {
  --cmsn-menu-height: 49px;         /* menu bar height: island min-height 48px (border-box) + 1px border */
  --cmsn-accent: var(--color-accent);
  --cmsn-card-border: rgba(0, 0, 0, 0.10);
}

/* ---------------------------------------------------------------------------
   1. PRICE BAR — content-width, docked flush beneath the menu bar like a tab.
   Square top corners, rounded bottom corners. It sticks just under the menu
   as you scroll.
   --------------------------------------------------------------------------- */
/* On this page the content column begins exactly at the menu's bottom edge, so
   the price box (its first child) docks flush under the menu with no gap. */
.page-commissions .content { padding-top: var(--cmsn-menu-height); }

.cmsn-pricebar {
  position: sticky;
  top: var(--cmsn-menu-height);
  z-index: 50;
  margin-top: 0;                    /* flush to the menu; no gap above */
  margin-bottom: 1.5rem;
  display: flex;
  align-items: baseline;
  justify-content: center;          /* label + value grouped, centered */
  gap: 0.6rem;
  padding: 0.9rem 1.2rem;
  background: #eef1f6;              /* soft tint, distinct from the white page */
  border-bottom: 1px solid var(--cmsn-card-border);
  border-radius: 0 0 12px 12px;     /* only the lower edge is rounded */
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}
.cmsn-pricebar__label { font-size: 0.95rem; color: var(--color-muted); letter-spacing: var(--nav-letterspacing); }
.cmsn-pricebar__value { font-size: 1.4rem; }

/* ---------------------------------------------------------------------------
   2. CATEGORIES + OPTION GRID.
   --------------------------------------------------------------------------- */
.cmsn-cat { margin-bottom: 2rem; }
.cmsn-cat__title {
  font-size: 1rem;
  letter-spacing: var(--nav-letterspacing);
  text-transform: uppercase;
  color: var(--color-text);
  border-bottom: 1px solid var(--cmsn-card-border);
  padding-bottom: 0.4rem;
  margin: 0 0 1rem;
}
.cmsn-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.cmsn-option {
  border: 1px solid var(--cmsn-card-border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  background: #fff;
}
.cmsn-option__label { font-size: 0.9rem; margin: 0 0 0.6rem; }

/* ---------------------------------------------------------------------------
   3. CONTROLS.
   --------------------------------------------------------------------------- */
.cmsn-choices { display: flex; flex-direction: column; gap: 0.4rem; }
.cmsn-choice {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.15rem 0;
}
.cmsn-choice input { margin: 0; }
.cmsn-choice__price { color: var(--color-muted); font-variant-numeric: tabular-nums; }

.cmsn-num {
  width: 5rem;
  font: inherit;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--cmsn-card-border);
  border-radius: 6px;
}
.cmsn-units, .cmsn-anim { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; font-size: 0.85rem; }
.cmsn-units__name { color: var(--color-muted); }
.cmsn-anim__field { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.8rem; color: var(--color-muted); }
.cmsn-anim__times { align-self: flex-end; padding-bottom: 0.4rem; }

/* ---------------------------------------------------------------------------
   4. REVEAL + CONTACT FIELDS.
   --------------------------------------------------------------------------- */
.cmsn-reveal { margin-top: 1rem; }
/* The "CREATE REQUEST?" prompt spans the full width and centers its label. */
#cmsnReveal { display: block; width: 100%; text-align: center; }
/* `display: block` above would override the HTML `hidden` attribute, so make
   the hidden state win — the button vanishes once it reveals the contact fields. */
#cmsnReveal[hidden] { display: none; }
.cmsn-btn {
  font: inherit;
  letter-spacing: var(--nav-letterspacing);
  border: 0;
  border-radius: 10px;
  padding: 0.8rem 1.4rem;
  cursor: pointer;
  transition: opacity 160ms var(--anim-ease), transform 160ms var(--anim-ease);
}
.cmsn-btn--primary { background: var(--cmsn-accent); color: #fff; font-size: 0.95rem; }
.cmsn-btn--primary:hover { transform: translateY(-2px); }

.cmsn-contact {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  /* Reveal animation reuses the dock feel. */
  animation: cmsn-reveal 420ms var(--anim-ease);
}
/* `display: flex` above would otherwise override the HTML `hidden` attribute,
   so the fields would show on load. Keep them hidden until JS reveals them. */
.cmsn-contact[hidden] { display: none; }
@keyframes cmsn-reveal { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

.cmsn-field-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.cmsn-field { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; }
.cmsn-field input, .cmsn-field textarea {
  font: inherit;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--cmsn-card-border);
  border-radius: 8px;
  resize: vertical;
}

/* Honeypot: pushed off-screen, never shown to humans. */
.cmsn-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.cmsn-tos-accept { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }

.cmsn-btn--submit { background: #2e7d32; color: #fff; align-self: flex-start; }
.cmsn-btn--submit[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

.cmsn-result { font-size: 0.9rem; margin: 0.2rem 0 0; }
.cmsn-result.is-ok { color: #2e7d32; }
.cmsn-result.is-error { color: #c0392b; }

/* ---------------------------------------------------------------------------
   5. TOS BOX.
   --------------------------------------------------------------------------- */
.cmsn-tos {
  margin-top: 2.5rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--cmsn-card-border);
  border-radius: 10px;
  background: #fafafa;
  font-size: 0.9rem;
  line-height: 1.6;
}
.cmsn-tos h2 { font-size: 1.05rem; margin-top: 0; }

/* Disclaimer box — same card look as the ToS box, shown ABOVE the request form.
   A warm tint sets it apart as a notice rather than the dense legal terms below. */
.cmsn-disclaimer {
  margin-bottom: 2rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--cmsn-card-border);
  border-radius: 10px;
  background: #fff8e9;
  font-size: 0.9rem;
  line-height: 1.6;
}
.cmsn-disclaimer :first-child { margin-top: 0; }
.cmsn-disclaimer :last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------------------
   Responsive: collapse the 3-column grids on narrow screens.
   --------------------------------------------------------------------------- */
@media (max-width: 820px) {
  .cmsn-grid, .cmsn-field-row { grid-template-columns: 1fr; }
}
