/* ==========================================================================
   Components — buttons, cards, forms, modal, tables, chatbot
   ========================================================================== */

/* --- Badges --- */
.badge-wrapper { text-align: center; margin-bottom: var(--sp-4); }

/* The leading dot is what turns a label into a badge. */
.section-badge {
    background: linear-gradient(180deg, #f0f9ff, #e0f2fe);
    border: 1px solid rgba(3, 105, 161, 0.16);
    box-shadow: var(--el-lip), 0 1px 2px rgba(15, 23, 42, 0.04);
    color: var(--badge-text);
    padding: 6px 12px 6px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.section-badge::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.5;
    flex: none;
}

/* Section-header eyebrows — the editorial treatment. Quieter than a pill:
   bare letterspaced caps with a short amber rule. Card-level badges (work
   cards, dark CTA) are NOT inside .badge-wrapper and keep the pill above. */
.badge-wrapper .section-badge {
    background: none;
    border: 0;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
    /* --ink-4 fell below WCAG AA (~2.6:1) on the light surfaces this renders
       on; --ink-3 clears 4.5:1 while staying visually "quiet". */
    color: var(--ink-3);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
}
.badge-wrapper .section-badge::before {
    width: 20px; height: 2px;
    border-radius: 2px;
    background: var(--amber);
    opacity: 0.9;
}

/* Eyebrow on the dark CTA banner still needs to read on navy. */
.badge-wrapper .section-badge.is-on-dark {
    background: none;
    color: var(--sky-soft);
}

/* --- Breadcrumbs -----------------------------------------------------------
   Same {name,url} trail already emitted as BreadcrumbList JSON-LD
   (inc/schema.php + inc/helpers.php breadcrumbs()) — this is just its visible
   rendering, so structured data and the page never disagree. */
.breadcrumbs { margin-bottom: var(--sp-5); }
.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-xs);
}
.breadcrumbs li { display: flex; align-items: center; gap: 6px; color: var(--ink-3); }
.breadcrumbs li:not(:last-child)::after {
    content: '/';
    color: var(--ink-4);
}
.breadcrumbs a {
    color: var(--ink-3);
    text-decoration: none;
    transition: color var(--dur-2) var(--ease-out);
}
.breadcrumbs a:hover { color: var(--primary-color); }
.breadcrumbs li[aria-current="page"] {
    color: var(--ink-2);
    font-weight: 600;
    /* Long article titles shouldn't force the trail to overflow. */
    max-width: 60ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Buttons -------------------------------------------------------------
   Four explicit states. The slide-up fill wipe the previous version used is a
   dated template pattern and has been removed. The inset top highlight on the
   primary button is the highest-value micro-detail on the page.
   :active is deliberately faster than :hover — presses should feel instant,
   releases should ease. */
.btn-primary,
.btn-dark-pill,
.btn-consultation {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 260ms var(--ease-out),
                box-shadow 260ms var(--ease-out),
                filter 260ms var(--ease-out),
                background-position 400ms var(--ease-out);
}
.btn-primary:active,
.btn-dark-pill:active,
.btn-consultation:active {
    transition-duration: 90ms;
    transition-timing-function: ease-in;
}

.btn-primary {
    background: var(--grad-brand);
    background-size: 150% 100%;
    background-position: 0% 0%;
    color: var(--white);
    padding: 14px 32px;
    border-radius: var(--radius-sm);
    box-shadow: var(--el-brand), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
    background-position: 60% 0%;
    box-shadow: 0 2px 3px rgba(13, 71, 161, 0.20),
                0 10px 22px rgba(13, 71, 161, 0.26),
                0 24px 48px rgba(13, 71, 161, 0.20),
                inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.btn-primary:active { transform: translateY(0) scale(0.985); box-shadow: var(--el-1); }

.btn-dark-pill {
    background: linear-gradient(180deg, #1e293b, var(--dark-bg));
    color: var(--white);
    padding: 12px 28px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-sm);
    box-shadow: var(--el-2), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.btn-dark-pill:hover { transform: translateY(-2px); filter: brightness(1.12); box-shadow: var(--el-3); }
.btn-dark-pill:active { transform: translateY(0) scale(0.985); box-shadow: var(--el-1); }

.btn-consultation {
    background: var(--grad-brand);
    background-size: 150% 100%;
    background-position: 0% 0%;
    color: var(--white);
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-sm);
    box-shadow: var(--el-1), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-consultation:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: var(--el-2); }
.btn-consultation:active { transform: translateY(0) scale(0.985); }

.btn-primary:disabled, .btn-dark-pill:disabled, .btn-consultation:disabled {
    filter: grayscale(0.4) opacity(0.55);
    transform: none;
    cursor: not-allowed;
}

.btn-whatsapp-bundle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    background-color: var(--whatsapp);
    color: #fff;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 700;
    font-size: var(--fs-xs);
    transition: var(--transition);
}
.btn-whatsapp-bundle:hover {
    background-color: var(--whatsapp-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.35);
}

/* Icon nudge on hover */
.btn-primary .icon,
.btn-dark-pill .icon { transition: transform var(--dur-2) var(--ease-out); }
.btn-primary:hover .icon,
.btn-dark-pill:hover .icon { transform: translateX(3px); }

/* --- Cards ---------------------------------------------------------------
   One shared elevation model. Hover is sequenced across four properties over
   380ms — four properties resolving in order reads as designed; one property
   over 300ms reads as CSS.

   Surface rule: on a light section a card is white + shadow; on a white
   section it is --plane-0 + hairline and NO shadow. Never surface-on-itself. */
.challenge-card, .service-card, .solution-card, .peace-card,
.testimonial-card, .work-card, .price-card, .blog-card, .card, .stack-chip,
.team-card {
    position: relative;
    background: var(--plane-2);
    border: 1px solid var(--hair-1);
    box-shadow: var(--el-1), var(--el-lip);
    transition: transform 320ms var(--ease-out),
                box-shadow 320ms var(--ease-out),
                border-color 240ms var(--ease-out) 40ms;
}

.surface-white .challenge-card, .surface-white .service-card,
.surface-white .solution-card, .surface-white .work-card,
.surface-white .testimonial-card, .surface-white .card,
.surface-white .team-card {
    background: var(--plane-0);
    box-shadow: none;
}

/* .team-card is in the three lists above but deliberately NOT in the
   gradient-frame lists below: it can also carry .is-placeholder, whose badge is
   drawn with ::before on the same element (07-utilities.css). Two rules wanting
   one pseudo is a fight; losing the hover edge-glow on a team card is the
   cheaper side of it. */
.challenge-card:hover, .service-card:hover, .solution-card:hover,
.work-card:hover, .price-card:hover, .blog-card:hover, .card:hover,
.testimonial-card:hover, .team-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--el-3), var(--el-lip);
    border-color: var(--hair-2);
}

