/* ==========================================================================
   Exploración Interior — estilos de la página (se suman a nueva.css)
   ========================================================================== */

[hidden] {
  display: none !important;
}

.explo {
  position: relative;
  isolation: isolate;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding-block: 7.5rem 4.5rem;
  background: var(--forest);
  color: var(--on-dark);
}

/* Fondo opcional: assets/img/exploracion-fondo.jpg (si no existe, solo se ve el resplandor) */
.explo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 38% at 50% 100%, rgba(224, 169, 78, 0.16), transparent 70%),
    linear-gradient(rgba(14, 25, 23, 0.5), rgba(14, 25, 23, 0.82)),
    url("../img/exploracion-fondo.jpg") center / cover no-repeat;
}

.explo__wrap {
  width: min(100% - 2 * var(--gutter), 44rem);
}

/* ---------- Bienvenida ---------- */
.explo__welcome {
  padding-block: clamp(1rem, 4vh, 3rem);
}

.explo__welcome h1 {
  max-width: 12em;
  font-size: clamp(2.6rem, 1.2rem + 5.4vw, 4.6rem);
}

.explo__lead {
  margin-top: 1.2rem;
  font-family: var(--serif);
  font-size: clamp(1.3rem, 1.05rem + 1vw, 1.8rem);
  font-style: italic;
  font-weight: 300;
  color: var(--on-dark-2);
}

.explo__intro {
  max-width: 46ch;
  margin-top: 1.6rem;
  color: var(--on-dark-2);
}

.explo__name {
  display: grid;
  gap: 0.8rem;
  max-width: 26rem;
  margin-top: 2.4rem;
}

.explo__name label {
  font-family: var(--serif);
  font-size: 1.3rem;
}

.explo input[type="text"] {
  width: 100%;
  min-height: 3.2rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(227, 231, 226, 0.35);
  border-radius: 3px;
  background: rgba(227, 231, 226, 0.06);
  color: var(--on-dark);
  font: inherit;
}

.explo input[type="text"]::placeholder {
  color: rgba(227, 231, 226, 0.5);
}

.explo input[type="text"]:focus {
  border-color: var(--ember);
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}

.explo__care {
  max-width: 52ch;
  margin-top: 2.6rem;
  padding-top: 1.3rem;
  border-top: 1px solid var(--line-dark);
  font-size: 0.92rem;
  color: var(--on-dark-2);
}

/* ---------- Paneles (conversación y resumen) ---------- */
.explo__panel {
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: rgba(23, 42, 36, 0.86);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.explo__chat {
  display: flex;
  flex-direction: column;
  height: min(78vh, 46rem);
  height: min(78svh, 46rem);
}

.explo__head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line-dark);
}

.explo__head img {
  width: auto;
  height: 32px;
}

.explo__head strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.2;
}

.explo__head span {
  font-size: 0.88rem;
  color: var(--on-dark-2);
}

.explo__progress {
  padding: 0.8rem 1.2rem 0;
}

.explo__track {
  height: 2px;
  background: rgba(224, 169, 78, 0.25);
}

#progress-fill {
  width: 0;
  height: 100%;
  background: var(--ember);
  transition: width 0.6s var(--ease);
}

#progress-label {
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
  text-align: right;
  color: var(--on-dark-2);
}

#messages-area {
  flex: 1;
  padding: 1.2rem;
  overflow-y: auto;
}

.msg {
  display: flex;
  gap: 0.7rem;
  margin-bottom: 1.1rem;
}

.msg--user {
  justify-content: flex-end;
}

.msg__avatar {
  flex: none;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0.35rem;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  object-fit: contain;
}

.bubble {
  max-width: 84%;
  padding: 0.9rem 1.1rem;
  border-radius: 4px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.msg--assistant .bubble {
  border: 1px solid var(--line-dark);
  background: rgba(227, 231, 226, 0.06);
}

.msg--user .bubble {
  background: var(--ember);
  color: var(--forest);
}

.bubble.typing-cursor::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--ember);
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.typing {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
}

.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ember);
  animation: dot 1.4s ease-in-out infinite;
}

.typing i:nth-child(2) {
  animation-delay: 0.2s;
}

.typing i:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dot {
  0%,
  80%,
  100% {
    opacity: 0.25;
  }
  40% {
    opacity: 1;
  }
}

.explo__continue {
  margin: 1.8rem 0 0.4rem;
  text-align: center;
}

.explo__form {
  display: flex;
  gap: 0.6rem;
  padding: 1rem 1.2rem;
  border-top: 1px solid var(--line-dark);
}

.explo__form input {
  flex: 1;
}

#send-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: var(--ember);
  color: var(--forest);
  cursor: pointer;
  transition: background-color 0.25s;
}

#send-btn:hover:not(:disabled) {
  background: #ecbb6b;
}

#send-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#send-btn svg {
  width: 1.4rem;
  height: 1.4rem;
}

.spinner {
  width: 1.2rem;
  height: 1.2rem;
  border: 2px solid rgba(14, 25, 23, 0.3);
  border-top-color: var(--forest);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ---------- Resumen ---------- */
.explo__summary {
  padding: clamp(1.6rem, 5vw, 2.8rem);
}

.explo__summary h2 {
  margin-bottom: 1.6rem;
  font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.8rem);
}

.sum {
  padding-block: 1.3rem;
  border-top: 1px solid var(--line-dark);
}

.sum h3 {
  margin-bottom: 0.5rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ember);
}

.sum p {
  color: var(--on-dark-2);
}

.sum p.sum__session {
  margin-bottom: 0.6rem;
  font-family: var(--serif);
  font-size: 1.7rem;
  line-height: 1.2;
  color: var(--ember);
}

.sum__fallback {
  padding-block: 1.3rem;
  border-top: 1px solid var(--line-dark);
  color: var(--on-dark-2);
}

.explo__summary .actions {
  margin-top: 1.8rem;
}

/* ---------- Aviso de sesión guardada ---------- */
#session-toast {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 1rem;
  width: min(92%, 24rem);
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: var(--night);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  transform: translateX(-50%);
  font-size: 0.95rem;
}

#session-toast button {
  flex: none;
  padding: 0.5rem 0.9rem;
  border: 0;
  border-radius: 3px;
  background: var(--ember);
  color: var(--forest);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 560px) {
  .explo {
    padding-top: 6.5rem;
  }

  .bubble {
    max-width: 92%;
  }

  .msg__avatar {
    display: none;
  }
}
