/* InfinityX Enhanced Styles - Bootstrap Integration with Custom Design */

/* CSS Variables - Enhanced Theme Support */
:root {
    /* Primary Brand Colors */
    --infinity-blue: #1e40af;
    --infinity-green: #059669;
    --infinity-gold: #f59e0b;
    --infinity-purple: #86358B;
    --infinity-orange: #EB833A;
    --infinity-dark: #012c7c;

    /* Bootstrap Override Variables */
    --bs-primary: var(--infinity-blue);
    --bs-success: var(--infinity-green);
    --bs-warning: var(--infinity-gold);
    --bs-info: #0ea5e9;
    --bs-dark: var(--infinity-dark);

    /* Custom Gradients */
    --gradient-primary: linear-gradient(135deg, var(--infinity-blue) 0%, #0ea5e9 100%);
    --gradient-secondary: linear-gradient(135deg, var(--infinity-green) 0%, var(--infinity-gold) 100%);
    --gradient-hero: linear-gradient(135deg, var(--infinity-purple) 0%, var(--infinity-blue) 100%);
    --gradient-money: linear-gradient(135deg, var(--infinity-gold) 0%, var(--infinity-green) 100%);

    /* Glass Morphism */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-blur: 20px;

    /* Shadows */
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 12px 40px rgba(0, 0, 0, 0.15);
    --shadow-strong: 0 20px 64px rgba(0, 0, 0, 0.25);

    /* Animations */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* CDX Theme Override */
[data-theme="cdx"] {
    --bs-primary: var(--infinity-blue);
    --bs-success: var(--infinity-green);
    --bs-warning: var(--infinity-gold);
    --gradient-primary: linear-gradient(135deg, var(--infinity-blue) 0%, #0ea5e9 100%);
    --gradient-secondary: var(--gradient-money);
}

/* Enhanced Base Styles - Mobile First */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-feature-settings: 'kern' 1, 'liga' 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    font-size: 16px; /* Prevent zoom on mobile */
    line-height: 1.6;
    overflow-x: hidden;
}

/* Mobile-first containers */
.container {
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 576px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 992px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Typography Enhancements - Mobile First */
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

/* Mobile typography scales */
.display-3 {
    font-size: 2.5rem;
    line-height: 1.1;
}

.display-4 {
    font-size: 2rem;
    line-height: 1.2;
}

.lead {
    font-size: 1.125rem;
    line-height: 1.5;
}

@media (min-width: 576px) {
    .display-3 {
        font-size: 3rem;
    }

    .display-4 {
        font-size: 2.25rem;
    }

    .lead {
        font-size: 1.25rem;
    }
}

@media (min-width: 768px) {
    .display-3 {
        font-size: 3.5rem;
    }

    .display-4 {
        font-size: 2.5rem;
    }
}

@media (min-width: 992px) {
    .display-3 {
        font-size: 4.5rem;
    }

    .display-4 {
        font-size: 3.5rem;
    }

    .lead {
        font-size: 1.25rem;
    }
}

.text-white-75 {
    color: rgba(255, 255, 255, 0.85) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Enhanced contrast utilities */
.text-white-85 {
    color: rgba(255, 255, 255, 0.90) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.text-white-95 {
    color: rgba(255, 255, 255, 0.98) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Dark background text enhancement */
.bg-dark .text-muted {
    color: rgba(12, 30, 134, 0.8) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.bg-dark .lead {
    color: rgba(18, 36, 138, 0.95) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Light background text enhancement */
.bg-light .text-muted {
    color: rgba(10, 58, 134, 0.9) !important;
}

.bg-light .lead {
    color: rgba(13, 68, 146, 0.95) !important;
}

/* Enhanced Loading Screen - Mobile Optimized */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    background: var(--gradient-primary);
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 767.98px) {
    .loading-screen {
        padding: 1rem;
    }

    .loading-content {
        padding: 2rem 1rem;
    }

    .loading-spinner .spinner-border {
        width: 3rem !important;
        height: 3rem !important;
    }
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Main content transition */
#main-content, .main-content {
    transition: opacity 0.5s ease;
}

.loading-spinner .spinner-border {
    animation: loading-pulse 1.5s ease-in-out infinite;
}

@keyframes loading-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Enhanced Navigation */
.navbar {
    background: linear-gradient(135deg, rgba(1, 23, 64, 0.98) 0%, rgba(30, 64, 175, 0.95) 100%) !important;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    transition: var(--transition-smooth);
    padding: 1rem 0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.navbar.scrolled {
    padding: 0.75rem 0;
    background: linear-gradient(135deg, rgba(1, 23, 64, 0.99) 0%, rgba(30, 64, 175, 0.98) 100%) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    transition: var(--transition-smooth);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.nav-link {
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 500;
    position: relative;
    transition: var(--transition-smooth);
    padding: 0.75rem 1rem !important;
    border-radius: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.nav-link:hover {
    color: white !important;
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.1);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-secondary);
    transition: var(--transition-smooth);
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

/* Enhanced Hero Section - Mobile First */
.hero {
    background: linear-gradient(135deg, var(--infinity-purple) 0%, var(--infinity-blue) 50%, #0ea5e9 100%);
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    padding: 6rem 0 4rem;
    display: flex;
    align-items: center;
}

/* Mobile hero adjustments */
@media (max-width: 767.98px) {
    .hero {
        min-height: 100vh;
        padding: 8rem 0 3rem;
        text-align: center;
    }

    .hero .container {
        padding: 0 1rem;
    }

    .hero-content {
        text-align: center;
        max-width: 100%;
    }

    .hero .display-3 {
        font-size: 2.25rem;
        line-height: 1.1;
        margin-bottom: 1.5rem;
    }

    .hero .lead {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }

    .hero-features {
        justify-content: center;
        text-align: center;
    }

    .hero-features .d-flex {
        justify-content: center;
        margin-bottom: 1rem;
    }

    .hero-cta {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .hero-cta .btn {
        width: 100%;
        max-width: 280px;
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    z-index: 1;
}

/* CDX Theme Money Pattern */
[data-theme="cdx"] .hero-background {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="money-pattern" width="30" height="30" patternUnits="userSpaceOnUse"><text x="15" y="20" text-anchor="middle" fill="rgba(255,255,255,0.08)" font-size="14" font-family="Arial">💰</text></pattern></defs><rect width="100" height="100" fill="url(%23money-pattern)"/></svg>');
}

.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 2;
}

.floating-shape {
    position: absolute;
    background: var(--glass-bg-blur);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    animation: floating 8s ease-in-out infinite;
    backdrop-filter: blur(10px);
}

@keyframes floating {
    0%, 100% {
        transform: translateY(0px) translateX(0px) rotate(0deg);
        opacity: 0.6;
    }
    25% {
        transform: translateY(-30px) translateX(15px) rotate(90deg);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-20px) translateX(-10px) rotate(180deg);
        opacity: 1;
    }
    75% {
        transform: translateY(-40px) translateX(8px) rotate(270deg);
        opacity: 0.7;
    }
}

.hero-content {
    position: relative;
    z-index: 3;
}

/* Enhanced Device Mockup */
.device-mockup {
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border) !important;
    backdrop-filter: blur(var(--glass-blur));
    transform: perspective(1000px) rotateX(5deg) rotateY(-5deg);
    transition: var(--transition-bounce);
}

.device-mockup:hover {
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg) scale(1.05);
}

.mockup-screen {
    background: var(--gradient-secondary) !important;
}

/* Money Pulse Animation */
.money-pulse {
    animation: money-pulse 2s ease-in-out infinite;
}

@keyframes money-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(245, 158, 11, 0);
    }
}

/* Enhanced Step Cards */
.step-card {
    position: relative;
    transition: var(--transition-bounce);
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    overflow: hidden;
}

.step-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-secondary);
    transform: scaleX(0);
    transition: var(--transition-smooth);
}

.step-card:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-strong) !important;
}

.step-card:hover::before {
    transform: scaleX(1);
}

.step-number {
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    box-shadow: var(--shadow-medium);
}

.step-icon {
    width: 80px;
    height: 80px;
    color: white;
}

/* Enhanced Benefit Cards */
.benefit-card {
    transition: var(--transition-bounce);
    border: none !important;
    box-shadow: var(--shadow-soft) !important;
}

.benefit-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-strong) !important;
}