/* Gradient edge-glow on hover: a 1px brand-gradient frame drawn by a masked
   pseudo-element (padding-box mask knocks out the middle), so it follows any
   radius with no extra markup. The last beat of the hover sequence. */
.challenge-card::before, .service-card::before, .work-card::before,
.price-card::before, .blog-card::before, .testimonial-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: var(--grad-brand);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            mask-composite: exclude;
    opacity: 0;
    transition: opacity 300ms var(--ease-out) 80ms;
    pointer-events: none;
    z-index: 2;
}
.challenge-card:hover::before, .service-card:hover::before,
.work-card:hover::before, .price-card:hover::before,
.blog-card:hover::before, .testimonial-card:hover::before { opacity: 0.55; }

.challenge-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-align: center;
}
.challenge-card .card-body { padding: 25px var(--sp-5); font-size: var(--fs-sm); color: var(--text-main); line-height: var(--lh-snug); }
.challenge-card strong { color: var(--dark-bg); font-weight: 700; }

.service-card {
    padding: var(--sp-6);
    border-radius: var(--radius-lg);
    text-decoration: none;
    display: block;
}
.service-card .icon { width: var(--icon-lg); height: var(--icon-lg); color: var(--primary-color); margin-bottom: var(--sp-5); }
.service-card h3 { margin-bottom: var(--sp-4); color: var(--dark-bg); }

.solution-card {
    padding: var(--sp-6);
    border-radius: var(--radius-lg);
}
.solution-card .icon { width: var(--icon-lg); height: var(--icon-lg); color: var(--primary-color); margin-bottom: var(--sp-4); }

