/* ==========================================================================
   Solicitud de participación — page-solicitud.php (Figma node 369:55 PC /
   370:123 SP). Two parts: a couple of small additions to the shared
   .page-intro banner (kicker row + JP title subtitle, unique to this
   page), and the styling for the Contact Form 7 form itself.
   ========================================================================== */

/* ------------------------------ Intro banner ------------------------------
   "PARTICIPA  出展者登録" sits on one row here (unlike FAQ/Contacto, which
   only ever show one kicker), and the H1 gets its own JP subtitle line
   underneath — both unique to this page's Figma intro. */
.page-intro__kicker-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
}

.page-intro__kicker-jp {
  font-size: 0.8125rem;
  color: var(--ink-body-text, rgba(255, 255, 255, 0.7));
}

.page-intro__title-jp {
  margin: -8px 0 0;
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--white);
}

@media (max-width: 782px) {
  .page-intro__title-jp {
    font-size: 1.25rem;
  }
}

/* --------------------------------- Card ------------------------------------
   The form floats as a white card on the page's paper background —
   Figma's "Form card" (900px wide, 56px padding all around). */
.solicitud-section {
  background: var(--paper);
}

.solicitud-card {
  max-width: 900px;
  margin-inline: auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  padding: 56px;
}

.solicitud-card__title {
  margin: 0 0 40px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.3;
  color: var(--ink);
}

.solicitud-card__title .jp-accent {
  display: block;
  margin-top: 4px;
  font-weight: 400;
  font-size: 1.125rem;
}

.solicitud-missing-plugin {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-55);
}

/* Optional "Aviso antes de enviar" box (solicitud_notice ACF field,
   added per the user, 2026-10-28) — sits above the form, inside the same
   card, so it reads as part of "what you're about to fill in" rather
   than a separate section. Amber-tinted to stand out from the plain
   white card without reading as an error (that's .wpcf7-not-valid-tip's
   vermillion, further down). */
.solicitud-notice {
  margin: 0 0 32px;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  background: rgba(206, 134, 29, 0.12);
  border: 1px solid rgba(206, 134, 29, 0.3);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink);
}

.solicitud-notice p {
  margin: 0;
}

.solicitud-notice p + p {
  margin-top: 10px;
}

@media (max-width: 782px) {
  .solicitud-card {
    padding: 32px 20px;
  }
}

/* ------------------------------ Form groups -------------------------------- */
.solicitud-group {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.solicitud-group + .solicitud-group,
.solicitud-divider {
  margin-top: 32px;
}

.solicitud-divider {
  border: none;
  border-top: 1px solid var(--ink-10);
  margin-bottom: 32px;
}

.solicitud-legend {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-55);
}

.solicitud-legend .jp-accent {
  display: block;
  margin-top: 2px;
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink-35);
}

.solicitud-note {
  margin: 8px 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-55);
}

.solicitud-note .jp-accent {
  display: block;
  margin-top: 2px;
}

/* .solicitud-note has two different parents in this form, and they need
   different spacing rules because they put it in two different layout
   contexts:
   - Directly under .solicitud-legend (DETALLES DE LA SOLICITUD's own
     explanatory line), both are DIRECT children of .solicitud-group,
     whose own flex column already applies an 18px gap between them. That
     gap and this rule's own 8px top margin don't collapse into each
     other (margins never collapse against a flex gap) — they'd stack, to
     26px total, reading as a separate paragraph rather than the legend's
     own explanation. Pulled back down to a tight 10px (18px gap - 8px)
     for this specific pairing only.
   - Nested inside a .solicitud-field instead (paired with that field's
     own hint, e.g. Descripción's "Cuéntanos sobre..."), .solicitud-note
     is a plain block sibling of the <label> above it and the form
     control below it, NOT a flex child — ordinary margin collapsing
     applies here, so this rule's own base styles (above) are what
     actually governs the spacing; see .solicitud-field > .solicitud-note
     below for the rest of that story. */
.solicitud-group > .solicitud-legend + .solicitud-note {
  margin-top: -8px;
}

/* Reported by the user, 2026-11-05 ("Descripcionのエリアは窮屈なイメー
   ジ。"), with a screenshot of exactly this field. Root cause: before
   this rule existed, EVERY .solicitud-note on the page — both the
   legend's own explanatory line above and this nested, field-paired one
   — shared one hardcoded `margin: -8px 0 0`. That negative top margin was
   tuned for the legend/flex-gap case above; reused here, inside a plain
   .solicitud-field, it instead collapsed straight into the <label>'s own
   margin-bottom: 8px (CSS collapses adjacent block margins to
   MAX(positive) + MIN(negative) when one is negative — 8 + (-8) = 0), so
   the hint text sat flush against the label with no breathing room at
   all, and — since .solicitud-note had no bottom margin either — the
   textarea right below it had none either. This rule gives the nested
   case its own explicit bottom spacing instead of inheriting a margin
   tuned for a different parent; its (now-positive) top margin already
   comes from the base .solicitud-note rule above, once the group-only
   override no longer reaches in here. */