.benefit-icon {
    width: 60px;
    height: 60px;
    color: white;
}

/* Enhanced Calculator */
.calculator-card {
    background: white !important;
    border: none !important;
    box-shadow: var(--shadow-strong) !important;
    overflow: hidden;
}

.calculator-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-secondary);
}

.result-card {
    transition: var(--transition-bounce);
    border-radius: 12px !important;
}

.result-value {
    transition: var(--transition-bounce);
}

.result-value.bounce {
    animation: value-bounce 0.6s ease-out;
}

@keyframes value-bounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Enhanced Form Styling */
.form-floating {
    position: relative;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--bs-primary);
}

.form-floating > .form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(30, 64, 175, 0.25);
}

.form-control {
    border-radius: 12px !important;
    border: 2px solid #e9ecef;
    transition: var(--transition-smooth);
}

.form-control:focus {
    transform: translateY(-2px);
}

.form-control.is-valid {
    border-color: var(--bs-success);
    background-image: none;
}

.form-control.is-invalid {
    border-color: #dc3545;
    background-image: none;
}

/* Enhanced Buttons */
.btn {
    border-radius: 12px !important;
    font-weight: 600;
    transition: var(--transition-bounce);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--infinity-blue) 0%, #3b82f6 100%) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 4px 16px rgba(30, 64, 175, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3b82f6 0%, var(--infinity-blue) 100%) !important;
    color: white !important;
    box-shadow: 0 8px 32px rgba(30, 64, 175, 0.4);
}