.peace-card {
    background-color: var(--tint-blue);
    padding: var(--sp-6);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}
.peace-card h3 { color: var(--dark-bg); margin-bottom: var(--sp-3); display: flex; align-items: center; gap: var(--sp-3); }
.peace-card p { font-size: var(--fs-sm); line-height: var(--lh-base); }

.testimonial-card {
    background-color: var(--white);
    padding: var(--sp-6);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.testimonial-stars { color: var(--amber); margin-bottom: var(--sp-4); font-size: var(--fs-sm); }
.testimonial-text { font-size: var(--fs-base); line-height: var(--lh-snug); color: var(--ink-1); margin-bottom: 25px; }
.testimonial-profile { display: flex; align-items: center; gap: var(--sp-4); border-top: 1px solid var(--border-light); padding-top: var(--sp-4); }
.profile-avatar { width: 45px; height: 45px; border-radius: 50%; background-color: var(--slate-200); display: flex; align-items: center; justify-content: center; color: var(--slate-600); flex-shrink: 0; }
.profile-info h5 { font-size: var(--fs-sm); color: var(--dark-bg); font-weight: 700; }
.profile-info p { font-size: var(--fs-xs); color: var(--slate-500); }

/* --- Checklists --- */
.checklist-wrapper { margin: 25px 0; }
.checklist-wrapper li {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    margin-bottom: var(--sp-3);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--dark-bg);
}
.checklist-wrapper .icon { color: var(--primary-color); width: var(--icon-md); height: var(--icon-md); margin-top: 1px; }

/* --- Trust / stats bar --- */
.trust-bar {
    background-color: var(--white);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    padding: var(--sp-7) var(--sp-5);
}
.trust-bar-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--sp-5);
    text-align: center;
}
.trust-stat h3 {
    font-family: var(--font-head);
    font-size: var(--fs-3xl);
    font-weight: 700;
    letter-spacing: var(--tracking-tight);
    color: var(--primary-color);
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}
.trust-stat p { font-size: var(--fs-xs); font-weight: 600; color: var(--text-main); text-transform: uppercase; letter-spacing: 0.5px; }

/* --- Process timeline --- */
.process-section { background-color: var(--dark-bg); border-radius: var(--radius-xl); padding: 70px var(--sp-7); }
.process-section .section-title { color: var(--white); }
.process-section .section-subtitle { color: var(--slate-400); }
/* Shared default, used as-is by service.php (4 cards). The homepage overrides
   it with repeat(5, 1fr) in css/pages/home.css — that sheet loads last and only
   on that page, so the two never collide. Keep both; deleting either breaks a
   page. auto-fit + minmax(200px) already collapses cleanly at 360px, so
   service.php needs no responsive work of its own here. */
.process-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-5); margin-top: var(--sp-7); }
.process-card { background-color: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: var(--radius-lg); padding: 25px; }
.process-num {
    width: 42px; height: 42px;
    background-color: var(--secondary-color);
    color: var(--white);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: var(--fs-sm);
    margin-bottom: var(--sp-5);
}
.process-card h4 { color: var(--white); font-size: var(--fs-lg); margin-bottom: var(--sp-3); }

/* .process-section sits inside .section-container, which already has --sp-5
   gutters, so its own --sp-7 adds up to ~64px of side padding on a 360px
   screen — 232px of usable width for a card. Shared with service.php, hence
   here rather than in home.css. */
@media (max-width: 640px) {
    .process-section { padding: var(--sp-7) var(--sp-5); border-radius: var(--radius-lg); }
}
.process-card p { color: var(--slate-300); font-size: var(--fs-sm); line-height: var(--lh-base); margin-bottom: var(--sp-4); }
.process-timeframe { color: var(--sky-soft); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

/* --- Comparison table --- */
.compare-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1fr;
    gap: 1px;
    background-color: var(--border-light);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-light);
}
.compare-head, .compare-label, .compare-cell { background-color: var(--white); padding: 18px var(--sp-5); font-size: var(--fs-sm); }

/* Signature moment: the column headers lock while the rows scroll past, which
   turns a static table into an interaction at the exact point where the buying
   decision is made. */
