/* estasmuerto.site — estilos del formulario y oráculo */

.form-page{
  min-height: calc(100vh - 150px);
  padding: 40px 0 80px;
}

.form-wrapper{
  max-width: 680px;
  margin: 0 auto;
  background: rgba(18, 10, 11, 0.7);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: clamp(24px, 5vw, 44px);
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 40px rgba(122, 13, 18, 0.12);
}

/* Barra de progreso y pasos */
.form-progress{
  margin-bottom: 34px;
}
.progress-meta{
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--bone-dim);
  margin-bottom: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.progress-meta .step-current{
  color: var(--blood-bright);
  font-weight: 600;
}
.progress-bar-track{
  height: 3px;
  background: rgba(147, 128, 124, 0.15);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.progress-bar-fill{
  height: 100%;
  width: 25%;
  background: linear-gradient(90deg, var(--blood-deep), var(--blood-bright));
  box-shadow: 0 0 10px rgba(179, 19, 26, 0.8);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Encabezado del paso actual */
.step-header{
  margin-bottom: 30px;
}
.step-header .step-kicker{
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--blood-bright);
  text-transform: uppercase;
  margin: 0 0 8px;
}
.step-header h2{
  font-family: "Fraunces", serif;
  font-weight: 440;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  line-height: 1.15;
  margin: 0 0 10px;
  color: var(--bone);
}
.step-header p{
  color: var(--bone-dim);
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0;
}

/* Paneles de pasos */
.form-step{
  display: none;
  animation: fadeInStep 0.35s ease forwards;
}
.form-step.active{
  display: block;
}

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

/* Campos de entrada estándar */
.field-group{
  margin-bottom: 26px;
}
.field-group:last-child{
  margin-bottom: 0;
}
.field-label{
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--bone);
  margin-bottom: 8px;
}
.field-hint{
  display: block;
  font-size: 0.76rem;
  color: var(--bone-dim);
  margin-top: 5px;
}

.input-text,
.input-select{
  width: 100%;
  background: rgba(14, 7, 8, 0.94);
  border: 2px solid #dc2743;
  border-radius: 4px;
  padding: 13px 16px;
  color: var(--bone);
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6), 0 0 12px rgba(220, 39, 67, 0.3);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.input-text:hover,
.input-select:hover{
  border-color: #ff2a3b;
  background: rgba(20, 10, 12, 0.96);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6), 0 0 16px rgba(255, 42, 59, 0.4);
}

.input-text:focus,
.input-select:focus{
  border-color: #ff3344;
  background: rgba(24, 11, 13, 0.98);
  box-shadow: 0 0 0 3px rgba(255, 42, 59, 0.35), 0 0 24px rgba(255, 42, 59, 0.55);
}

.input-text[type="date"]::-webkit-calendar-picker-indicator{
  filter: invert(0.85) sepia(100%) saturate(300%) hue-rotate(310deg);
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.2s, filter 0.2s;
}
.input-text[type="date"]::-webkit-calendar-picker-indicator:hover{
  opacity: 1;
  filter: invert(0.95) sepia(100%) saturate(600%) hue-rotate(320deg);
}

.input-select{
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23dc2743' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}
.input-select option{
  background: #170c0d;
  color: var(--bone);
}

/* Tarjetas de opciones seleccionables (Radio Cards) */
.options-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 8px;
}
.options-grid.grid-2{
  grid-template-columns: repeat(2, 1fr);
}