.btn-success {
    background: var(--gradient-secondary) !important;
    border: none !important;
}

.btn-warning {
    background: linear-gradient(135deg, var(--infinity-gold) 0%, #fbbf24 100%) !important;
    border: none !important;
    color: #1f2937 !important;
    font-weight: 700 !important;
    text-shadow: none !important;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #fbbf24 0%, var(--infinity-gold) 100%) !important;
    color: #111827 !important;
    box-shadow: 0 8px 32px rgba(245, 158, 11, 0.4);
}

.btn-lg {
    padding: 12px 32px !important;
    font-size: 1.1rem !important;
}

/* Enhanced Testimonial Cards */
.testimonial-card {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(var(--glass-blur));
    transition: var(--transition-bounce);
}

.testimonial-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.15) !important;
}

/* Enhanced Accordion (FAQ) */
.accordion-button {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 12px !important;
    margin-bottom: 1rem;
    transition: var(--transition-smooth);
}

.accordion-button:not(.collapsed) {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    box-shadow: none !important;
}

.accordion-button:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25) !important;
}

.accordion-collapse {
    border: none !important;
}

.accordion-body {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0 0 12px 12px;
    margin-top: -1rem;
    padding-top: 1.5rem !important;
}

/* Enhanced Modal */
.modal-content {
    border: none !important;
    border-radius: 20px !important;
    box-shadow: var(--shadow-strong) !important;
    overflow: hidden;
}

.modal-header {
    background: var(--gradient-primary);
    color: white;
}

.modal-body {
    padding: 2rem !important;
}

/* Bootstrap Component Enhancements */
.badge {
    font-weight: 600 !important;
    padding: 0.5rem 1rem !important;
    border-radius: 50px !important;
}