.compare-head {
    font-weight: 800;
    color: var(--ink-1);
    font-size: var(--fs-sm);
    position: sticky;
    top: var(--header-h);
    z-index: 3;
    box-shadow: 0 1px 0 var(--hair-1);
}

/* The Rafly column reads as lifted off the page. */
.compare-head.compare-highlight {
    background: linear-gradient(180deg, var(--secondary-color), var(--primary-color));
    color: #fff;
    border-top: 0;
    box-shadow: var(--el-brand);
}
.compare-highlight {
    background: linear-gradient(180deg, var(--tint-blue-strong), var(--white) 80%);
    transition: background-color 200ms var(--ease-out);
}
.compare-grid .compare-highlight:last-of-type { border-radius: 0 0 14px 14px; }
.compare-label { font-weight: 700; color: var(--dark-bg); display: flex; align-items: center; transition: background-color 200ms var(--ease-out); }
.compare-cell { color: var(--text-main); line-height: var(--lh-snug); display: flex; align-items: flex-start; gap: var(--sp-3); transition: background-color 200ms var(--ease-out); }
.compare-cell .icon, .compare-cell i { margin-top: 3px; flex-shrink: 0; }
.compare-cell .is-yes { color: var(--success); }
.compare-cell .is-warn { color: var(--warning); }
.compare-cell .is-no { color: var(--danger); }

.compare-label:hover, .compare-cell:hover { background-color: var(--tint-blue); }
.compare-cell.compare-highlight:hover { background-color: var(--tint-blue-strong); }

/* Check/cross icons pop in a beat after their cell fades up — same --i/stagger
   the shared primitive already sets on the cell, so no extra JS is needed. */
.js-motion .compare-grid[data-animate="stagger"] .compare-cell .icon {
    transform: scale(0.4);
    transition: transform var(--dur-3) var(--ease-spring);
    transition-delay: calc(var(--i, 0) * var(--_stagger, var(--stagger)));
}
.compare-grid[data-animate="stagger"].is-in .compare-cell .icon { transform: scale(1); }

/* At one column the flat 22-cell grid degenerated into a stream of unlabelled
   cells sitting behind four stacked sticky headers. Same DOM, recomposed as one
   card per row: .compare-label becomes the card's header and each .compare-cell
   names its own column from data-col (set in index.php). */
