/* ========================================
   Feature Explore Hub — Styles
   ======================================== */

/* Hero — centered text variant */
.fex-hero {
    text-align: center;
    padding-bottom: var(--section-py);
}

.fex-hero-inner {
    max-width: 780px;
    margin: 0 auto;
}

.fex-hero-title {
    font-size: 3.4rem;
    margin-bottom: 20px;
}

/* ========================================
   Feature Card Grid
   ======================================== */
.fex-grid-section {
    padding-top: calc(var(--section-py) / 2);
}

.fex-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.fex-card {
    display: flex;
    flex-direction: column;
    background: var(--color-bg-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 32px 28px 28px;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.fex-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 3px;
    background: var(--fex-accent);
    border-radius: 0 0 3px 3px;
    transition: left 0.35s ease, right 0.35s ease;
}

.fex-card:hover::before {
    left: 0;
    right: 0;
}

.fex-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.08);
    border-color: color-mix(in srgb, var(--fex-accent) 25%, transparent);
}

/* Icon */
.fex-card-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--fex-accent);
    background: color-mix(in srgb, var(--fex-accent) 10%, transparent);
    margin-bottom: 16px;
    transition: transform 0.3s ease;
}

.fex-card:hover .fex-card-icon {
    transform: scale(1.1);
}

/* Mini animation area */
.fex-card-anim {
    height: 90px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f5ff, #e8f0fe);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.fex-card h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text-dark);
    margin-bottom: 8px;
}

.fex-card p {
    font-size: 0.88rem;
    color: var(--color-text-light);
    line-height: 1.6;
    flex: 1;
}

.fex-card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-top: 16px;
    transition: gap var(--transition);
}

.fex-card:hover .fex-card-link {
    gap: 14px;
}

/* ========================================
   Mini Animations inside cards
   ======================================== */

/* 1. IMMI Forms: mini stacked cards */
.fex-mini-cards {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 20px;
    width: 100%;
    max-width: 200px;
}

.fex-mc {
    height: 18px;
    border-radius: 4px;
    background: #fff;
    border-left: 3px solid var(--mc-c);
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    opacity: 0;
    animation: fexMcSlide 0.5s ease both;
}

.fex-mc:nth-child(1) { animation-delay: 0.2s; }
.fex-mc:nth-child(2) { animation-delay: 0.4s; }
.fex-mc:nth-child(3) { animation-delay: 0.6s; }

@keyframes fexMcSlide {
    from { opacity: 0; transform: translateX(-12px); }
    to { opacity: 1; transform: translateX(0); }
}

/* 2. Customised Forms: mini builder bars */
.fex-mini-builder {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 20px;
    width: 100%;
    max-width: 200px;
}

.fex-mb-bar {
    height: 14px;
    border-radius: 4px;
    background: #fff;
    border: 1px solid #e2e8f0;
}

.fex-mb-bar.short { width: 65%; }

.fex-mb-bar.ghost {
    border: 2px dashed #4ade80;
    background: rgba(74, 222, 128, 0.06);
    animation: fexGhostPulse 2s ease-in-out infinite;
}

@keyframes fexGhostPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* 3. eSignature: mini signature path */
.fex-mini-sign {
    padding: 10px 20px;
    width: 100%;
    max-width: 200px;
}

.fex-ms-svg { width: 100%; height: auto; }

.fex-ms-path {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: fexSignDraw 2.5s ease forwards infinite;
}

@keyframes fexSignDraw {
    0% { stroke-dashoffset: 300; }
    60% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 0; }
}

/* 4. Conversation: mini chat bubbles */
.fex-mini-chat {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px 16px;
    width: 100%;
    max-width: 200px;
}

.fex-chat-b {
    height: 14px;
    border-radius: 8px;
    max-width: 110px;
}

.fex-cb-l { background: #f1f5f9; align-self: flex-start; width: 100px; }
.fex-cb-r { background: #639BF1; align-self: flex-end; width: 90px; }

.fex-cb-typing {
    background: #f1f5f9;
    width: 50px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.fex-cb-typing span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #94a3b8;
    animation: fexDot 1.2s ease-in-out infinite;
}

.fex-cb-typing span:nth-child(2) { animation-delay: 0.15s; }
.fex-cb-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes fexDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-3px); opacity: 1; }
}

/* 5. PDF Center: mini merge */
.fex-mini-pdf {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
}