.option-card{
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(18, 9, 10, 0.85);
  border: 2px solid rgba(220, 39, 67, 0.75);
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 10px rgba(220, 39, 67, 0.2);
  transition: all 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.option-card:hover{
  border-color: #ff2a3b;
  background: rgba(28, 13, 15, 0.92);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 18px rgba(255, 42, 59, 0.4);
  transform: translateY(-1px);
}

.option-card input[type="radio"]{
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.option-card .custom-radio{
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid #dc2743;
  border-radius: 50%;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.option-card .custom-radio::after{
  content: "";
  width: 9px;
  height: 9px;
  background: #ff2a3b;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.4);
  transition: all 0.2s ease;
}

.option-card.selected{
  border-color: #ff2a3b;
  background: linear-gradient(135deg, rgba(160, 20, 28, 0.45), rgba(85, 8, 12, 0.55));
  box-shadow: 0 0 22px rgba(255, 42, 59, 0.45), inset 0 0 14px rgba(220, 39, 67, 0.3);
}

.option-card.selected .custom-radio{
  border-color: #ff2a3b;
  box-shadow: 0 0 10px rgba(255, 42, 59, 0.7);
}

.option-card.selected .custom-radio::after{
  opacity: 1;
  transform: scale(1);
}

.option-text{
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.option-title{
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--bone);
}
.option-desc{
  font-size: 0.78rem;
  color: var(--bone-dim);
  line-height: 1.35;
}

/* Errores y validación */
.field-error-msg{
  display: none;
  font-size: 0.78rem;
  color: #ff6b72;
  margin-top: 6px;
}
.field-group.has-error .field-error-msg{
  display: block;
}
.field-group.has-error .input-text,
.field-group.has-error .input-select{
  border-color: #ff3344 !important;
  box-shadow: 0 0 0 3px rgba(255, 51, 68, 0.25), 0 0 14px rgba(255, 51, 68, 0.35) !important;
}
.field-group.has-error .option-card{
  border-color: rgba(255, 51, 68, 0.85) !important;
  box-shadow: 0 0 10px rgba(255, 51, 68, 0.25) !important;
}

/* Botones de navegación del formulario */
.form-actions{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  gap: 16px;
}

.btn-prev{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid rgba(147, 128, 124, 0.3);
  color: var(--bone-dim);
  padding: 13px 22px;
  font-size: 0.88rem;
  font-family: "Inter", sans-serif;
  font-weight: 500;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.2s ease;
}
.btn-prev:hover{
  color: var(--bone);
  border-color: var(--bone);
}

.btn-next,
.btn-submit{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, var(--blood-bright), var(--blood-deep));
  border: 1px solid rgba(233, 226, 218, 0.15);
  color: var(--bone);
  padding: 14px 28px;
  font-size: 0.92rem;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border-radius: 2px;
  box-shadow: 0 6px 25px rgba(122, 13, 18, 0.35);
  transition: all 0.2s ease;
  margin-left: auto;
}

.btn-next:hover,
.btn-submit:hover{
  background: linear-gradient(180deg, #c81820, var(--blood-bright));
  transform: translateY(-1px);
  box-shadow: 0 10px 32px rgba(179, 19, 26, 0.5);
}

.btn-next svg,
.btn-submit svg,
.btn-prev svg{
  width: 14px;
  height: 14px;
}

/* Enlace volver cabecera */
.header-back-link{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-family: "Inter", sans-serif;
  font-weight: 500;
  color: var(--bone);
  text-decoration: none;
  background: rgba(23, 12, 13, 0.7);
  border: 1px solid rgba(179, 19, 26, 0.35);
  padding: 8px 18px;
  border-radius: 30px;
  backdrop-filter: blur(8px);
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
.header-back-link svg{
  color: var(--blood-bright);
  transition: transform 0.2s ease;
}
.header-back-link:hover{
  color: #fff;
  border-color: var(--blood-bright);
  background: rgba(122, 13, 18, 0.35);
  box-shadow: 0 0 20px rgba(179, 19, 26, 0.35);
  transform: translateX(-2px);
}
.header-back-link:hover svg{
  transform: translateX(-3px);
}

/* Textarea y generador de epitafio */
.input-textarea{
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.epitaph-actions-row{
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.btn-random-epitaph{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(122, 13, 18, 0.3);
  border: 1.5px solid rgba(215, 35, 45, 0.6);
  color: var(--bone);
  padding: 10px 18px;
  font-size: 0.86rem;
  font-family: "Inter", sans-serif;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 8px rgba(179, 19, 26, 0.15);
  transition: all 0.2s ease;
}
.btn-random-epitaph:hover{
  background: rgba(179, 19, 26, 0.45);
  border-color: #ff2a3b;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 14px rgba(220, 39, 67, 0.35);
  transform: translateY(-1px);
}
.btn-random-epitaph svg{
  width: 16px;
  height: 16px;
  color: var(--blood-bright);
}

.btn-regen-epitaph{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid rgba(147, 128, 124, 0.3);
  color: var(--bone-dim);
  padding: 8px 14px;
  font-size: 0.8rem;
  font-family: "Inter", sans-serif;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-regen-epitaph:hover{
  color: var(--bone);
  border-color: var(--blood-bright);
}

.btn-clear-epitaph{
  background: none;
  border: none;
  color: var(--bone-dim);
  font-size: 0.8rem;
  font-family: "Inter", sans-serif;
  text-decoration: underline;
  cursor: pointer;
  padding: 6px 10px;
  transition: color 0.2s ease;
}
.btn-clear-epitaph:hover{
  color: #ff6b72;
}

@media(max-width: 768px){
  .input-text,
  .input-select,
  .input-textarea{
    border: 2px solid #e61927 !important;
    background: #110708 !important;
    box-shadow: 0 0 14px rgba(230, 25, 39, 0.38), inset 0 2px 4px rgba(0, 0, 0, 0.7) !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    opacity: 1 !important;
  }
  .input-text:focus,
  .input-select:focus,
  .input-textarea:focus{
    border-color: #ff2a3b !important;
    box-shadow: 0 0 0 3px rgba(255, 42, 59, 0.4), 0 0 20px rgba(255, 42, 59, 0.6) !important;
  }
  .option-card{
    border: 2px solid rgba(235, 35, 55, 0.88) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 12px rgba(230, 25, 39, 0.28) !important;
  }
  .option-card.selected{
    border-color: #ff2a3b !important;
    box-shadow: 0 0 24px rgba(255, 42, 59, 0.55), inset 0 0 14px rgba(220, 39, 67, 0.35) !important;
  }
}

@media(max-width: 640px){
  .options-grid.grid-2{
    grid-template-columns: 1fr;
  }
  .form-actions{
    flex-direction: column-reverse;
  }
  .btn-next,
  .btn-submit,
  .btn-prev{
    width: 100%;
    justify-content: center;
  }
}