.card {
    border: none !important;
    border-radius: 20px !important;
    transition: var(--transition-bounce);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Enhanced card variants */
.card.bg-dark {
    background: rgba(2, 30, 100, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.95);
}

.card.bg-dark .text-muted {
    color: rgba(2, 67, 119, 0.8) !important;
}

.card.bg-light {
    background: rgba(1, 83, 97, 0.95) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.card-header {
    border: none !important;
    background: transparent !important;
}

/* Shadow Utilities */
.shadow-hover {
    transition: var(--transition-smooth);
}

.shadow-hover:hover {
    box-shadow: var(--shadow-strong) !important;
}

/* Background Utilities */
.bg-gradient {
    background: var(--gradient-primary) !important;
}

.bg-primary-subtle {
    background: rgba(5, 30, 114, 0.1) !important;
}

.bg-success-subtle {
    background: rgba(5, 150, 105, 0.1) !important;
}

.bg-warning-subtle {
    background: rgba(102, 65, 1, 0.726) !important;
}

/* Text Color Utilities */
.text-primary-emphasis {
    color: var(--infinity-blue) !important;
}

.text-success-emphasis {
    color: var(--infinity-green) !important;
}

.text-warning-emphasis {
    color: var(--infinity-gold) !important;
}

/* Enhanced Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Theme-specific Enhancements */
[data-theme="cdx"] .hero {
    background: var(--gradient-primary);
}

[data-theme="cdx"] .floating-shape::after {
    content: attr(data-icon);
}

[data-theme="cdx"] .section:nth-child(even) {
    background: linear-gradient(180deg, #f8faff 0%, #ffffff 100%);
}

[data-theme="cdx"] .btn-primary {
    background: var(--gradient-money) !important;
    color: #1a1a1a !important;
}

/* Responsive Enhancements */
/* Mobile Navigation Enhancements */
.navbar-toggler {
    position: relative;
    z-index: 1000;
}

.navbar-toggler .bi-list,
.navbar-toggler .bi-x {
    transition: all 0.3s ease;
}

.navbar-toggler[aria-expanded="true"] .bi-list {
    display: none;
}

.navbar-toggler[aria-expanded="true"]::before {
    content: "\F62A"; /* Bootstrap X icon */
    font-family: "Bootstrap Icons";
    color: white;
    font-size: 1.5rem;
}

.navbar-toggler[aria-expanded="false"]::before {
    display: none;
}

@media (max-width: 991.98px) {
    .navbar {
        padding: 0.75rem 0;
    }

    .navbar-collapse {
        background: linear-gradient(135deg, rgba(1, 23, 64, 0.98) 0%, rgba(30, 64, 175, 0.95) 100%);
        border-radius: 16px;
        margin-top: 1.5rem;
        padding: 2rem 1.5rem;
        border: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        position: relative;
        overflow: hidden;
    }

    .navbar-collapse::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
        pointer-events: none;
    }

    .navbar-nav {
        gap: 0.5rem;
    }

    .navbar-nav .nav-item {
        width: 100%;
    }

    .navbar-nav .nav-link {
        padding: 1.25rem 1.5rem !important;
        margin: 0;
        border-radius: 12px;
        font-weight: 600;
        font-size: 1.1rem;
        text-align: center;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link:focus {
        background: rgba(255, 255, 255, 0.15);
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
        border-color: rgba(255, 255, 255, 0.2);
    }

    .navbar-nav .btn {
        margin-top: 1.5rem;
        width: 100%;
        padding: 1.25rem;
        font-size: 1.2rem;
        font-weight: 700;
        border-radius: 12px;
        box-shadow: 0 8px 25px rgba(245, 158, 11, 0.3);
    }

    .navbar-nav .btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 35px rgba(245, 158, 11, 0.4);
    }

    .floating-shape:nth-child(n+4) {
        display: none;
    }
}

/* Mobile-First Additional Improvements */
@media (max-width: 575.98px) {
    /* Extra small devices - Mobile First */
    .py-5 {
        padding: 3rem 0 !important;
    }

    .mb-5 {
        margin-bottom: 2.5rem !important;
    }

    .card {
        margin-bottom: 1.5rem;
        border-radius: 16px;
    }

    .card-body {
        padding: 1.5rem !important;
    }

    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }

    /* Form improvements - Mobile First */
    .form-control,
    .form-control-lg {
        padding: 1.25rem;
        font-size: 16px; /* Prevent zoom on iOS */
        border: 2px solid #e2e8f0;
        border-radius: 12px;
        transition: all 0.3s ease;
        background-color: rgba(248, 249, 250, 0.95) !important;
        color: #1f2937 !important; /* Ensure dark text */
        font-weight: 600;
    }

    .form-control:focus,
    .form-control-lg:focus {
        border-color: var(--infinity-blue);
        box-shadow: 0 0 0 0.25rem rgba(30, 64, 175, 0.15);
        background-color: white !important;
        color: #1f2937 !important; /* Ensure text stays dark on focus */
        transform: translateY(-1px);
        outline: none;
    }

    /* Specific styling for credit limit inputs */
    #creditLimit,
    #limite {
        background-color: rgba(248, 249, 250, 0.98) !important;
        color: #1f2937 !important;
        font-weight: 600 !important;
    }

    #creditLimit:focus,
    #limite:focus {
        background-color: white !important;
        color: #1f2937 !important;
    }

    /* Ensure placeholder text is visible */
    #creditLimit::placeholder,
    #limite::placeholder {
        color: #6b7280 !important;
        opacity: 0.7;
    }

    /* Mobile input animations */
    @media (max-width: 767.98px) {
        .form-control,
        .form-control-lg {
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .form-control:focus,
        .form-control-lg:focus {
            transform: translateY(-2px) scale(1.02);
            box-shadow: 0 8px 25px rgba(30, 64, 175, 0.15);
        }

        .form-control:active,
        .form-control-lg:active {
            transform: scale(0.98);
        }
    }

    .input-group-lg .input-group-text {
        padding: 1.25rem 1rem;
        font-size: 16px;
        border: 2px solid #e2e8f0;
        border-right: none;
        background: var(--infinity-blue);
        font-weight: 600;
    }

    .input-group-lg .form-control {
        border-left: none;
    }

    .input-group-lg .form-control:focus {
        border-left: 2px solid var(--infinity-blue);
    }

    /* Input validation styling */
    .form-control.is-valid {
        border-color: #28a745;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='m2.3 6.73.94-.94-.94-.94 1.06-1.06.94.94.94-.94L6.33 4.8l-.94.94.94.94-1.06 1.06-.94-.94-.94.94z'/%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right calc(0.375em + 0.1875rem) center;
        background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    }

    .form-control.is-invalid {
        border-color: #dc3545;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 3.6-.896.498.896.498L6.4 6l-.896.498-.896-.498L3.012 6l.896-.498-.896-.498L3.6 3.6l.896.498L5.4 3.6z'/%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right calc(0.375em + 0.1875rem) center;
        background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    }

    /* Modal improvements */
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-footer {
        padding: 1rem 1.5rem;
        flex-direction: column;
        gap: 0.75rem;
    }

    .modal-footer .btn {
        width: 100%;
        margin: 0;
    }

    /* Calculator specific */
    .calculator-card .row {
        flex-direction: column;
    }

    .calculator-card .col-lg-6 {
        width: 100%;
        margin-bottom: 2rem;
    }

    .results-display {
        text-align: center;
    }

    .result-item {
        padding: 1rem;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 12px;
        margin-bottom: 1rem;
    }

    /* Steps and benefits */
    .step-card,
    .benefit-card {
        text-align: center;
        padding: 2rem 1.5rem;
    }

    .step-number {
        position: relative !important;
        display: inline-flex !important;
        margin-bottom: 1rem;
    }

    /* Footer improvements */
    .footer .row > div {
        margin-bottom: 2rem;
        text-align: center;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    /* Small devices */
    .hero .display-3 {
        font-size: 2.75rem;
    }

    .hero-cta .btn {
        max-width: 320px;
    }

    .calculator-card .row {
        align-items: center;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    /* Medium devices */
    .hero-content {
        text-align: left;
    }

    .device-mockup {
        transform: none;
        margin-top: 2rem;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }
}

.display-3 {
    font-size: 2.5rem !important;
}

@media (max-width: 767.98px) {
    .hero {
        min-height: 80vh;
    }

    .hero-content {
        text-align: center;
    }

    .device-mockup {
        transform: none;
        margin-top: 2rem;
    }

    .floating-shape:nth-child(n+3) {
        display: none;
    }

    .step-number {
        position: static;
        margin: 0 auto 1rem;
        transform: none;
    }
}

@media (max-width: 575.98px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .display-3 {
        font-size: 2rem !important;
    }

    .btn-lg {
        padding: 10px 24px !important;
        font-size: 1rem !important;
    }

    .floating-shape {
        display: none;
    }
}

/* Enhanced Interactive Animations */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
    transition: transform 0.1s;
}

/* Interactive Form Elements */
.form-control {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.form-control:focus {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(var(--bs-primary-rgb), 0.15);
}

.form-control.is-valid {
    animation: successPulse 0.6s ease-out;
}

.form-control.is-invalid {
    animation: errorShake 0.5s ease-in-out;
}

@keyframes successPulse {
    0% { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(25, 135, 84, 0); }
    100% { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0); }
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Card Hover Effects */
.card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.8s;
    z-index: 1;
    pointer-events: none;
}

.card:hover::before {
    left: 100%;
}

/* Enhanced Loading Animations */
.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bs-primary);
    animation: pulse-dot 1.4s infinite ease-in-out both;
}