.solicitud-field > .solicitud-note {
  margin-bottom: 10px;
}

.solicitud-row {
  display: flex;
  gap: 24px;
}

.solicitud-row .solicitud-field {
  flex: 1 1 0%;
  min-width: 0;
}

@media (max-width: 600px) {
  .solicitud-row {
    flex-direction: column;
  }
}

/* Field labels — ES line keeps the theme's default bold `label` weight;
   the JP line underneath is deliberately Regular (not bold, not dimmed)
   to match Figma: same size/opacity, just a lighter weight. */
.solicitud-field label,
.solicitud-consent label {
  margin-bottom: 8px;
}

.solicitud-field label .jp-accent,
.solicitud-toggle-label .jp-accent {
  display: block;
  font-weight: 400;
}

.solicitud-req {
  color: var(--vermillion);
}

/* ------------------------------ Radio group -------------------------------- */
.wpcf7-form-control.wpcf7-radio {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wpcf7-form-control.wpcf7-radio .wpcf7-list-item {
  margin: 0;
}

.wpcf7-form-control.wpcf7-radio label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 0;
}

.wpcf7-form-control.wpcf7-radio input[type='radio'] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--vermillion);
  cursor: pointer;
}

/* ------------------------------- Dropzone ---------------------------------- */
.solicitud-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 24px;
  border: 1.5px dashed var(--ink-22);
  border-radius: var(--radius-sm);
  background: var(--paper-55, rgba(234, 234, 244, 0.55));
  text-align: center;
}

.solicitud-dropzone__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ink-06);
  font-size: 1.125rem;
  color: var(--ink-55);
  pointer-events: none;
}

.solicitud-dropzone__hint {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  pointer-events: none;
}

.solicitud-dropzone__hint .jp-accent {
  display: block;
  font-weight: 400;
}

.solicitud-dropzone__subhint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ink-55);
  pointer-events: none;
}

.solicitud-dropzone__subhint .jp-accent {
  display: block;
}

.solicitud-dropzone__limit {
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: var(--ink-35);
  pointer-events: none;
}

.solicitud-dropzone__limit .jp-accent {
  display: block;
}

.solicitud-dropzone .wpcf7-form-control-wrap {
  position: absolute;
  inset: 0;
}

.solicitud-dropzone input[type='file'] {
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Filename readout — populated by a few lines of JS in solicitud-form.js
   (progressive enhancement only; the upload itself works without it). */
.solicitud-dropzone__filename {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--vermillion);
  pointer-events: none;
}

/* ------------------------- Translations toggle ----------------------------- */
.solicitud-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.solicitud-toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--ink);
  cursor: pointer;
}

.solicitud-toggle-icon {
  position: relative;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink-06);
}

.solicitud-toggle-icon::before,
.solicitud-toggle-icon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  background: var(--ink-75, rgba(34, 28, 67, 0.75));
  border-radius: 1px;
}

.solicitud-toggle-icon::before {
  width: 12px;
  height: 2px;
  transform: translate(-50%, -50%);
}

.solicitud-toggle-icon::after {
  width: 2px;
  height: 12px;
  transform: translate(-50%, -50%);
}

.solicitud-toggle:checked ~ .solicitud-toggle-label .solicitud-toggle-icon::after {
  display: none;
}

.solicitud-translations {
  display: none;
  flex-direction: column;
  gap: 18px;
  margin-top: 18px;
}

.solicitud-toggle:checked ~ .solicitud-translations {
  display: flex;
}

/* -------------------------------- Consent ----------------------------------- */
.solicitud-consent .wpcf7-list-item {
  margin: 0;
}

.solicitud-consent label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink);
  cursor: pointer;
}

.solicitud-consent input[type='checkbox'] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--vermillion);
  cursor: pointer;
}

/* The checkbox's two children inside .solicitud-consent label (itself
   display:flex) used to be loose text + an <a> + a <br> + a JP <span> —
   each became its OWN flex item and wrapped independently, one word per
   line on narrow widths (reported by the user, 2026-11-05, with a mobile
   screenshot). Now that content is wrapped in this one span instead (see
   inc/cf7-solicitud-forms.php's own comment above the $form template),
   so the flex row only ever has 2 items (checkbox, this span) — min-
   width: 0 lets this item actually shrink to the row's available width
   instead of overflowing it, which is what lets ordinary inline wrapping
   happen normally inside it. */
.solicitud-consent__text {
  min-width: 0;
}

