/* ==========================================================================
   Socialting — formulario de estrategia (capítulo 1 por el cliente)
   Página pública con token: /formulario?token=…
   ========================================================================== */

/* Barra superior: logo + acciones (eliminar / actualizar) + idiomas. */
.share-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.share-topbar .site-logo .isologo {
  width: 36px;
  height: 36px;
  display: block;
}

.share-topbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.share-topbar__actions [hidden] {
  display: none !important;
}

/* Hamburguesa + menú (solo mobile). */
.share-topbar__burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-bg);
  color: var(--color-ink);
  cursor: pointer;
}

.share-topbar__burger .material-symbols-outlined {
  font-size: 22px;
}

.share-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: var(--space-3);
  z-index: 350;
  min-width: 210px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: grid;
  gap: 2px;
}

.share-menu[hidden] {
  display: none;
}

.share-menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 8px;
  background: transparent;
  padding: 10px 12px;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--color-ink);
  cursor: pointer;
}

.share-menu__item:hover {
  background: var(--color-bg-soft);
}

.share-menu__item .material-symbols-outlined {
  font-size: 18px;
  color: var(--color-muted);
}

.share-menu__item.is-active {
  font-weight: 700;
}

.share-menu__sep {
  height: 1px;
  background: var(--color-border);
  margin: 4px 6px;
}

/* Salto directo en dropdown (solo mobile, reemplaza el panel). */
.share-jump {
  position: relative;
  margin-bottom: var(--space-4);
}

.share-jump[hidden] {
  display: none;
}

.share-jump__btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-bg);
  color: var(--color-ink);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.share-jump__btn .share-side__label {
  flex: 1;
}

.share-jump__btn > .material-symbols-outlined {
  font-size: 20px;
  color: var(--color-muted);
  flex-shrink: 0;
}

.share-jump__list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 350;
  max-height: 280px;
  overflow-y: auto;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
}

.share-jump__list[hidden] {
  display: none;
}

@media (min-width: 861px) {
  .share-jump {
    display: none;
  }
}

@media (max-width: 860px) {
  .share-topbar__actions {
    display: none;
  }
  .share-topbar__burger {
    display: inline-flex;
  }
  .share-topbar__burger[hidden] {
    display: none !important;
  }
  .share-side {
    display: none;
  }
}

.share-main {
  padding: var(--space-6) 0 var(--space-10);
}

.container--narrow {
  max-width: 960px;
}

/* ---- layout con panel lateral de preguntas ---- */
.share-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}

/* Sin panel (primera vez): una sola columna a ancho completo, sin
   dejar el track lateral vacío reservado. */
.share-layout:has(> .share-side[hidden]) {
  grid-template-columns: minmax(0, 1fr);
}

.share-side {
  position: sticky;
  top: 76px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  padding: var(--space-3);
}

.share-side[hidden] {
  display: none;
}

.share-side__title {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.share-side__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.share-side__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 8px;
  background: transparent;
  padding: 8px 10px;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--color-ink);
  cursor: pointer;
}

.share-side__item:hover {
  background: var(--color-bg-soft);
}

.share-side__item.is-current {
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
}

.share-side__num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-2xs);
  font-weight: 700;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-muted);
}

.share-side__item.is-current .share-side__num {
  border-color: transparent;
  background: #2776D9;
  color: #fff;
}

.share-side__item.is-done .share-side__num {
  border-color: transparent;
  background: var(--color-primary);
  color: #fff;
}

/* Llena + seleccionada: manda el azul de seleccionado. */
.share-side__item.is-current.is-done .share-side__num {
  border-color: transparent;
  background: #2776D9;
  color: #fff;
}

.share-side__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .share-layout {
    grid-template-columns: 1fr;
  }
}

.share-eyebrow {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}

.share-title {
  font-size: var(--fs-2xl);
  line-height: 1.15;
  margin-bottom: var(--space-2);
}

.share-project {
  font-size: var(--fs-sm);
  color: var(--color-muted);
  margin-bottom: var(--space-3);
}

.share-lede {
  color: var(--color-muted);
  margin-bottom: var(--space-6);
}

.share-status {
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
  font-size: var(--fs-sm);
}

.share-status--ok {
  background: #eaf7ee;
  border: 1px solid #bfe3c9;
  color: #1e6b34;
}

.share-status--error {
  background: #fff0f0;
  border: 1px solid #ffd1d1;
  color: #922b21;
}

.share-status strong {
  display: block;
  margin-bottom: var(--space-1);
}

.share-form {
  display: grid;
  gap: var(--space-5);
}

.share-section {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  background: var(--color-bg);
}

.share-section__title {
  font-size: var(--fs-md);
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.share-section textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font: inherit;
  font-size: var(--fs-sm);
  line-height: 1.6;
  background: var(--color-bg);
  color: var(--color-ink);
}

.share-section textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
  border-color: var(--color-primary);
}

.share-slider-hint {
  font-size: var(--fs-xs);
  color: var(--color-muted);
  margin-bottom: var(--space-5);
}

