/*
 * Final UI overrides extracted from style.css.
 * Loaded after style.css and density-pass.css to isolate late-stage polish.
 */

.section-actions {
    display: flex;
    justify-content: center;
    margin-top: clamp(1rem, 2vw, 1.5rem);
}

.disclosure-toggle {
    min-width: min(100%, 18rem);
}

[data-collapsible-item][hidden] {
    display: none;
}

/* ========================================
   NAV ISLAND (Dark Floating Pill)
   ======================================== */

.nav-island {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    min-width: min(740px, calc(100vw - 2rem));
    max-width: 95%;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 0.35rem 1.25rem;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease, box-shadow 0.3s ease, top 0.3s ease;
}

.nav-island .nav-wrapper {
    width: 100%;
    padding: 0.1rem 0;
}

.nav-island.scrolled {
    background: rgba(15, 23, 42, 0.97);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    top: 0.6rem;
}

.nav-island .logo-text {
    color: #ffffff;
}

.nav-island .logo-image {
    width: 28px;
    height: 28px;
}

.nav-island .logo {
    font-size: 1rem;
    gap: 0.5rem;
}

.nav-island .nav-link {
    color: #cbd5e1;
    font-size: 0.8125rem;
}

.nav-island .nav-link:hover {
    color: #ffffff;
}

.nav-island .btn-primary {
    background: #ffffff;
    color: #0f172a;
    border: none;
    padding: 0.4rem 1.1rem;
    font-size: 0.8125rem;
}

.nav-island .btn-primary:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}

/* ========================================
   LANGUAGE DROPDOWN
   ======================================== */

.language-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.lang-current {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.65rem;
    background: rgba(148, 163, 184, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 999px;
    color: #cbd5e1;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    letter-spacing: 0.02em;
    user-select: none;
    appearance: none;
    -webkit-appearance: none;
}

.lang-current:hover {
    background: rgba(148, 163, 184, 0.25);
    color: #ffffff;
    border-color: rgba(148, 163, 184, 0.4);
}

.lang-current i.fa-chevron-down {
    font-size: 0.6rem;
    transition: transform 0.2s ease;
    opacity: 0.7;
}

.language-dropdown.open .lang-current i.fa-chevron-down {
    transform: rotate(180deg);
}

.lang-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: rgba(9, 16, 33, 0.97);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 0.35rem;
    min-width: 130px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.97);
    transition: opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.18s cubic-bezier(0.4, 0, 0.2, 1), transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    z-index: 999;
}

.language-dropdown.open .lang-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.lang-menu[hidden] {
    display: none;
}

.lang-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 8px;
    transition: background-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.lang-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.lang-item.active {
    background: rgba(79, 70, 229, 0.25);
    color: #a5b4fc;
}

.lang-item .lang-flag {
    font-size: 1rem;
    line-height: 1;
}

.lang-item .lang-name {
    flex: 1;
}

.lang-item .lang-code {
    font-size: 0.65rem;
    opacity: 0.5;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ========================================
   MOBILE STICKY CTA
   ======================================== */

.mobile-sticky-cta {
    display: none;
}

@media (max-width: 768px) {
    .mobile-sticky-cta {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        padding: var(--spacing-sm);
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-top: 1px solid var(--neutral-200);
        z-index: 1000;
        transform: translateY(100%);
        transition: transform var(--transition-base);
        padding-bottom: calc(var(--spacing-sm) + env(safe-area-inset-bottom));
    }

    .dark-page .mobile-sticky-cta {
        background: rgba(15, 23, 42, 0.85);
        border-top-color: rgba(255, 255, 255, 0.1);
    }

    .mobile-sticky-cta.visible {
        transform: translateY(0);
    }

    .mobile-sticky-cta .btn {
        width: 100%;
        display: flex;
        justify-content: center;
        box-shadow: var(--shadow-md);
    }
}

/* ========================================
   TESTIMONIAL CARD (CASE STUDY INLINE)
   ======================================== */

.testimonial-card {
    position: relative;
    margin: var(--spacing-lg) 0;
    padding: var(--spacing-xl);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow: hidden;
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
    z-index: 1;
}

.testimonial-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.testimonial-card::before {
    content: '\201C';
    position: absolute;
    top: -20px;
    left: 10px;
    font-size: 10rem;
    font-family: Georgia, serif;
    color: rgba(99, 102, 241, 0.08);
    line-height: 1;
    z-index: 0;
    pointer-events: none;
}

.testimonial-text {
    position: relative;
    z-index: 1;
    font-size: var(--font-size-lg);
    font-weight: 500;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    font-style: italic;
}

.testimonial-author {
    position: relative;
    z-index: 1;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.testimonial-author::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 2px;
    background: var(--primary-color);
}

.dark-page .testimonial-card {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(255, 255, 255, 0.08);
}

.dark-page .testimonial-text {
    color: #f8fafc;
}

/* ========================================
   EXIT-INTENT POPUP
   ======================================== */

.exit-intent-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.exit-intent-overlay.active {
    opacity: 1;
    visibility: visible;
}

.exit-intent-modal {
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 20px;
    width: 90%;
    max-width: 480px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.exit-intent-overlay.active .exit-intent-modal {
    transform: translateY(0) scale(1);
}

.exit-intent-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s ease;
}

.exit-intent-close:hover {
    color: #0f172a;
}

.exit-intent-icon {
    width: 48px;
    height: 48px;
    background: #4f46e5;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.25);
}

.exit-intent-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.exit-intent-desc {
    color: #475569;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.exit-intent-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.exit-intent-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.exit-intent-form input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    outline: none;
}

.exit-intent-form button {
    background: #4f46e5;
    color: white;
    border: none;
    padding: 0.85rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.exit-intent-form button:hover {
    background: #4338ca;
    transform: translateY(-1px);
}

.exit-intent-form button:disabled {
    background: #10b981;
    transform: none;
    cursor: default;
}

.exit-intent-privacy {
    text-align: left;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.5rem;
}