.fex-pdf-p {
    font-size: 1.3rem;
    color: #ef4444;
}

.fex-pdf-arrow {
    font-size: 0.8rem;
    color: #639BF1;
    animation: fexArrowPulse 2s ease-in-out infinite;
}

@keyframes fexArrowPulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.1); }
}

.fex-pp1 { animation: fexPdfL 2.5s ease-in-out infinite; }
.fex-pp2 { animation: fexPdfR 2.5s ease-in-out infinite; }

@keyframes fexPdfL {
    0%, 30% { transform: translateX(0); }
    50%, 70% { transform: translateX(6px); }
    90%, 100% { transform: translateX(0); }
}

@keyframes fexPdfR {
    0%, 30% { transform: translateX(0); }
    50%, 70% { transform: translateX(-6px); }
    90%, 100% { transform: translateX(0); }
}

/* 6. File Center: mini file grid */
.fex-mini-files {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 10px 20px;
    width: 100%;
    max-width: 200px;
}

.fex-mf {
    background: #fff;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    border: 1px solid #f1f5f9;
    font-size: 1rem;
}

.fex-mf-drop {
    animation: fexFileDrop 2s 0.5s ease both infinite;
}

@keyframes fexFileDrop {
    0% { opacity: 0; transform: translateY(-10px); }
    20% { opacity: 1; transform: translateY(0); }
    80%, 100% { opacity: 1; transform: translateY(0); }
}

/* 8. Lex Nubes AI: mini chat */
.fex-mini-ai {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 20px;
    width: 100%;
    max-width: 200px;
}

.fex-ai-q {
    height: 14px;
    border-radius: 8px;
    background: #8b5cf6;
    width: 120px;
    align-self: flex-end;
    opacity: 0;
    animation: fexAiQ 0.4s 0.3s ease both;
}

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

.fex-ai-a {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    background: #f3f0ff;
    border-radius: 8px;
    opacity: 0;
    animation: fexAiA 0.4s 0.7s ease both;
}

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

.fex-ai-al { height: 5px; background: #ddd6fe; border-radius: 3px; }
.fex-ai-al.short { width: 55%; }

/* 9. CRM: mini client cards */
.fex-mini-crm {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
}

.fex-crm-c {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    position: relative;
    opacity: 0;
}

.fex-crm-c:nth-child(1) { animation: fexCrmIn 0.3s 0.2s ease both; }
.fex-crm-c:nth-child(2) { animation: fexCrmIn 0.3s 0.4s ease both; }
.fex-crm-c:nth-child(3) { animation: fexCrmIn 0.3s 0.6s ease both; }

@keyframes fexCrmIn { from { opacity:0; transform:scale(0.8); } to { opacity:1; transform:scale(1); } }

.fex-crm-c::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg,#639BF1,#4F7BF7);
}

.fex-crm-c::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    height: 4px;
    border-radius: 2px;
    background: #e8edf5;
}

/* 10. Elodgement Extension: mini progress bar */
.fex-mini-autofill {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 20px;
    width: 100%;
    max-width: 200px;
    align-items: center;
}

.fex-af-bar {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
}

.fex-af-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg,#10b981,#059669);
    border-radius: 5px;
    animation: fexAfFill 2.5s 0.5s ease-in-out forwards;
}

@keyframes fexAfFill { to { width: 65%; } }

.fex-af-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: #10b981;
}

/* ========================================
   FAQ (Explore hub)
   ======================================== */
.fex-faq-section {
    padding-top: calc(var(--section-py) / 2);
    padding-bottom: calc(var(--section-py) / 2);
}

.fex-faq-title {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--color-text-primary, #1a1a2e);
}

.fex-faq-list {
    max-width: 720px;
    margin: 0 auto;
}

.fex-faq-item {
    border: 1px solid var(--color-border-light, #e8ecf4);
    border-radius: var(--radius-lg, 12px);
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background: var(--color-bg-white, #fff);
}

.fex-faq-item summary {
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

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

.fex-faq-item p {
    margin: 0.75rem 0 0.25rem;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--color-text-secondary, #4a5568);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
    .fex-hero-title { font-size: 2.8rem; }
    .fex-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .fex-hero-title { font-size: 2.2rem; }
    .fex-grid { grid-template-columns: 1fr; max-width: 440px; margin: 0 auto; }
}

@media (max-width: 480px) {
    .fex-hero-title { font-size: 1.8rem; }
}
