/* Comms Request form — calm step flow (loaded after refresh.css) */
html.rf.rf-form { scroll-padding-top: 0; overflow-anchor: none; }
html.rf-form .frame, html.rf-form #stepHost { overflow-anchor: none; }
html.rf-form .form-top-anchor { height: 0; scroll-margin-top: calc(var(--rf-bar-h, 64px) + 4px); }

/* Sticky progress row */
html.rf-form .progress {
  position: sticky; top: var(--rf-bar-h, 64px); z-index: 30;
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 18px; padding: 10px 14px;
  background: rgba(250,250,248,.92);
  border: 1px solid var(--rf-hairline, rgba(44,50,53,.1));
  border-radius: 12px;
  box-shadow: 0 6px 18px -12px rgba(44,50,53,.25);
}
@supports (backdrop-filter: blur(1px)) {
  html.rf-form .progress { background: rgba(250,250,248,.8); backdrop-filter: blur(16px) saturate(1.6); -webkit-backdrop-filter: blur(16px) saturate(1.6); }
}
html.rf-form .progress-label {
  flex: none; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--rf-tidal, #2C3235); white-space: nowrap;
}
html.rf-form .progress-pips { flex: 1; display: flex; gap: 6px; min-width: 0; }
html.rf-form .progress-pip {
  flex: 1; height: 24px; padding: 0; border: 0; background: transparent; cursor: default; position: relative;
  border-radius: 6px; -webkit-appearance: none; appearance: none;
}
html.rf-form .progress-pip::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px;
  border-radius: 2px; background: var(--rule, #E8E8E3); transition: background-color .2s ease-out;
}
html.rf-form .progress-pip.active::before { background: var(--terra, #C86744); }
html.rf-form .progress-pip.done::before { background: var(--olive, #5E6B4E); }
html.rf-form .progress-pip.skipped::before { opacity: .35; }
html.rf-form .progress-pip.is-clickable { cursor: pointer; }
html.rf-form .progress-pip.is-clickable:hover::before { filter: brightness(1.15); }
html.rf-form .progress-pip:focus-visible { outline: 2px solid var(--terra, #C86744); outline-offset: 2px; }
html.rf-form .progress-pip:disabled { cursor: default; }
@media (prefers-reduced-transparency: reduce) { html.rf-form .progress { background: #FAFAF8; backdrop-filter: none; -webkit-backdrop-filter: none; } }

/* Slim intro once past step 1 */
html.rf-form .form-header.is-slim { padding: 18px clamp(20px,4vw,32px); margin-bottom: 18px; }
html.rf-form .form-header.is-slim .fh-title { font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem); margin: 0; }
html.rf-form .form-header.is-slim .fh-sub { display: none; }

/* Step transitions */
#stepHost { position: relative; transition: height .2s cubic-bezier(.2,.8,.2,1); }
#stepHost.is-clipping { overflow: hidden; }
html.rf-form .step-card.active { opacity: 1; transform: none; transition: opacity .18s ease-out, transform .18s ease-out; animation: none; }
html.rf-form .step-card.is-leaving { opacity: 0; transition: opacity .12s ease-out; }
html.rf-form .step-card.is-entering { opacity: 0; transform: translateY(8px); transition: none; }
html.rf-form .step-title:focus, html.rf-form .success-title:focus { outline: none; }
html.rf-form .step-title:focus-visible { outline: 2px solid var(--terra); outline-offset: 4px; border-radius: 4px; }

/* Inline validation */
html.rf-form [aria-invalid="true"] { border-color: var(--error, #B23A2A) !important; box-shadow: 0 0 0 3px rgba(178,58,42,.12) !important; }
html.rf-form .is-invalid-group { outline: 2px solid var(--error, #B23A2A); outline-offset: 6px; border-radius: 10px; }
html.rf-form .field-error { margin: 6px 0 0; font-size: .8125rem; line-height: 1.4; color: var(--error, #B23A2A); font-weight: 500; }
html.rf-form .is-invalid-group + .field-error { margin-top: 12px; }
html.rf-form .step-summary { margin: 18px 0 0; text-align: right; font-size: .8125rem; font-weight: 600; color: var(--error, #B23A2A); }
html.rf-form .alert { border-radius: 12px; }

/* Draft note */
html.rf-form .draft-note {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 14px; padding: 8px 8px 8px 14px; border-radius: 12px; font-size: .8125rem;
  background: rgba(44,50,53,.05); color: var(--rf-tidal, #2C3235);
}
html.rf-form .draft-note[hidden] { display: none; }
html.rf-form .draft-link { background: none; border: 0; padding: 0; color: var(--terra); font-weight: 600; text-decoration: underline; cursor: pointer; font: inherit; font-weight: 600; min-height: 32px; }
html.rf-form .draft-close { flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; }
html.rf-form .draft-close:hover { background: rgba(44,50,53,.08); }

/* Stable submit width */
html.rf-form #submitRequestButton { white-space: nowrap; }

/* Smooth reveal helper */
html.rf-form .is-revealing { overflow: hidden; transition: height .22s cubic-bezier(.2,.8,.2,1), opacity .18s ease-out; }

/* Phones */
@media (max-width: 640px) {
  html.rf-form input:not([type="checkbox"]):not([type="radio"]),
  html.rf-form select,
  html.rf-form textarea { font-size: 16px !important; }
  html.rf-form .progress { padding: 8px 12px; gap: 10px; margin-inline: -4px; }
  html.rf-form .progress-label { font-size: .6875rem; }
  html.rf-form .step-card { padding-bottom: 0 !important; }
  html.rf-form .step-card .nav-row {
    position: sticky; bottom: 0; z-index: 20;
    flex-direction: row !important; align-items: center; gap: 10px;
    margin: 24px -22px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.94); border-top: 1px solid var(--rf-hairline, rgba(44,50,53,.1));
    border-radius: 0 0 14px 14px;
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  }
  html.rf-form .step-card .nav-row .step-counter { display: none; }
  html.rf-form .step-card .nav-row .btn { width: auto !important; min-height: 48px; }
  html.rf-form .step-card .nav-row .btn-back { flex: none; padding-inline: 1rem; }
  html.rf-form .step-card .nav-row .btn-next,
  html.rf-form .step-card .nav-row .btn-submit { flex: 1; }
  html.rf-form .step-card#step0 .nav-row { justify-content: stretch; }
  html.rf-form .step-summary { text-align: center; }
  html.rf-form .channel-pill, html.rf-form .asset-item, html.rf-form .level-opt { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  #stepHost, html.rf-form .step-card.active, html.rf-form .step-card.is-leaving, html.rf-form .is-revealing { transition: none !important; }
}
@media (max-width: 640px) { html.form-in-progress .approval-sticker { display: none; } }

/* Bundles share the form's existing material and controls. */
html.rf-form .bundle-callout { padding: 18px; border-left: 3px solid var(--terra); background: var(--shell); color: var(--tidal); line-height: 1.55; margin: 20px 0; }
html.rf-form .bundle-path-note { color: var(--terra); font-size: .875rem; line-height: 1.55; margin: 12px 0; }
html.rf-form .item-builder { margin-block: 24px; }
html.rf-form #projectItems { position: relative; overflow-anchor: none; }
html.rf-form .project-item-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 44px; gap: 12px; align-items: end; padding: 18px 0; border-bottom: 1px solid var(--rule); }
html.rf-form .project-item-row .field { min-width: 0; margin: 0; }
html.rf-form .project-item-row select, html.rf-form .project-item-row input { width: 100%; min-width: 0; min-height: 44px; }
html.rf-form .item-remove { width: 44px; min-height: 44px; padding: 0; font-size: 1.5rem; }
html.rf-form .item-remove[hidden], html.rf-form .item-tier-chip[hidden], html.rf-form #itemLimit[hidden], html.rf-form #bundleLeadNote[hidden], html.rf-form #successItems[hidden] { display: none; }
html.rf-form .item-tier-chip { display: inline-block; grid-column: 1 / -1; width: fit-content; border-radius: 6px; padding: 4px 8px; background: var(--shell); color: var(--terra); border: 1px solid var(--rule); font-size: .75rem; line-height: 1.4; }
html.rf-form .item-add { margin-top: 18px; min-height: 44px; }
html.rf-form .item-exit { position: absolute; left: 0; pointer-events: none; background: var(--shell); z-index: 1; }
html.rf-form .review-items { margin: 16px 0 0; padding-left: 24px; }
html.rf-form .review-items li { padding: 10px 0; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
html.rf-form .review-items .item-tier-chip { margin-left: 10px; }
html.rf-form .asset-counter { font-size: .75rem; color: var(--tidal); }
@media (max-width: 640px) {
  html.rf-form .project-item-row { grid-template-columns: minmax(0, 1fr) 44px; }
  html.rf-form .item-type { grid-column: 1 / -1; }
  html.rf-form .item-details { grid-column: 1; }
  html.rf-form #step3-assets .nav-row { flex-wrap: wrap; }
  html.rf-form .asset-counter { flex-basis: 100%; text-align: right; }
}
