/* Explain: Styles for UI components, animations, and layout polish. */
/* Homepage hero imagery: crossfade between insurance-type slides. */
.hero-slide {
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.5s ease-in-out, visibility 1.5s;
    z-index: 0;
}

.hero-slide.is-active {
    opacity: 1;
    visibility: visible;
    transition: opacity 1.5s ease-in-out, visibility 0s;
    z-index: 1;
}

/* Gold-rimmed shadow that follows the leaf silhouette of the hero visual. */
.hero-leaf-shadow {
    filter: drop-shadow(0 0 3px var(--accent-color)) drop-shadow(0 24px 45px rgba(0, 0, 0, 0.28));
}

/* Featured-cover label on the hero: cross-fade the cover name so it changes
   smoothly as the rotating slides advance, instead of snapping between names. */
.hero-featured-label {
    transition: opacity 300ms ease;
}

.hero-featured-label.is-swapping {
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    .hero-featured-label {
        transition: none;
    }
}

/* Pure CSS organic shape: replaces the external image mask 
   that was failing to load, guaranteeing the photos are always visible. */
.hero-leaf-frame {
    border-radius: 50% 50% 50% 70% / 50% 50% 70% 60% !important;
    overflow: hidden !important;
    animation: blobMorph 12s infinite alternate ease-in-out !important;
}

@keyframes blobMorph {
    0% { border-radius: 50% 50% 50% 70% / 50% 50% 70% 60%; }
    33% { border-radius: 60% 40% 60% 40% / 60% 40% 60% 40%; }
    66% { border-radius: 40% 60% 40% 60% / 40% 60% 40% 60%; }
    100% { border-radius: 50% 50% 70% 50% / 50% 50% 60% 70%; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-slide {
        transition: none;
    }
    .hero-leaf-frame {
        animation: none !important;
    }
}

/* ==========================================================================
   UNIFIED INTERACTION STATES (Cards, Links, Buttons)
   ========================================================================== */

.btn,
[class*="hover:-translate-y-"] {
    transition: all 400ms cubic-bezier(0.2, 0.8, 0.2, 1) !important;
    transform-origin: center !important;
}

.btn:not(.btn-ghost):not(.btn-outline):not(.btn-link):hover,
[class*="hover:-translate-y-"]:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
}

.btn.btn-ghost:hover,
.btn.btn-outline:hover,
.btn.btn-link:hover {
    transform: translateY(-2px) !important;
    box-shadow: none !important;
}

.btn:active,
[class*="hover:-translate-y-"]:active {
    transform: translateY(-1px) scale(0.98) !important;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.05) !important;
}

.btn:focus-visible,
[class*="hover:-translate-y-"]:focus-visible,
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--primary-color) !important;
    outline-offset: 4px !important;
}

/* Attention pulse for the floating "Become a Client" WhatsApp button. */
.wa-pulse::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55);
    animation: waPulse 2.4s infinite;
    pointer-events: none;
}

@keyframes waPulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55); }
    70% { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .wa-pulse::before {
        animation: none;
    }
}

/* Claims "Required Documents" accordion: animate the native <details> panel so
   the chevron and the content expand/collapse together instead of snapping. */
.doc-accordion .doc-accordion-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 350ms cubic-bezier(0.16, 1, 0.3, 1);
}

.doc-accordion[open] .doc-accordion-body {
    grid-template-rows: 1fr;
}

.doc-accordion .doc-accordion-body > * {
    overflow: hidden;
    min-height: 0;
}

@media (prefers-reduced-motion: reduce) {
    .doc-accordion .doc-accordion-body {
        transition: none;
    }
}

/* Mobile form polish: keep every quote / claims field, error line and action
   full-width with a comfortable tap target, and tuck the floating chat / WhatsApp
   controls away while a form field is focused so they can never cover what the
   visitor is typing or the submit button underneath. */
@media (max-width: 1023px) {
    #quoteForm .input,
    #quoteForm .select,
    #quoteForm .textarea,
    #claimForm .input,
    #claimForm .select,
    #claimForm .textarea {
        width: 100%;
        min-height: 2.75rem;
    }

    #quoteForm .textarea,
    #claimForm .textarea {
        min-height: 6rem;
    }

    #quoteForm [id$="Error"],
    #claimForm [id$="Error"] {
        width: 100%;
        overflow-wrap: anywhere;
    }

    /* Keep the quote form's action button the same height and width as the
       fields above it, so every control on mobile reads as one even stack. */
    #quoteForm button[type="submit"] {
        width: 100%;
        height: auto;
        min-height: 2.75rem;
        padding-top: 0;
        padding-bottom: 0;
    }

    /* Larger, easier-to-tap controls inside the claims attachments list. */
    #claimForm #claimChosenList button {
        min-width: 2.75rem;
        min-height: 2.75rem;
    }

    .js-fab-hide {
        transition: opacity 200ms ease, transform 200ms ease, visibility 200ms ease;
    }

    body.app-form-active .js-fab-hide {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(0.75rem);
    }
}

/* Arabic (RTL) form polish: align labels, group headings, fields, error lines
   and helper notes to the right inside the quote and claims forms so the
   Arabic layout reads cleanly. Everything is scoped to html[lang="ar"], so the
   English forms are left exactly as they are. */
html[lang="ar"] #quoteForm label,
html[lang="ar"] #claimForm label,
html[lang="ar"] #quoteForm h3,
html[lang="ar"] #claimForm h3,
html[lang="ar"] #quoteCoverHintText,
html[lang="ar"] #quoteForm [id$="Error"],
html[lang="ar"] #claimForm [id$="Error"],
html[lang="ar"] #quoteFormStatus,
html[lang="ar"] #claimFormStatus {
    text-align: right;
}

/* Fields, selects and textareas fill from the right in Arabic. */
html[lang="ar"] #quoteForm .input,
html[lang="ar"] #quoteForm .select,
html[lang="ar"] #quoteForm .textarea,
html[lang="ar"] #claimForm .input,
html[lang="ar"] #claimForm .select,
html[lang="ar"] #claimForm .textarea {
    text-align: right;
}

/* Email and phone fields carry Latin characters, so they keep their own
   left-to-right typing direction while still sitting in the RTL flow. */
html[lang="ar"] #quoteForm input[type="email"],
html[lang="ar"] #quoteForm input[type="tel"],
html[lang="ar"] #claimForm input[type="email"],
html[lang="ar"] #claimForm input[type="tel"] {
    direction: ltr;
    text-align: left;
}