/* Custom styles for Soland Landing Page - Iperammortamento 2026 */

:root {
    /* Strong custom easings (Emil Kowalski / animations.dev) */
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom classes for typography and layout */
.font-heading {
    font-family: 'Gemunu Libre', sans-serif;
}

/* Transitions for mobile menu */
#mobile-menu {
    transition: all 0.3s ease-in-out;
}

/* Prose-like styles for content */
.prose p {
    line-height: 1.75;
}

/* Hover effects for cards */
.hover\:-translate-y-2:hover {
    transform: translateY(-0.5rem);
}

.via-gray-900\/70 {
    --tw-gradient-stops: rgb(38 46 63 / 90%), rgb(13 19 30 / 70%) var(--tw-gradient-via-position), var(--tw-gradient-to);
}

/* Privacy Checkbox Style */
.privacy-container {
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.privacy-container input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #ea580c;
    /* Soland Orange */
    border-radius: 3px;
    background-color: transparent;
    cursor: pointer;
    display: grid;
    place-content: center;
    flex-shrink: 0;
    margin-top: 0;
}

.privacy-container input[type="checkbox"]:checked {
    background-color: #ea580c;
    /* Soland Orange */
}

.privacy-container input[type="checkbox"]::before {
    content: "";
    width: 14px;
    height: 14px;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    background-color: white;
    /* Checkmark white on orange bg */
}

.privacy-container input[type="checkbox"]:checked::before {
    transform: scale(1);
}

.privacy-text {
    font-size: 0.85rem;
    color: #4b5563;
    /* Tailwind gray-600 */
    line-height: 1.4;
}

.privacy-text a {
    color: #ea580c;
    /* Soland Orange */
    text-decoration: underline;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: sticky;
    top: 0;
    float: right;
    font-size: 30px;
    cursor: pointer;
    color: #ea580c;
    /* Soland Orange */
    line-height: 20px;
}

.modal-body h3 {
    color: #ea580c;
    /* Soland Orange */
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-body h4 {
    color: #1f2937;
    /* Tailwind gray-800 */
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.modal-body p {
    margin-bottom: 15px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #4b5563;
    /* Tailwind gray-600 */
}

.modal-content ul {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #4b5563;
    /* Tailwind gray-600 */
    list-style: disc;
    padding-left: 20px;
    margin-bottom: 15px;
}

body.modal-open {
    overflow: hidden;
}

/* Feedback Messages */
#form-response-message {
    display: none;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
    text-align: center;
}

.success-msg {
    background: #10b981;
    color: white;
}

.error-msg {
    background: #ef4444;
    color: white;
}

/* Inline field error (client-side validation) */
.field-error {
    border-color: #ef4444 !important;
}

.field-error-msg {
    color: #ef4444;
    font-size: 0.78rem;
    margin-top: 0.25rem;
}


.post-cta {
    max-width: 500px !important;
    font-weight: 800;
}

.h-2.w-2.bg-primary.rounded-full.mr-3 {
    width: 10px;
    height: 10px;
    display: block;
    min-width: 10px;
    align-self: flex-start;
    margin-top: 6px;
}



.pre-form .text-base {
    line-height: 1.2rem;
    font-weight: 600;
}

.privacy-container {
    align-items: flex-start;
}

.privacy-container input[type="checkbox"] {
    width: 22px;
    height: 22px;
}

.h-1\.5 {
    height: 0.250rem !important;
}

@media (min-width: 768px) {
    .md\:text-2xl {
        font-size: 1.3rem !important;
        line-height: 1.8rem;
    }
}


/* ============================================================
   ANIMATIONS & MICRO-INTERACTIONS
   ============================================================ */

/* Button press feedback */
.btn-press {
    transition: transform 160ms var(--ease-out), background-color 200ms ease, box-shadow 200ms ease;
}

.btn-press:active {
    transform: scale(0.97);
}

/* Scroll reveal */
[data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
    will-change: opacity, transform;
}

[data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

/* Animated result numbers: tabular figures stop the layout from jiggling */
#invest-display,
#result-total-saving,
#result-deductible,
#result-yearly,
#result-additional {
    font-variant-numeric: tabular-nums;
}

#result-rate-badge {
    transition: background-color 250ms var(--ease-out);
}


