/* Custom EA — sondaggio preventivo */
.cea-survey {
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: rgba(5, 5, 5, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.cea-survey.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cea-survey__panel {
  width: min(560px, 100%);
  max-height: min(860px, calc(100dvh - 2rem));
  display: flex;
  flex-direction: column;
  border-radius: 1.15rem;
  border: 1px solid rgba(255, 215, 0, 0.28);
  background:
    linear-gradient(165deg, rgba(255, 215, 0, 0.07) 0%, transparent 42%),
    linear-gradient(180deg, #171717 0%, #0d0d0d 100%);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55), 0 0 40px rgba(255, 215, 0, 0.08);
  overflow: hidden;
  transform: translateY(18px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.cea-survey.is-open .cea-survey__panel {
  transform: none;
}

.cea-survey__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.25rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cea-survey__eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 215, 0, 0.75);
}

.cea-survey__title {
  margin: 0;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
}

.cea-survey__close {
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  margin: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 215, 0, 0.28);
  background: rgba(255, 255, 255, 0.04);
  color: #ffd700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.cea-survey__close svg {
  display: block;
  flex-shrink: 0;
}

.cea-survey__progress {
  display: flex;
  gap: 0.35rem;
  padding: 0.85rem 1.25rem 0;
}

.cea-survey__dot {
  flex: 1;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.cea-survey__dot.is-done,
.cea-survey__dot.is-active {
  background: #ffd700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.35);
}

.cea-survey__body {
  padding: 1.25rem 1.25rem 0.5rem;
  overflow: auto;
  flex: 1 1 auto;
}

.cea-survey__step {
  display: none;
  animation: cea-step-in 0.32s ease both;
}

.cea-survey__step.is-active {
  display: block;
}

@keyframes cea-step-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.cea-survey__q {
  margin: 0 0 0.85rem;
  color: #f5f5f5;
  font-size: 1.2rem;
  font-weight: 650;
  line-height: 1.35;
}

.cea-survey__hint {
  margin: -0.35rem 0 1rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.88rem;
}

.cea-survey__hint.cea-survey__phone-warn {
  margin-top: 0.85rem;
  color: rgba(255, 215, 0, 0.78);
  line-height: 1.45;
}

.cea-survey__legal {
  margin-top: 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 215, 0, 0.2);
  background: rgba(255, 215, 0, 0.05);
  display: grid;
  gap: 0.65rem;
}

.cea-survey__legal-item {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.84rem;
  line-height: 1.45;
}

.cea-survey__legal-item strong {
  color: rgba(255, 215, 0, 0.9);
  font-weight: 650;
}

.cea-survey__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 520px) {
  .cea-survey__row {
    grid-template-columns: 1fr;
  }
}

.cea-survey__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.cea-survey__field label {
  color: rgba(255, 215, 0, 0.8);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cea-survey__field input,
.cea-survey__field textarea,
.cea-survey__field select {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 215, 0, 0.22);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  padding: 0.8rem 0.95rem;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-text-fill-color: #fff;
  caret-color: #ffd700;
}

.cea-survey__field input:-webkit-autofill,
.cea-survey__field input:-webkit-autofill:hover,
.cea-survey__field input:-webkit-autofill:focus,
.cea-survey__field textarea:-webkit-autofill,
.cea-survey__field select:-webkit-autofill {
  -webkit-text-fill-color: #fff !important;
  caret-color: #ffd700;
  box-shadow: 0 0 0 1000px #141414 inset !important;
  transition: background-color 99999s ease-out;
}

.cea-survey__field textarea {
  min-height: 11rem;
  resize: vertical;
  line-height: 1.5;
}

.cea-survey__field input:focus,
.cea-survey__field textarea:focus,
.cea-survey__field select:focus {
  border-color: rgba(255, 215, 0, 0.7);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.12);
}

.cea-survey__counter {
  text-align: right;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.8rem;
  margin-top: -0.4rem;
  margin-bottom: 0.8rem;
}

.cea-survey__counter.is-over {
  color: #ff6b6b;
}

.cea-survey__upload {
  border: 1px dashed rgba(255, 215, 0, 0.35);
  border-radius: 0.85rem;
  padding: 1rem;
  background: rgba(255, 215, 0, 0.04);
  cursor: pointer;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.cea-survey__upload:hover {
  border-color: rgba(255, 215, 0, 0.7);
  background: rgba(255, 215, 0, 0.08);
}

.cea-survey__upload input {
  display: none;
}

.cea-survey__previews {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.cea-survey__preview {
  position: relative;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 0.55rem;
  overflow: hidden;
  border: 1px solid rgba(255, 215, 0, 0.25);
}

.cea-survey__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cea-survey__preview button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 1.25rem;
  height: 1.25rem;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.75rem;
  cursor: pointer;
}

.cea-survey__choices {
  display: grid;
  gap: 0.55rem;
}

.cea-survey__choice {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.85rem 0.95rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  color: #f0f0f0;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.cea-survey__choice:hover {
  border-color: rgba(255, 215, 0, 0.45);
  transform: translateY(-1px);
}

.cea-survey__choice.is-selected {
  border-color: rgba(255, 215, 0, 0.85);
  background: rgba(255, 215, 0, 0.1);
  box-shadow: 0 0 0 1px rgba(255, 215, 0, 0.15);
}

.cea-survey__choice input {
  margin-top: 0.2rem;
  accent-color: #ffd700;
}

.cea-survey__phone {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.65rem;
}

.cea-survey__footer {
  display: flex;
  gap: 0.65rem;
  justify-content: space-between;
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cea-survey__btn {
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 215, 0, 0.35);
  padding: 0.72rem 1.15rem;
  font-weight: 650;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.cea-survey__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cea-survey__btn--ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
}

.cea-survey__btn--primary {
  background: linear-gradient(135deg, #ffd700, #c9a227);
  color: #111;
  border-color: transparent;
  margin-left: auto;
}

.cea-survey__btn--primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(255, 215, 0, 0.25);
}

.cea-survey__error {
  color: #ff8f8f;
  font-size: 0.88rem;
  min-height: 1.2rem;
  margin: 0.35rem 0 0;
}

.cea-survey__success {
  text-align: center;
  padding: 1.5rem 0.5rem 1rem;
}

.cea-survey__success h3 {
  color: #ffd700;
  margin-bottom: 0.75rem;
}

.cea-survey__success p {
  color: rgba(255, 255, 255, 0.7);
}