@media (max-width: 768px) {
    .compare-grid {
        grid-template-columns: 1fr;
        gap: var(--sp-5);
        background-color: transparent;
        border: 0;
        border-radius: 0;
        overflow: visible;
    }

    /* Column headings mean nothing once there are no columns — and four
       position:sticky elements stacked in a single track is what made the top
       of this section impossible to scroll past. */
    .compare-head { display: none; }

    .compare-label {
        display: block;
        background: var(--dark-bg);
        color: var(--white);
        font-size: var(--fs-sm);
        padding: var(--sp-3) var(--sp-4);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .compare-cell {
        flex-wrap: wrap;
        padding: var(--sp-3) var(--sp-4);
        border: 1px solid var(--border-light);
        border-top: 0;
        background-color: var(--white);
    }

    /* Full-width so it sits on its own line; .compare-cell is already a flex
       row, so the icon and the text stay side by side underneath. */
    .compare-cell::before {
        content: attr(data-col);
        flex: 0 0 100%;
        font-size: 11px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--ink-4);
        margin-bottom: 2px;
    }

    /* The vertical gradient was drawn to run down a whole column; on a single
       three-line cell it just reads as a smudge. */
    .compare-cell.compare-highlight { background: var(--tint-blue-strong); }
    .compare-cell.compare-highlight::before { color: var(--primary-color); }

    /* Neutralise the desktop "last cell in the entire grid" rounding and round
       each card's real last cell instead. The four heads occupy children 1-4,
       so every row's third cell lands on a multiple of 4. */
    .compare-grid .compare-highlight:last-of-type { border-radius: 0; }
    .compare-cell:nth-of-type(4n) { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

    /* Hover tinting is meaningless on touch and sticks after a tap. */
    .compare-label:hover,
    .compare-cell:hover { background-color: var(--white); }
    .compare-cell.compare-highlight:hover { background-color: var(--tint-blue-strong); }
    .compare-label:hover { background: var(--dark-bg); }
}

/* --- CTA banner --- */
/* Same gutter arithmetic as .process-section — see the note above it. */
.cta-banner-wrapper {
    position: relative;
    background-color: var(--dark-bg);
    border-radius: var(--radius-xl);
    padding: var(--sp-11) var(--sp-7);
    text-align: center;
    color: var(--white);
    margin-bottom: var(--sp-7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}
.cta-banner-wrapper > * { position: relative; z-index: 1; }

@media (max-width: 640px) {
    .cta-banner-wrapper { padding: var(--sp-8) var(--sp-5); }
}

/* Replaces inline style="" on the CTA banner in index.php. Those attributes
   were the last thing keeping style-src 'unsafe-inline' load-bearing here, and
   they duplicated .btn-consultation with slightly different values. */
.section-cta-banner { padding-top: var(--sp-5); padding-bottom: var(--sp-8); }

.section-badge.is-on-dark {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
}

.btn-on-dark {
    background-color: var(--white);
    color: var(--ink-1);
    padding: 14px 35px;
    font-size: var(--fs-sm);
    border-radius: var(--radius-sm);
}
.btn-on-dark:hover { background-color: var(--slate-100); }
.cta-banner-canvas { position: absolute; inset: 0; z-index: 0; opacity: 0.55; }
.cta-banner-wrapper h2 { font-size: var(--fs-3xl); font-weight: 800; margin-bottom: var(--sp-4); color: var(--white); }
.cta-banner-wrapper p { font-size: var(--fs-base); margin: 0 auto var(--sp-6); opacity: 0.9; max-width: 750px; line-height: var(--lh-base); }
.cta-features-list { display: flex; justify-content: center; gap: var(--sp-6); flex-wrap: wrap; margin-top: 25px; font-size: var(--fs-sm); font-weight: 600; }
.cta-features-list li { display: flex; align-items: center; gap: var(--sp-2); }
.cta-features-list .icon, .cta-features-list i { color: var(--sky); }

/* --- Video block --- */
.video-wrapper-box {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-color: #000;
    height: 320px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex; align-items: center; justify-content: center;
}
.video-mock-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.5));
    display: flex; flex-direction: column; justify-content: space-between;
    padding: var(--sp-5);
    color: var(--white);
}
.play-btn-circle {
    width: 65px; height: 65px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary-color);
    font-size: 22px;
    cursor: pointer;
    transition: transform var(--dur-2) var(--ease-out), background-color var(--dur-2) var(--ease-out);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
.play-btn-circle:hover { transform: scale(1.1); background-color: var(--white); }

/* --- Section eyebrow / strip label --- */
.strip-label {
    text-align: center;
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    /* --ink-4 fell below WCAG AA (~2.6:1) on the light surfaces this renders
       on; --ink-3 clears 4.5:1 while staying visually "quiet". */
    color: var(--ink-3);
    margin-bottom: var(--sp-4);
}

/* --- Tech stack chips --- */
.stack-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--sp-3); }
.stack-chip {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--sp-4);
    text-align: center;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-main);
    transition: transform var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.stack-chip:hover { transform: translateY(-4px); border-color: var(--primary-color); color: var(--primary-color); }
.stack-chip .icon { display: block; margin: 0 auto var(--sp-2); width: var(--icon-lg); height: var(--icon-lg); color: var(--primary-color); }

/* --- FAQ accordion -------------------------------------------------------
   Height animates via grid-template-rows 0fr -> 1fr, which needs no JS
   measurement and works with dynamic content, unlike display:none/block. */
.faq-split-layout { display: grid; grid-template-columns: 1fr 1.3fr; gap: var(--sp-10); align-items: flex-start; }
.faq-accordion-container { display: flex; flex-direction: column; gap: var(--sp-4); }

.faq-head { margin-bottom: var(--sp-6); }
.faq-head h2 { font-size: var(--fs-2xl); margin: var(--sp-3) 0 var(--sp-2); }
.faq-head p { font-size: var(--fs-sm); }

.faq-list { display: flex; flex-direction: column; }

/* Hairline rules rather than cards: a run of bordered boxes reads as noise at
   this length, and the divider already groups them. */