.solicitud-consent a {
  color: var(--vermillion);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* -------------------------------- Submit ------------------------------------
   The real [submit] control stays a normal, fully functional CF7 button
   (AJAX + loading spinner keep working) but its own text is made
   invisible — a purely visual two-line ES/JP label is drawn on top of it,
   since a native <input type="submit"> can't contain the <br> our
   bilingual button label (matching the Figma design) needs.

   Every visual property (background, color, padding, radius) is set
   directly on .wpcf7-submit here — NOT via the shared .btn/.btn--vermillion
   classes — because a native <input type="submit"> keeps the browser's
   own OS button chrome unless `appearance` is explicitly reset, and that
   native chrome was painting its own (untransformed) label text on top
   of/behind our overlay and fighting our hover styling (reported by the
   user 2026-09-10: doubled text, worse on hover). Resetting appearance
   here fixes both. */
.solicitud-submit {
  position: relative;
  display: inline-block;
  /* Was 8px — noticeably tighter than every other gap between distinct
     blocks on this page (.solicitud-group's own 18px, the 32px around
     each .solicitud-divider), reported as part of the user's broader
     "re-check the whole page's margins" pass, 2026-11-05, after the
     .solicitud-note fix below made the gap above .solicitud-consent (32px,
     from .solicitud-divider) stand out against this tight one right below
     it. Bumped to 24px — still reads as "this button belongs to the
     checkbox right above it" (tighter than a full 32px section gap) while
     no longer looking cramped next to it. */
  margin-top: 24px;
}

/* Contact Form 7's own default stylesheet puts `width: 100%` on this wrap
   span (it uses that to position the validation tooltip). Nested inside
   our shrink-to-fit `.solicitud-submit`, that 100% has nothing to resolve
   against and the browser falls back to stretching it — the button then
   renders as a short, full-card-width bar instead of the compact pill in
   the Figma design (reported by the user, 2026-10-28, as "崩れている").
   Pinning it back to inline-block/auto here fixes the shape without
   touching CF7's own stylesheet. */
.solicitud-submit .wpcf7-form-control-wrap {
  display: inline-block;
  width: auto;
}

.solicitud-submit .wpcf7-submit {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  min-height: 64px;
  padding: 14px 26px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--vermillion);
  color: transparent;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.solicitud-submit .wpcf7-submit:hover {
  background: #aa2024;
  transform: translateY(-1px);
}

.solicitud-submit .wpcf7-submit:active {
  background: #891a1b;
  transform: translateY(0);
}

.solicitud-submit .wpcf7-submit:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* Disabled state (added per the user, 2026-10-28): the button starts
   disabled and solicitud-form.js enables it once every required field is
   filled in — see the "required-field watcher" section of that file. Grey
   fill matching the theme's other disabled CTAs (.btn[disabled] in
   base.css), kept as its own rule since this button intentionally doesn't
   use the shared .btn classes (see the note above). */
.solicitud-submit .wpcf7-submit:disabled {
  background: #857f74;
  cursor: not-allowed;
}

.solicitud-submit .wpcf7-submit:disabled:hover,
.solicitud-submit .wpcf7-submit:disabled:active {
  background: #857f74;
  transform: none;
}

/* Contact Form 7's own default stylesheet renders this spinner as
   display:inline-block + visibility:hidden (NOT display:none) with
   width:24px and margin:0 24px — so even while idle/invisible it still
   occupies 24+24+24 = 72px of real horizontal space right after the
   submit button, in normal document flow. That widened .solicitud-submit
   (the shrink-to-fit wrapper, sized by its own in-flow children) well
   past the visible red button's own ~200px+ box — and since
   .solicitud-submit__label centers itself via `inset: 0` against
   .solicitud-submit's FULL width, not the visible button's narrower one,
   its centered text landed roughly 36px (half of 72px) right of the
   button's actual center. Reported by the user, 2026-11-05 ("このボタン
   のサイズは何？どうしてテキストが右によっているの？") after the
   disabled-state screenshot made the mismatch obvious.
   Fixed by taking the spinner out of flow entirely (position: absolute
   instead of relative) so its CF7-default width/margin no longer counts
   toward .solicitud-submit's size — the wrapper now shrinks to exactly
   the visible button's own box, which is what .solicitud-submit__label's
   inset:0 centering was always assuming. Placed just past the button's
   right edge (plugin default behavior puts it there) so it still reads
   naturally if CF7 ever shows it during a slow submit. */
.solicitud-submit .wpcf7-spinner {
  position: absolute;
  top: 50%;
  left: 100%;
  margin: 0 0 0 10px;
  transform: translateY(-50%);
  z-index: 2;
}

.solicitud-submit__label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.3;
  pointer-events: none;
}

.solicitud-submit__label .jp-accent {
  margin-top: 2px;
  font-weight: 400;
  font-size: 0.8125rem;
}

/* --------------------------- Validation / status ----------------------------- */
.wpcf7-not-valid-tip {
  display: block;
  margin-top: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--vermillion);
}

.wpcf7-not-valid {
  border-color: var(--vermillion) !important;
}

.wpcf7-response-output {
  margin: 32px 0 0 !important;
  padding: 16px 20px !important;
  border-radius: var(--radius-sm) !important;
  font-size: 0.9375rem !important;
}

form.sent .wpcf7-response-output {
  border-color: rgba(74, 124, 89, 0.4) !important;
  background: rgba(74, 124, 89, 0.08) !important;
  color: #2f5b3f !important;
}

form.failed .wpcf7-response-output,
form.aborted .wpcf7-response-output,
form.spam .wpcf7-response-output {
  border-color: rgba(192, 40, 46, 0.4) !important;
  background: rgba(192, 40, 46, 0.06) !important;
  color: var(--vermillion) !important;
}