.pulse-dot:nth-child(1) { animation-delay: -0.32s; }
.pulse-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes pulse-dot {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Floating Money Animation */
.floating-money {
    position: fixed;
    z-index: 1;
    pointer-events: none;
    color: var(--bs-warning);
    font-size: 1.5rem;
    animation: float-up 4s linear infinite;
}

@keyframes float-up {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Progress Enhancement */
.progress {
    height: 8px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.progress-bar {
    background: linear-gradient(90deg, var(--bs-primary), var(--bs-info));
    position: relative;
    overflow: hidden;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, .2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, .2) 50%,
        rgba(255, 255, 255, .2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 1rem 1rem;
    animation: progress-bar-stripes 1s linear infinite;
}

/* Modal Enhancements */
.modal.fade .modal-dialog {
    transform: translate(0, -50px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.show .modal-dialog {
    transform: translate(0, 0) scale(1);
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .floating-shape {
        animation: none;
    }

    .money-pulse {
        animation: none;
    }

    .floating-money {
        animation: none;
        display: none;
    }
}

/* Focus Styles for Accessibility */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: 2px solid var(--bs-warning);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .hero {
        background: #000;
        color: #fff;
    }

    .btn {
        border: 2px solid currentColor;
    }

    .card {
        border: 1px solid #ccc !important;
    }
}

/* Enhanced Mobile Optimizations */
@media (max-width: 768px) {
    /* Touch-friendly buttons */
    .btn {
        min-height: 44px;
        padding: 12px 24px;
        font-size: 1rem;
    }

    /* Improved form inputs */
    .form-control {
        min-height: 50px;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 16px;
    }

    /* Better spacing */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Optimized typography */
    .display-3 {
        font-size: 2.5rem !important;
        line-height: 1.2;
    }

    .lead {
        font-size: 1.1rem;
        line-height: 1.5;
    }

    /* Card optimization */
    .card {
        margin-bottom: 1.5rem;
        border-radius: 12px;
    }

    /* Hero section mobile */
    .hero {
        min-height: 90vh;
        padding: 2rem 0;
    }

    /* Modal mobile optimization */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .display-3 {
        font-size: 2rem !important;
    }

    .btn-lg {
        padding: 10px 20px;
        font-size: 0.95rem;
    }

    .hero {
        min-height: 85vh;
    }

    /* Stack benefits vertically */
    .row.benefits-row > div {
        margin-bottom: 1rem;
    }
}

/* Enhanced Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Skip navigation link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--bs-primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 9999;
    border-radius: 4px;
}

.skip-link:focus {
    top: 6px;
    color: white;
}

/* High contrast mode improvements */
@media (prefers-contrast: high) {
    .btn {
        border-width: 2px;
        font-weight: 600;
    }

    .card {
        border-width: 2px !important;
    }

    .form-control {
        border-width: 2px;
    }

    .progress {
        border: 1px solid;
    }
}

/* Focus management for accessibility */
.btn:focus-visible,
.form-control:focus-visible,
.nav-link:focus-visible {
    outline: 3px solid var(--bs-warning);
    outline-offset: 2px;
    box-shadow: 0 0 0 2px rgba(var(--bs-warning-rgb), 0.25);
}

/* Dark mode accessibility */
@media (prefers-color-scheme: dark) {
    :root {
        --bs-body-bg: #042858;
        --bs-body-color: #ffffff;
        --bs-dark-rgb: 255, 255, 255;
    }

    .hero {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    }

    .card {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* Reduced data mode */
@media (prefers-reduced-data: reduce) {
    .floating-money,
    .floating-shape {
        display: none;
    }

    .hero::before {
        display: none;
    }
}

/* Touch device optimizations - Enhanced */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .btn:hover,
    .card:hover,
    .nav-link:hover {
        transform: none;
        box-shadow: inherit;
    }

    /* Enhanced touch feedback */
    .btn:active,
    .nav-link:active,
    .card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }

    /* Larger touch targets */
    .btn,
    .form-control,
    .nav-link,
    .navbar-toggler {
        min-height: 44px;
        min-width: 44px;
    }

    /* Better spacing for touch */
    .navbar-nav .nav-link {
        padding: 1rem 1.5rem;
        margin: 0.25rem 0;
    }

    /* Touch-friendly modals */
    .modal-footer .btn {
        padding: 1rem 2rem;
        margin: 0.25rem;
        min-width: 120px;
    }

    /* Improved form controls */
    .form-control:focus {
        box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
    }

    /* Touch-friendly calculator */
    .calculator-card .btn {
        padding: 1.25rem 2rem;
        font-size: 1.1rem;
    }
}

/* Landscape phone optimizations */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding: 4rem 0 2rem;
    }

    .hero .display-3 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .hero .lead {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .hero-features {
        margin-bottom: 2rem;
    }

    .navbar-collapse {
        max-height: 60vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .py-5 {
        padding: 2rem 0 !important;
    }
}

/* Landscape mobile optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding: 1rem 0;
    }

    .modal-dialog {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .floating-elements,
    .loading-screen {
        display: none !important;
    }

    .hero {
        background: white !important;
        color: black !important;
        min-height: auto !important;
    }

    .card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
}


/* Benefits section - Fix contrast issues */
#benefits-container .card {
  background: white !important;
}

#benefits-container .card-title {
  color: #1f2937 !important;
  font-weight: 700 !important;
}

#benefits-container .card-text {
  color: #4b5563 !important;
}

#benefits-container .benefit-icon {
  color: var(--infinity-blue) !important;
  font-size: 3rem !important;
}