.share-spectrum-list {
  display: grid;
  gap: var(--space-6);
}

.share-spectrum-row__value {
  min-width: 3ch;
  text-align: center;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}

.share-submitbar {
  display: flex;
  justify-content: flex-end;
  padding-top: var(--space-2);
}

/* ---- wizard paso a paso ---- */
.share-progress {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.share-progress__label {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--color-muted);
}

.share-progress__bar {
  height: 6px;
  border-radius: 999px;
  background: var(--color-border-soft);
  overflow: hidden;
}

.share-progress__bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--color-primary);
  transition: width 250ms var(--ease-out);
}

.share-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding-top: var(--space-2);
}

.share-nav .btn:disabled {
  opacity: 0.45;
  cursor: default;
}

/* Sin hover en deshabilitados: se quedan tal cual, sin cambios
   (tampoco cambia el cursor). */
.share-nav .btn:disabled:hover {
  opacity: 0.45;
  cursor: default;
  text-decoration: none;
  transform: none;
}

.share-nav .btn--primary:disabled:hover {
  background: var(--color-primary);
}

.share-nav .btn--outline:disabled:hover {
  border-color: var(--color-border);
  color: var(--color-ink);
}

.share-nav .btn--ghost:disabled:hover {
  color: var(--color-muted);
}

/* Botón fantasma: solo texto, sin contorno (Omitir). */
.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--color-muted);
  box-shadow: none;
}

.btn--ghost:hover {
  color: var(--color-ink);
  border-color: transparent;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- thank you page ---- */
.share-thanks {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  text-align: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  padding: var(--space-8) var(--space-5);
}

.share-thanks[hidden] {
  display: none;
}

.share-thanks h2 {
  margin: 0;
  font-size: var(--fs-xl);
}

.share-thanks p {
  margin: 0;
  color: var(--color-muted);
  max-width: 46ch;
}

.share-thanks__project {
  font-weight: 700;
  color: var(--color-ink);
}

.share-thanks__check {
  font-size: 64px;
  line-height: 1;
  color: #1e6b34;
  animation: shareThanksPop 0.45s var(--ease-out);
}

.share-thanks__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

@keyframes shareThanksPop {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .share-thanks__check {
    animation: none;
  }
}

/* Entrada de cada pregunta al cambiar de paso. */
.share-step.is-entering .share-section {
  animation: shareStepIn 0.35s var(--ease-out);
}

@keyframes shareStepIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .share-step.is-entering .share-section {
    animation: none;
  }
}

/* ---- descripción de escala (sliders + IA, como el editor) ---- */
.share-desc {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.share-desc > label {
  font-size: var(--fs-sm);
  font-weight: 700;
}

.share-desc__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.share-ai-error {
  margin: 0;
  font-size: var(--fs-xs);
  color: #922b21;
}

.share-ai-error[hidden] {
  display: none;
}

/* Peligro ligero (como el Eliminar del editor): contorno rojo claro,
   sin relleno sólido. */
.btn--outline.btn--danger {
  color: #c0392b;
  border-color: #ffd1d1;
}

.btn--outline.btn--danger:hover {
  background: #fadbd8;
  border-color: #e6b0aa;
  color: #922b21;
}

/* Borrar del modal: rojo pleno con letras blancas. */
.btn--primary.btn--danger {
  background: #c0392b;
  border-color: #c0392b;
  color: #fff;
  box-shadow: none;
}

.btn--primary.btn--danger:hover {
  background: #922b21;
  border-color: #922b21;
  color: #fff;
}

/* Eliminar del top bar: hover rojizo, nunca azul de marca. */
[data-share-clear]:hover,
[data-share-m-clear]:hover {
  border-color: #ffd1d1;
  background: #fff0f0;
  color: #c0392b;
  text-decoration: none;
}

/* ---- modal de confirmación ---- */
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}

.share-modal[hidden] {
  display: none;
}

.share-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.share-modal__card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  box-shadow: var(--shadow-lg);
}

.share-modal__card h2 {
  font-size: var(--fs-lg);
  margin: 0 0 var(--space-3);
}

.share-modal__card p {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--color-muted);
}

.share-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: flex-end;
  margin-top: var(--space-5);
}

/* El atributo hidden manda sobre el display de .btn y demás clases
   (esta página no carga admin.css, donde vive esa regla global). */
.share-nav [hidden] {
  display: none !important;
}

.share-footer {
  text-align: center;
  padding: var(--space-6);
  color: var(--color-muted);
  font-size: var(--fs-xs);
}

/* ---- toast temporal (éxitos breves, se oculta solo) ---- */
.share-toast {
  position: fixed;
  left: 50%;
  bottom: var(--space-5);
  transform: translate(-50%, 12px);
  z-index: 400;
  max-width: min(420px, calc(100vw - 3rem));
  background: rgba(12, 14, 22, 0.92);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
}

.share-toast[hidden] {
  display: none;
}

.share-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 640px) {
  .share-section {
    padding: var(--space-4);
  }
}