.faq-node {
    background: none;
    border: 0;
    border-bottom: 1px solid var(--hair-1);
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.faq-node:first-child { border-top: 1px solid var(--hair-1); }

.faq-node-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-4);
    padding: var(--sp-5) var(--sp-2);
    font-family: var(--font-head);
    font-weight: 600;
    font-size: var(--fs-base);
    color: var(--ink-1);
    text-align: left;
    cursor: pointer;
    transition: color var(--dur-2) var(--ease-out);
}
.faq-node-header:hover { color: var(--primary-color); }
.faq-node-header .icon { color: var(--primary-color); transition: transform var(--dur-2) var(--ease-out); }
.faq-node[open] .faq-node-header .icon,
.faq-node.active .faq-node-header .icon { transform: rotate(180deg); }

.faq-node-panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--dur-2) var(--ease-out);
}
.faq-node.active .faq-node-panel { grid-template-rows: 1fr; }
.faq-node-panel > div { overflow: hidden; }

.faq-node-content {
    padding: 0 var(--sp-2) var(--sp-5);
    font-size: var(--fs-sm);
    line-height: var(--lh-base);
    color: var(--ink-2);
    max-width: 62ch;
    border: 0;
}
.faq-node.active { border-style: solid; border-color: var(--primary-color); box-shadow: 0 4px 12px rgba(13, 71, 161, 0.03); }
/* After .active on purpose — equal specificity, so hovering an open node must
   still clear the shadow. */
.faq-node:hover { transform: none; box-shadow: none; }

/* --- Contact / forms --- */
.contact-section { background-color: var(--slate-100); padding: var(--sp-10) var(--sp-5); }
.contact-details-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 25px; margin-bottom: var(--sp-7); }

.detail-box {
    background-color: var(--white);
    border: 1px dashed var(--primary-color);
    padding: var(--sp-6);
    border-radius: var(--radius-md);
    text-align: center;
    transition: var(--transition);
}
.detail-box .icon { width: var(--icon-lg); height: var(--icon-lg); color: var(--primary-color); margin-bottom: var(--sp-4); }
.detail-box h4 { margin-bottom: var(--sp-2); color: var(--dark-bg); font-size: var(--fs-lg); }
.detail-box p { font-size: var(--fs-sm); color: var(--text-main); line-height: var(--lh-snug); }

.form-wrapper {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.98);
    padding: var(--sp-5);
    border-radius: 2rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.09);
    box-sizing: border-box;
}
.form-wrapper h2,
.modal-content h2 {
    font-size: clamp(1.8rem, 2vw, 2.2rem);
    margin-bottom: var(--sp-4);
    letter-spacing: -0.02em;
}
.form-wrapper p,
.modal-content p {
    font-size: 0.98rem;
    line-height: 1.75;
    color: var(--slate-600);
    margin-bottom: var(--sp-5);
}
.form-wrapper form,
.modal-content form {
    display: grid;
    gap: var(--sp-4);
}
.form-group { margin-bottom: var(--sp-4); }
.form-group label { display: block; font-weight: 700; margin-bottom: 0.45rem; color: var(--dark-bg); font-size: 0.95rem; }

.form-control {
    width: 100%;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(148, 163, 184, 0.5);
    border-radius: 1.6rem;
    font-size: 1rem;
    line-height: 1.6;
    background-color: #f8fafc;
    transition: border-color var(--dur-1) ease, box-shadow var(--dur-1) ease;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.14);
}
.form-control[aria-invalid="true"] { border-color: var(--danger); }
/* Success state — [aria-invalid="false"] is only ever set by validateField()
   AFTER a field has been checked at least once, so a pristine, untouched
   field never shows a false "this is fine" tick. */
.form-control[aria-invalid="false"] {
    border-color: var(--success);
    padding-right: 40px;
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
textarea.form-control { resize: vertical; min-height: 140px; }
textarea.form-control[aria-invalid="false"] { background-position: right 14px top 14px; }

/* Consultation modal: slightly shorter textarea so the form fits the dialog */
#consultationForm textarea.form-control {
    min-height: 90px;
}

.field-error { display: block; color: var(--danger); font-size: var(--fs-xs); margin-top: var(--sp-2); }

