/* Feudo Sondaggio — frontend
   Allineato all'estetica editoriale di feudostagnone.it */

/* Hide theme sidebars on the survey page, full width */
body.feudo-sondaggio-page .sidebar.widget_area,
body.feudo-sondaggio-page aside.widget-area,
body.feudo-sondaggio-page #secondary { display: none !important; }
body.feudo-sondaggio-page .content_wrap,
body.feudo-sondaggio-page .content_wrap > .content,
body.feudo-sondaggio-page .content { width: 100% !important; max-width: 100% !important; padding-right: 0 !important; }
body.feudo-sondaggio-page .post_content,
body.feudo-sondaggio-page article.post_item { width: 100% !important; }

/* Hide the site header (navbar) on the survey page — keep the footer.
   .top_panel = ThemeREX/fermentio header; the others cover common themes. */
body.feudo-sondaggio-page .top_panel,
body.feudo-sondaggio-page .site-header,
body.feudo-sondaggio-page .elementor-location-header { display: none !important; }

.feudo-sond {
    --fs-bg: #FFF8EE;
    --fs-bg-alt: #FFF3E3;
    --fs-text: #2B2626;
    --fs-text-soft: #5A5A67;
    --fs-line: rgba(43, 38, 38, 0.12);
    --fs-accent: #6B1F2A;
    --fs-gold: #C9A961;
    --fs-font-serif: alga, "DM Serif Display", "Cormorant Garamond", Georgia, serif;
    --fs-font-sans: "DM Sans", system-ui, -apple-system, sans-serif;

    background: var(--fs-bg);
    color: var(--fs-text);
    font-family: var(--fs-font-sans);
    padding: clamp(1rem, 3vw, 2.5rem) clamp(1rem, 4vw, 3rem) clamp(3rem, 8vw, 6rem);
    min-height: 80vh;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}
.feudo-sond *, .feudo-sond *::before, .feudo-sond *::after { box-sizing: border-box; }

.feudo-sond__inner {
    max-width: 620px;
    margin: 0 auto;
    position: relative;
}

/* Language visibility */
.feudo-sond .lang-en { display: none; }
.feudo-sond.is-lang-en .lang-it { display: none; }
.feudo-sond.is-lang-en .lang-en { display: inline; }

/* Language toggle */
.feudo-sond-lang-toggle {
    position: absolute;
    top: 0; right: 0;
    display: inline-flex;
    border: 1px solid var(--fs-line);
    border-radius: 999px;
    overflow: hidden;
}
.feudo-lang-btn {
    background: transparent;
    border: 0;
    padding: 0.35rem 0.85rem;
    font-family: var(--fs-font-sans);
    font-size: 0.8rem;
    letter-spacing: 1px;
    color: var(--fs-text-soft);
    cursor: pointer;
}
.feudo-lang-btn.is-active { background: var(--fs-text); color: var(--fs-bg); }

.feudo-sond__logo {
    display: block;
    margin: 1.5rem auto 1.75rem;
    width: 96px;
    max-width: 26vw;
    height: auto;
}

.feudo-sond__kicker {
    font-family: var(--fs-font-serif);
    font-size: 0.85rem;
    letter-spacing: 1.9px;
    text-transform: uppercase;
    color: var(--fs-text);
    text-align: center;
    margin: 0 0 1rem;
    font-weight: 500;
}
.feudo-sond__headline {
    font-family: var(--fs-font-serif);
    font-size: clamp(2.1rem, 7vw, 3rem);
    line-height: 1.06;
    color: var(--fs-text);
    text-align: center;
    margin: 0 0 1rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}
.feudo-sond__sub {
    color: var(--fs-text-soft);
    font-size: 1rem;
    line-height: 1.55;
    text-align: center;
    max-width: 44ch;
    margin: 0 auto 2.5rem;
}

