/* =========================================================================
   FEATURES SECTION REDESIGN (id="flexibel")
   Supports Variants: .features-layout-a (Default), .features-layout-b, .features-layout-c
   ========================================================================= */

/* --- Base Section Styles --- */
.flexibel-redesign {
    padding: 6rem 2rem;
    position: relative;
    background: #0f0f23;
    /* Consistent dark base */
    overflow: hidden;
}

/* Background elements */
.flexibel-redesign::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 60%);
    filter: blur(80px);
    z-index: 0;
}

.flexibel-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.flexibel-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.flexibel-tag {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #a5b4fc;
    margin-bottom: 1rem;
}

.flexibel-header h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff 0%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.flexibel-header p {
    color: #cbd5e1;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* --- Card Styles (Base) --- */
.flex-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.flex-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(168, 85, 247, 0.4);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.flex-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(168, 85, 247, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.flex-card:hover::after {
    opacity: 1;
}

.card-icon-wrapper {
    width: 50px;
    height: 50px;
    background: rgba(15, 15, 35, 0.5);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.flex-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.flex-card p {
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

/* Highlighted Card Style */
.flex-card.highlight-card {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(147, 51, 234, 0.1) 100%);
    border-color: rgba(168, 85, 247, 0.3);
    position: relative;
    grid-column: span 2;
    /* Default span for layouts */
}

.flex-card.highlight-card .card-icon-wrapper {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
    border: none;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

/* --- Layout Variants --- */

/* Variant A: Freedom Highlight */
/* 
   - Top: 1 Large Hero Card
   - Bottom: Grid of remaining cards
*/
.features-layout-a .flexibel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.features-layout-a .highlight-card {
    grid-column: 1 / -1;
    /* Full width */
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 2.5rem;
}

.features-layout-a .highlight-card .card-icon-wrapper {
    width: 64px;
    height: 64px;
    font-size: 2rem;
    flex-shrink: 0;
}

.features-layout-a .highlight-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}


/* Variant B: Guided Grid */
/* 
   - Left: Text + Micro-flow
   - Right: Grid of cards
*/
.features-layout-b .flexibel-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    align-items: flex-start;
}

.features-layout-b .flexibel-header {
    text-align: left;
    margin: 0;
}

.features-layout-b .flexibel-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.features-layout-b .micro-flow {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.features-layout-b .flow-step {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.features-layout-b .step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.features-layout-b .step-text {
    font-weight: 500;
    color: #e2e8f0;
}

/* Variant C: Calm Confidence */
/* 
   - 3 Large horizontal cards
   - 3 lighter cards below
*/
.features-layout-c .flexibel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* First 3 items are standard cards, Bottom 3 (4,5,6) are lighter/minimal */
.features-layout-c .flex-card:nth-child(n+4) {
    background: transparent;
    border: none;
    padding: 1rem;
    box-shadow: none;
}

.features-layout-c .highlight-card {
    grid-column: span 1;
    /* Reset highlight span */
    /* Remove highlight specific styling if needed to match others, 
       or keep it as a 'special' one in the top row. 
       Let's keep it consistent with the "Horizontal" feel. */
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
}

.features-layout-c .highlight-card .card-icon-wrapper {
    /* Reset highlight icon style to normal if desired, or keep as accent */
}

/* Add visual divider between rows */
.features-layout-c .flexibel-grid::before {
    content: '';
    grid-column: 1 / -1;
    grid-row: 2;
    /* Place after first row */
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    margin: 1rem 0;
    display: none;
    /* Grid placing pseudo elements is tricky, let's use the nth-child properly */
}

/* Better divider approach: border-top on bottom items */
.features-layout-c .flex-card:nth-child(n+4) {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0;
}


/* --- Soft CTA Block --- */
.flexibel-cta-block {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
}

.cta-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.btn-soft-primary {
    background: #6366f1;
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 9999px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-soft-primary:hover {
    background: #4f46e5;
}

.link-soft-secondary {
    color: #a5b4fc;
    text-decoration: none;
    font-weight: 500;
}

.link-soft-secondary:hover {
    color: white;
    text-decoration: underline;
}

.reassurance-line {
    font-size: 0.9rem;
    color: #64748b;
}

/* --- Responsive --- */
@media (max-width: 900px) {

    .features-layout-a .flexibel-grid,
    .features-layout-b .flexibel-container,
    .features-layout-b .flexibel-grid,
    .features-layout-c .grid-row-top,
    .features-layout-c .grid-row-bottom {
        grid-template-columns: 1fr;
    }

    .features-layout-a .highlight-card {
        flex-direction: column;
        align-items: flex-start;
    }
}