.btn-submit {
    width: 100%;
    background-color: var(--dark-bg);
    color: var(--white);
    padding: 12px 16px;
    border: none;
    border-radius: 2rem;
    font-weight: 700;
    font-size: 0.96rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color var(--dur-2) var(--ease-out), transform var(--dur-1) ease;
}
.btn-submit:hover { transform: translateY(-1px); }
.btn-submit:hover { background-color: var(--primary-color); }
.btn-submit.success { background-color: var(--success); }
.btn-submit:disabled { cursor: not-allowed; opacity: 0.95; }

/* Spinner — CSS-only, no markup change needed in the button itself. */
.btn-submit.is-loading::before {
    content: '';
    width: 16px; height: 16px;
    flex: none;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btnSpin 700ms linear infinite;
}
@keyframes btnSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .btn-submit.is-loading::before { animation: none; }
}

.consent-group { display: flex; flex-direction: column; gap: 0.75rem; align-items: flex-start; }
.consent-group label { font-size: 0.92rem; line-height: 1.4; }
.consent-group .field-error { flex-basis: 100%; margin-top: 0; }

/* --- Modal --- */
/* The modal was the one component on the site that snapped between display
   none/flex with no transition, while everything around it is carefully eased.
   It now fades the backdrop and lifts the panel, matching the drawer.

   `hidden` is toggled by JS; .active lands a frame later so the transition has
   a state to run from. Both are needed: hidden keeps the closed dialog out of
   the tab order, .active drives the animation. */
.modal {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-5);
    z-index: var(--z-modal);

    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-2) var(--ease-out);
}
.modal[hidden] { display: none; }
.modal.active { opacity: 1; pointer-events: auto; }

.modal-content {
    background-color: rgba(255, 255, 255, 0.98);
    padding: var(--sp-4);
    border-radius: 2rem;
    width: 100%;
    max-width: 520px;
    position: relative;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);

    /* Keep the modal panel within the viewport and allow internal scrolling
       so long forms (or small screens) don't push content off-screen. */
    max-height: calc(100vh - var(--sp-8));
    overflow: auto;

    transform: translateY(12px) scale(0.98);
    transition: transform var(--dur-2) var(--ease-out);
}
.modal.active .modal-content { transform: translateY(0) scale(1); }

@media (prefers-reduced-motion: reduce) {
    .modal, .modal-content { transition: none; }
    .modal-content { transform: none; }
}
.close-modal {
    position: absolute;
    top: var(--sp-4); right: var(--sp-5);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--slate-500);
}
body.modal-open { overflow: hidden; }

/* --- Toasts (replacing alert()) --- */
.toast-stack {
    position: fixed;
    bottom: var(--sp-5);
    left: 50%;
    transform: translateX(-50%);
    z-index: calc(var(--z-modal) + 10);
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    /* 100% not 100vw: for a fixed element the containing block is the initial
       containing block, which excludes a classic scrollbar — 100vw does not,
       and html has no overflow-x:hidden to absorb the difference. */
    width: min(420px, calc(100% - var(--sp-8)));
    pointer-events: none;
}
.toast {
    background: var(--dark-bg);
    color: var(--white);
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    pointer-events: auto;
    animation: toastIn var(--dur-2) var(--ease-out) both;
}
.toast.is-error { background: var(--danger); }
.toast.is-success { background: var(--success); }
.toast.is-leaving { animation: toastOut var(--dur-2) var(--ease-in-out) both; }

/* --- Chatbot --- */
/* Now a real <button> (it was a <div onclick>, unreachable by keyboard), so it
   needs the border and font resets a div never did. */
.bot-trigger {
    position: fixed;
    bottom: 25px; right: 25px;
    width: 60px; height: 60px;
    background-color: var(--primary-color);
    color: var(--white);
    border: 0;
    font: inherit;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: var(--z-sidebar);
    transition: transform var(--dur-2) var(--ease-out), background-color var(--dur-2) var(--ease-out);
}
.bot-trigger:hover { transform: scale(1.05); background-color: var(--secondary-color); }