/* Benefits section - background and titles */
.benefits-section {
  background: linear-gradient(135deg, #1e40af 0%, #0ea5e9 100%) !important;
  position: relative;
  overflow: hidden;
}

.benefits-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.benefits-section .container {
  position: relative;
  z-index: 2;
}

.benefits-section .display-4 {
  color: white !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.benefits-section .lead {
  color: rgba(255, 255, 255, 0.95) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Steps section - Fix contrast issues */
#steps-container .card {
  background: white !important;
}

#steps-container .card-title {
  color: #1f2937 !important;
  font-weight: 700 !important;
}

#steps-container .card-text {
  color: #4b5563 !important;
}

#steps-container .step-number {
  background: var(--gradient-primary) !important;
  color: white !important;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.5rem;
  margin: 0 auto 1rem;
}

/* Steps section - background and titles */
.steps-section {
  background: linear-gradient(135deg, #86358B 0%, #1e40af 100%) !important;
  position: relative;
  overflow: hidden;
}

.steps-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.steps-section .container {
  position: relative;
  z-index: 2;
}

.steps-section .display-4 {
  color: white !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.steps-section .lead {
  color: rgba(255, 255, 255, 0.95) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Footer - Fix contrast issues */
.footer.bg-dark {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
}

.footer .text-black,
.footer .text-black-85,
.footer h5 {
  color: rgba(255, 255, 255, 0.95) !important;
  text-shadow: none !important;
}

.footer strong {
  color: white !important;
}

.footer .border-secondary {
  border-color: rgba(255, 255, 255, 0.2) !important;
}