/* ==========================================================================
   Design System: Ardan Pramudya Finance (APF)
   Executive Clean & Structured Automotive Equity Advisory
   ========================================================================== */

/* Color Scheme Lock to prevent mobile browser Auto-Dark Invert glitches */
:root {
    color-scheme: light;
}

/* Prevent mobile viewport shifts and horizontal overflow */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
    -webkit-overflow-scrolling: touch;
}

* {
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

/* Custom Smooth Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #F8FAFC;
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #D97706;
}

/* Base Scroll Adjustment */
html {
    scroll-padding-top: 5.5rem;
}

/* Chrome / Safari Autofill Styling */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 40px #FFFFFF inset !important;
    -webkit-text-fill-color: #0F172A !important;
    caret-color: #D97706;
}

/* Custom Select Dropdown Chevron */
select.custom-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
    padding-right: 2.5rem;
    -webkit-print-color-adjust: exact;
    appearance: none;
}

/* SOP Policy Tabs */
.tab-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #475569;
    background-color: transparent;
}

.tab-btn:hover {
    color: #0F172A;
    background-color: rgba(255, 255, 255, 0.6);
}

.tab-btn.active {
    background-color: #0F172A !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: tabFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* FAQ Accordion Transitions */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
    color: #D97706;
}

.faq-item {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.faq-item.active {
    border-color: #CBD5E1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

/* ==========================================================================
   Mobile Reliability & Anti-Glitch Safeguards
   ========================================================================== */
@media (max-width: 768px) {
    /* Prevent blank/black screen if AOS is delayed or blocked by in-app browser */
    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        visibility: visible !important;
    }

    /* Safe container padding */
    .max-w-7xl {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}