.bot-window {
    position: fixed;
    /* Sits above .to-top (bottom: 95px) rather than on top of it — the two used
       identical coordinates and overlapped whenever the assistant was open. */
    bottom: 150px; right: 25px;
    width: 350px; height: 450px;
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--el-3);
    display: flex; flex-direction: column;
    overflow: hidden;
    z-index: var(--z-sidebar);
    opacity: 0; pointer-events: none;
    transform: translateY(20px);
    transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
    border: 1px solid var(--hair-1);
}
.bot-window.active { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* The `hidden` attribute must win over `display: flex` above, or it is inert —
   the UA [hidden] rule loses to any author display declaration. This is what
   actually keeps the closed widget out of the tab order. */
.bot-window[hidden] { display: none; }

.bot-header { background-color: var(--dark-bg); color: var(--white); padding: var(--sp-4); display: flex; justify-content: space-between; align-items: center; }
.bot-title { font-weight: 600; font-size: var(--fs-sm); display: inline-flex; align-items: center; gap: var(--sp-2); }
.bot-close {
    background: none;
    border: 0;
    color: var(--white);
    font-size: 22px;
    line-height: 1;
    padding: 0 var(--sp-1);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: opacity var(--dur-1) var(--ease-out);
    opacity: 0.75;
}
.bot-close:hover { opacity: 1; }
.bot-logs { flex: 1; padding: var(--sp-4); overflow-y: auto; display: flex; flex-direction: column; gap: var(--sp-3); background-color: var(--light-bg); }

.msg { max-width: 85%; padding: var(--sp-3) 14px; border-radius: var(--radius-md); font-size: var(--fs-sm); line-height: 1.4; }
.msg.server { background-color: var(--slate-200); color: var(--dark-bg); align-self: flex-start; border-top-left-radius: 0; }
.msg.client { background-color: var(--primary-color); color: var(--white); align-self: flex-end; border-top-right-radius: 0; }

.bot-options { padding: var(--sp-3); background-color: var(--white); border-top: 1px solid var(--border-light); display: flex; flex-direction: column; gap: 6px; }
.opt-btn {
    width: 100%;
    text-align: left;
    padding: var(--sp-2) var(--sp-3);
    background-color: var(--slate-100);
    border: 1px solid var(--slate-300);
    border-radius: var(--radius-sm);
    font-size: var(--fs-xs);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}
.opt-btn:hover { background-color: var(--slate-200); color: var(--primary-color); }

/* The phone sizing for .bot-window now lives in 04-nav.css, derived from the
   sticky-bar tokens, and covers the whole range below 900px rather than only
   below 480px. The 100vw width that used to be here was also a horizontal
   scroll risk on Android. */

/* --- Thank-you page --- */
.thanks-wrap {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--header-h) + var(--sp-9)) var(--sp-5) var(--sp-9);
}
.thanks-card {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: var(--sp-8) var(--sp-7);
    max-width: 620px;
    text-align: center;
}
.thanks-icon {
    width: 72px; height: 72px;
    margin: 0 auto var(--sp-5);
    border-radius: 50%;
    background: var(--tint-blue);
    color: var(--success);
    display: flex; align-items: center; justify-content: center;
}
.thanks-card h1 { font-size: var(--fs-2xl); margin-bottom: var(--sp-4); }
.thanks-card p { margin-bottom: var(--sp-4); }
.thanks-meta { color: var(--slate-500); font-size: var(--fs-sm); }
.thanks-actions { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; margin-top: var(--sp-6); }

/* --- Mission & Vision cards (shared: homepage + about) --- */

.mv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }

.mv-card {
    border-radius: var(--radius-xl);
    padding: var(--sp-7);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}
.mv-card .mv-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: grid; place-items: center;
    background: var(--badge-bg);
    color: var(--primary-color);
    font-size: 22px;
}
.mv-card h3 { font-size: var(--fs-xl); }
.mv-card p { color: var(--text-main); line-height: 1.75; }
.mv-card.is-vision { background: var(--dark-bg); color: var(--slate-300); }
.mv-card.is-vision h3 { color: var(--white); }
.mv-card.is-vision p { color: var(--slate-300); }
.mv-card.is-vision .mv-icon { background: rgba(255, 255, 255, 0.08); color: var(--sky); }

@media (max-width: 900px) { .mv-grid { grid-template-columns: 1fr; } }

