/* Talk to a Specialist (pages/specialist, pages/specialist_sent) in the
 * account flow design (Nov 2026): two cards (the free consult, the Help
 * Center) over the form card. Signed in it sits in the account frame
 * (account.css: the side navigation, .hm-page and its head); signed out,
 * alone in the flow frame (.sp-page--solo). The cards, rings and buttons
 * are the shared ones (.ac-card, .ac-ring, .ac-btn--*); help.css brings the
 * support primitives. The fields take the account's field look (forms.css
 * .ac-input: a dark well, a pearl edge, the violet focus, 16px text so iOS
 * does not zoom) under their own sp-* names, which specialist.js and the
 * tests rely on. Every colour is a token (tokens.css, --ez-*). */

/* ===================================================================== */
/* Layout                                                                 */
/* ===================================================================== */

.sp-page {
  --sp-field-height: 50px;
}

.sp-page > .sp-two,
.sp-page > .sp-card {
  max-width: 980px;
}

/* Signed out: the flow frame's column, centred. */
.sp-page--solo {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}

.sp-head__title {
  margin: 0;
  color: var(--ez-pearl);
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

/* The two cards. */
.sp-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}

.sp-two > .ac-card {
  padding: 26px;
}

.sp-ih {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--ez-pearl);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.sp-mut {
  margin: 0;
  color: var(--ez-mute);
  font-size: 16px;
  line-height: 1.3;
}

/* "We'll call +1 (202) •••-••43". */
.sp-kv {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  margin: 20px 0 24px;
}

.sp-kv dt,
.sp-kv dd {
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid var(--ez-hair);
  font-size: 14.5px;
  line-height: 1.3;
}

.sp-kv dt {
  padding-right: 12px;
  color: var(--ez-mute);
}