/* Steps */
.feudo-sond-step { display: none; animation: feudo-fade .45s ease both; }
.feudo-sond-step.is-active { display: block; }
@keyframes feudo-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Question block */
.feudo-sond-q {
    margin: 0 0 2.25rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--fs-line);
}
.feudo-sond-q__text {
    font-family: var(--fs-font-serif);
    font-size: 1.22rem;
    line-height: 1.35;
    color: var(--fs-text);
    margin: 0 0 1.1rem;
}
.feudo-sond-q__num { color: var(--fs-accent); margin-right: 0.25rem; }

/* Rating segments */
.feudo-sond-rating {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}
.feudo-seg {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    border: 1px solid var(--fs-line);
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s ease;
    background: #fff;
}
.feudo-seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.feudo-seg__num {
    font-family: var(--fs-font-sans);
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--fs-text);
}
.feudo-seg:hover { border-color: var(--fs-accent); }
.feudo-seg:has(input:checked) {
    background: var(--fs-accent);
    border-color: var(--fs-accent);
}
.feudo-seg:has(input:checked) .feudo-seg__num { color: var(--fs-bg); }
.feudo-seg input:focus-visible + .feudo-seg__num { outline: 2px solid var(--fs-gold); outline-offset: 4px; }

.feudo-sond-rating__ends {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.72rem;
    letter-spacing: 0.3px;
    color: var(--fs-text-soft);
    text-transform: uppercase;
}
.feudo-sond-q__chosen {
    margin-top: 0.6rem;
    min-height: 1.1em;
    font-size: 0.92rem;
    color: var(--fs-accent);
    font-style: italic;
}
.feudo-sond-q.is-error .feudo-sond-rating { outline: 2px solid var(--fs-accent); outline-offset: 6px; border-radius: 10px; }

/* Comment field */
.feudo-sond-field { margin: 0 0 1.5rem; display: flex; flex-direction: column; }
.feudo-sond-field__label {
    font-family: var(--fs-font-serif);
    font-size: 1.15rem;
    color: var(--fs-text);
    margin-bottom: 0.6rem;
}
.feudo-sond-field textarea {
    background: #fff;
    border: 1px solid var(--fs-line);
    border-radius: 8px;
    padding: 0.8rem;
    font-family: var(--fs-font-sans);
    font-size: 1rem;
    color: var(--fs-text);
    resize: vertical;
    width: 100%;
}
.feudo-sond-field textarea:focus { outline: none; border-color: var(--fs-accent); }

/* Honeypot */
.feudo-sond-hp { position: absolute !important; left: -9999px; top: -9999px; opacity: 0; pointer-events: none; }

.feudo-sond-privacy {
    font-size: 0.82rem;
    color: var(--fs-text-soft);
    line-height: 1.45;
    margin: 0 0 1rem;
}

/* Button (matches feudo-estrazione) */
.feudo-sond .feudo-btn,
.feudo-sond button.feudo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2B2626 !important;
    color: #FFF8EE !important;
    font-family: var(--fs-font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 1.05rem 2rem;
    border: 1px solid #2B2626 !important;
    border-radius: 6px;
    cursor: pointer;
    transition: all .2s ease;
    width: 100%;
    text-decoration: none;
    box-shadow: none !important;
}
.feudo-sond .feudo-btn:hover { background: #6B1F2A !important; border-color: #6B1F2A !important; color: #FFF8EE !important; }
.feudo-sond .feudo-btn:active { transform: translateY(1px); }
.feudo-sond .feudo-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.feudo-sond-submit { margin-top: 2.5rem; }

.feudo-sond-error {
    background: #fdecea;
    border: 1px solid #e7a8a0;
    color: #6e1d12;
    padding: 0.9rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    margin: 0 0 1rem;
    display: none;
}
.feudo-sond-error.is-active { display: block; }

.feudo-sond-thanks { text-align: center; padding: 2rem 0; }
.feudo-closed { text-align: center; padding: 3rem 1rem; }

@media (prefers-reduced-motion: reduce) { .feudo-sond-step { animation: none; } }