/* ============================================================
   CONFIGURATOR
   ============================================================ */

.config-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #e5e7eb;
    outline: none;
    cursor: pointer;
}

.config-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #ea580c;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 120ms var(--ease-out), box-shadow 120ms var(--ease-out);
}

.config-range::-moz-range-thumb {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #ea580c;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 120ms var(--ease-out);
}

.config-range:active::-webkit-slider-thumb {
    transform: scale(1.12);
}

.config-range:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 5px rgba(234, 88, 12, 0.3);
}

.config-range:focus-visible::-moz-range-thumb {
    box-shadow: 0 0 0 5px rgba(234, 88, 12, 0.3);
}

.preset-chip {
    padding: 0.65rem 0.5rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 0.65rem;
    background: #ffffff;
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
    cursor: pointer;
    transition: border-color 150ms var(--ease-out), background-color 150ms var(--ease-out), color 150ms var(--ease-out), transform 150ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
    .preset-chip:hover {
        border-color: #fdba74;
        color: #ea580c;
    }
}

.preset-chip.is-active {
    border-color: #ea580c;
    background: #fff7ed;
    color: #ea580c;
}

.preset-chip:active {
    transform: scale(0.97);
}

/* Result stat boxes: horizontal scroll on mobile */
.config-stats {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.config-stats::-webkit-scrollbar {
    height: 6px;
}

.config-stats::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
}

/* Maggiorazione "pop" when the scaglione changes */
#result-rate-badge {
    display: inline-block;
}

@keyframes ratePop {
    0% { transform: scale(1); }
    30% { transform: scale(1.18); }
    100% { transform: scale(1); }
}

.rate-pop {
    animation: ratePop 350ms var(--ease-out);
}


/* ============================================================
   TIMELINE (iter)
   ============================================================ */

.timeline {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: none;
}

.timeline-step {
    background: #ffffff;
    border: 1px solid #f3f4f6;
    border-radius: 1rem;
    padding: 1.5rem 1.25rem;
}

.timeline-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background: #ea580c;
    color: #ffffff;
    font-family: 'Gemunu Libre', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 0.85rem;
    box-shadow: 0 4px 10px rgba(234, 88, 12, 0.3);
}


/* ============================================================
   FAQ (accordion)
   ============================================================ */

.faq-item {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #ffffff;
    transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}

.faq-item[open] {
    border-color: #fdba74;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.faq-item summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: #1f2937;
    font-size: 1.05rem;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary:hover {
    color: #ea580c;
}

.faq-icon {
    color: #ea580c;
    flex-shrink: 0;
    transition: transform 200ms var(--ease-out);
}

.faq-item[open] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 1.5rem 1.35rem;
    color: #4b5563;
    line-height: 1.7;
}

.faq-item[open] .faq-answer {
    animation: faqReveal 250ms var(--ease-out);
}

@keyframes faqReveal {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}


/* ============================================================
   RESPONSIVE TWEAKS (from Agrisolare base)
   ============================================================ */

@media (max-width: 768px) {
    .absolute.inset-0.md\:bg-gradient-to-r.md\:from-gray-900\/90.md\:via-gray-900\/70.md\:to-transparent {
        background: linear-gradient(191deg, rgba(0, 0, 0, 0) 24.18%, #111827e6 57.47%) !important;
        opacity: 0.80 !important;
    }

    .min-h-screen {
        min-height: 122vh !important;
    }

    /* Hero: testo ancorato in basso, parte alta del visual libera (come Agrisolare) */
    .hero-content {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    .hero img.object-cover {
        object-position: center !important;
    }

    .grid-cols-2 {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }

    footer .flex {
        display: flex;
        width: 100%;
    }
}


/* ============================================================
   ACCESSIBILITY: reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    [data-reveal] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .btn-press,
    .faq-icon,
    .config-range::-webkit-slider-thumb,
    .preset-chip {
        transition: none !important;
    }

    .faq-item[open] .faq-answer {
        animation: none !important;
    }

    .animate-pulse,
    .rate-pop {
        animation: none !important;
    }
}