.sp-kv dd {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.sp-consult__cta {
  margin-top: 20px;
}

.sp-kv + .sp-consult__cta {
  margin-top: 0;
}

/* ===================================================================== */
/* The form card                                                          */
/* ===================================================================== */

.sp-card {
  padding: 28px;
  color: var(--ez-copy);
  line-height: 1.45;
  scroll-margin-top: calc(var(--ac-bar-h) + var(--ac-subnav-h) + 24px);
}

.sp-card__title {
  margin: 0;
  color: var(--ez-pearl);
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sp-lede {
  margin: 4px 0 0;
  color: var(--ez-mute);
  font-size: 16px;
  line-height: 1.5;
}

.sp-form {
  margin-top: 24px;
}

.sp-field {
  margin-top: 18px;
}

.sp-form > .sp-field:first-of-type {
  margin-top: 0;
}

/* Audience and platform side by side wherever both fit. */
.sp-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.sp-row .sp-field {
  margin-top: 0;
}

.sp-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.sp-label {
  display: block;
  color: var(--ez-pearl);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

/* Beside the phone: "Optional", or required for a call or a text. */
.sp-tag {
  color: var(--ez-mute);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}

.sp-tag--required {
  color: var(--ez-error-soft);
  font-weight: 600;
}

/* The fields wear the contact form's ivory look (forms.css
 * .ac-input--ivory): plum words on ivory, a 2px edge that turns violet with
 * a 4px halo on focus, the error red with a 3px halo when invalid. */
.sp-control {
  display: block;
  width: 100%;
  height: 50px;
  margin: 7px 0 0;
  padding: 0 16px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: var(--ez-ivory);
  box-shadow: var(--ez-ivory-inset), 0 0 0 1px var(--ez-field-edge);
  color: var(--ez-plum);
  caret-color: var(--ez-violet-600);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 20px;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.ac-body .sp-control {
  font-family: var(--font-display);
}

.sp-control::placeholder {
  color: var(--ez-field-ivory-placeholder);
  opacity: 1;
}

.sp-control:hover {
  background-color: var(--ez-ivory);
}

.sp-control:focus {
  outline: none;
  border-color: var(--ez-violet-500);
  box-shadow: 0 0 0 4px var(--ez-violet-28);
}

.sp-control[aria-invalid="true"],
.sp-control[aria-invalid="true"]:focus {
  border-color: var(--ez-error-edge);
  box-shadow: 0 0 0 3px var(--ez-error-ring);
}

.sp-textarea {
  height: auto;
  min-height: 140px;
  padding: 12px 14px;
  line-height: 1.5;
  resize: vertical;
}

/* The platform: a native select with the chevron over it, quiet until a
 * platform is chosen. */
.sp-select {
  position: relative;
  margin-top: 7px;
}

.sp-select .sp-control {
  margin-top: 0;
  padding-right: 42px;
  cursor: pointer;
}

.sp-select .sp-control:has(option[value=""]:checked) {
  color: var(--ez-field-ivory-placeholder);
}

.sp-select option {
  background: var(--ez-ivory);
  color: var(--ez-plum);
}

.sp-select .hp-icon {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  color: var(--ez-ink-soft);
  pointer-events: none;
}

.sp-help {
  margin: 7px 0 0;
  color: var(--ez-mute);
  font-size: 13px;
  line-height: 1.45;
}

.sp-err {
  margin: 7px 0 0;
  color: var(--ez-error-soft);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
}

.sp-err[hidden] {
  display: none;
}

/* ===================================================================== */
/* Preferred way to reach you: three radios as one segmented control      */
/* ===================================================================== */

.sp-fieldset {
  min-width: 0;
  margin: 22px 0 0;
  padding: 0;
  border: 0;
}

.sp-fieldset legend {
  margin: 0;
  padding: 0;
}

.sp-seg {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.sp-seg__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.sp-seg__option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--sp-field-height);
  padding: 6px 10px;
  border: 1px solid var(--ez-field-edge);
  border-radius: var(--ez-radius-field);
  background: var(--ez-field-well);
  color: var(--ez-copy);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.sp-seg__option:hover {
  background: var(--ez-field-well-hover);
  color: var(--ez-pearl);
}

.sp-seg__input:checked + .sp-seg__option {
  border-color: var(--ez-violet-500);
  background: var(--ez-violet-28);
  color: var(--ez-pearl);
}

.sp-seg__input:focus-visible + .sp-seg__option {
  outline: var(--ez-focus);
  outline-offset: var(--ez-focus-offset);
}

.sp-note {
  margin: 8px 0 0;
  color: var(--ez-mute);
  font-size: 13px;
  line-height: 1.45;
}

/* ===================================================================== */
/* Legal lines, a failed send, and the button                             */
/* ===================================================================== */

.sp-legal {
  margin: 22px 0 0;
  color: var(--ez-copy-soft);
  font-size: 12.5px;
  line-height: 1.55;
}

.sp-ref {
  margin: 6px 0 0;
  color: var(--ez-copy-soft);
  font-size: 12.5px;
  line-height: 1.5;
}

.sp-page .sp-legal a,
.sp-page .sp-ref a {
  color: var(--ez-pearl);
  text-decoration: underline;
  text-decoration-color: var(--ez-pearl-35);
  text-underline-offset: 2px;
}

.sp-page .sp-legal a:hover,
.sp-page .sp-ref a:hover {
  text-decoration-color: var(--ez-pearl);
}

.sp-alert {
  margin: 18px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--ez-error-line);
  border-radius: 12px;
  background: var(--ez-error-fill);
  color: var(--ez-pearl);
  font-size: 14px;
  line-height: 1.45;
}

.sp-alert__text {
  margin: 0;
}

/* Retry: the outline button at 40px (forms.css .ac-btn--secondary's
 * look; the class stays for the tests and the script). */
.sp-alert__retry {
  min-height: 40px;
  margin-top: 12px;
  padding: 0 18px;
  border: 1px solid var(--ez-outline-line);
  border-radius: var(--ac-btn-radius);
  background: var(--ez-white-03);
  color: var(--ez-pearl);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.sp-alert__retry:hover {
  border-color: var(--ez-lilac-55);
  background: var(--ez-white-06);
}

.sp-alert__retry:focus-visible {
  outline: var(--ez-focus);
  outline-offset: var(--ez-focus-offset);
}

/* Send: the shared violet pill (.ac-btn--primary --block), with a spinner
 * while the request is on its way (specialist.js). */
.sp-submit {
  position: relative;
  margin-top: 22px;
}

.sp-submit[disabled] {
  opacity: 0.7;
  cursor: progress;
}

.sp-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid var(--ob-ink-30);
  border-top-color: var(--ez-pearl);
  border-radius: 50%;
  animation: sp-spin 0.8s linear infinite;
}

.sp-submit[aria-busy="true"] .sp-spinner {
  display: block;
}

@keyframes sp-spin {
  to {
    transform: rotate(360deg);
  }
}

/* The honeypot: out of sight and out of reach. */
.sp-hp {
  position: absolute !important;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

/* ===================================================================== */
/* Sent                                                                   */
/* ===================================================================== */

.sp-done {
  padding: 36px 28px;
  text-align: center;
}

.sp-page--solo .sp-done {
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.sp-done__title {
  margin: 18px 0 0;
  color: var(--ez-pearl);
  font-size: 34px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.sp-done__text {
  margin: 12px 0 0;
  color: var(--ez-copy);
  font-size: 16px;
  line-height: 1.55;
}

/* ===================================================================== */
/* Narrower screens                                                       */
/* ===================================================================== */

@media (max-width: 900px) {
  .sp-two {
    grid-template-columns: minmax(0, 1fr);
  }
  /* The form card (.sp-two's cards keep the design's 26px). */
  .sp-card {
    padding: 22px 18px;
  }
  .sp-head__title {
    font-size: 30px;
  }
}

@media (max-width: 600px) {
  .sp-row {
    grid-template-columns: minmax(0, 1fr);
  }
  /* The design's 140px label column, wider when a label needs it ("Te
   * llamaremos al"). */
  .sp-kv {
    grid-template-columns: minmax(140px, auto) minmax(0, 1fr);
  }
}

@media (max-width: 420px) {
  .sp-seg {
    gap: 8px;
  }
  .sp-seg__option {
    padding: 6px;
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sp-control,
  .sp-seg__option,
  .sp-alert__retry {
    transition: none;
  }
  .sp-spinner {
    border-top-color: var(--ob-ink-30);
    animation: none;
  }
}
