/* ============================================
   Responsive Design - Mobile First
   ============================================ */

/* Tablet Styles (768px - 1023px) */
@media screen and (max-width: 1023px) {
    :root {
        --font-size-5xl: 3rem;    /* 48px */
        --font-size-4xl: 2rem;    /* 32px */
        --font-size-3xl: 1.5rem;  /* 24px */
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
    }
    
    .hero-image {
        order: -1;
    }
    
    .hero-illustration {
        width: 300px;
        height: 300px;
    }
    
    .hero-illustration i {
        font-size: 6rem;
    }
    
    .steps {
        flex-direction: column;
    }
    
    .step-connector {
        transform: rotate(90deg);
        margin: var(--spacing-md) 0;
    }
    
    .step-connector i {
        transform: rotate(0deg);
    }
    
    .features-grid,
    .services-grid,
    .benefits-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Styles (320px - 767px) */
@media screen and (max-width: 767px) {
    :root {
        --font-size-5xl: 2.5rem;  /* 40px */
        --font-size-4xl: 1.875rem; /* 30px */
        --font-size-3xl: 1.5rem;  /* 24px */
        --spacing-4xl: 4rem;       /* 64px */
        --spacing-3xl: 3rem;       /* 48px */
    }
    
    .container {
        padding: 0 var(--spacing-md);
    }
    
    .section {
        padding: var(--spacing-3xl) 0;
    }
    
    /* Navigation */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: var(--header-height);
        flex-direction: column;
        background-color: var(--color-white);
        width: 100%;
        text-align: center;
        transition: var(--transition-base);
        box-shadow: var(--shadow-lg);
        padding: var(--spacing-xl) 0;
        gap: var(--spacing-lg);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    
    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
    
    .nav-cta {
        margin-top: var(--spacing-md);
    }
    
    .nav-brand {
        width: 100%;
    }
    
    .logo {
        width: 100%;
    }
    
    /* Hero Section */
    .hero {
        padding: var(--spacing-2xl) 0;
        min-height: auto;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .hero-image {
        order: -1;
    }
    
    .hero-badge {
        font-size: var(--font-size-xs);
        padding: var(--spacing-xs) var(--spacing-md);
    }
    
    .hero-title {
        font-size: var(--font-size-4xl);
        line-height: 1.2;
    }
    
    .gradient-text {
        display: inline;
    }
    
    .hero-subtitle {
        font-size: var(--font-size-base);
    }
    
    .hero-cta {
        flex-direction: column;
    }
    
    .hero-cta .btn {
        width: 100%;
        justify-content: center;
    }
    
    .hero-image-wrapper {
        height: 300px;
        max-width: 100%;
        transform: none;
    }
    
    .hero-image-wrapper:hover {
        transform: scale(1.02);
    }
    
    .floating-card {
        display: none;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .stat-number {
        font-size: var(--font-size-2xl);
    }
    
    .hero-contact {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-xs);
    }
    
    /* Features & Services */
    .features-grid,
    .services-grid,
    .benefits-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .feature-card,
    .service-card {
        padding: var(--spacing-lg);
    }
    
    /* Steps */
    .step {
        max-width: 100%;
    }
    
    .step-connector {
        margin: var(--spacing-sm) 0;
    }
    
    /* Newsletter */
    .newsletter-title {
        font-size: var(--font-size-3xl);
    }
    
    .newsletter-subtitle {
        font-size: var(--font-size-base);
    }
    
    .form-group {
        flex-direction: column;
    }
    
    .form-input,
    .btn {
        width: 100%;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    /* Section Headers */
    .section-title {
        font-size: var(--font-size-3xl);
    }
    
    .section-subtitle {
        font-size: var(--font-size-base);
    }
    
    /* Page Hero */
    .page-title {
        font-size: var(--font-size-3xl);
    }
    
    .page-subtitle {
        font-size: var(--font-size-base);
    }
    
    /* About Page */
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .about-illustration {
        width: 250px;
        height: 250px;
    }
    
    .about-illustration i {
        font-size: 4rem;
    }
    
    .values-grid,
    .partners-grid {
        grid-template-columns: 1fr;
    }
    
    /* Pricing Grid */
    .pricing-grid {
        grid-template-columns: 1fr;
    }
    
    /* Lender Cards */
    .lenders-grid {
        grid-template-columns: 1fr;
    }
    
    /* Contact Page */
    .contact-wrapper {
        grid-template-columns: 1fr;
    }
    
    .contact-method {
        flex-direction: column;
        text-align: center;
    }
    
    .contact-icon {
        margin: 0 auto;
    }
    
    /* CTA Section */
    .cta-title {
        font-size: var(--font-size-3xl);
    }
    
    .cta-subtitle {
        font-size: var(--font-size-base);
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    .cta-buttons .btn {
        width: 100%;
    }
}

/* Small Mobile (320px - 479px) */
@media screen and (max-width: 479px) {
    :root {
        --font-size-5xl: 2rem;    /* 32px */
        --font-size-4xl: 1.75rem; /* 28px */
    }
    
    .hero-title {
        font-size: var(--font-size-3xl);
    }
    
    .hero-image-wrapper {
        height: 250px;
    }
    
    .hero-stats {
        gap: var(--spacing-sm);
    }
    
    .stat-number {
        font-size: var(--font-size-xl);
    }
    
    .feature-icon,
    .service-icon {
        width: 60px;
        height: 60px;
    }
    
    .feature-icon i,
    .service-icon i {
        font-size: 1.5rem;
    }
    
    .step-icon {
        width: 80px;
        height: 80px;
    }
    
    .step-icon i {
        font-size: 2rem;
    }
}

/* Large Desktop (1440px+) */
@media screen and (min-width: 1440px) {
    :root {
        --container-max-width: 1400px;
    }
    
    .hero-content {
        gap: var(--spacing-4xl);
    }
    
    .features-grid,
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .nav-toggle,
    .hero-cta,
    .newsletter {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .section {
        page-break-inside: avoid;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --color-primary: #0052CC;
        --color-dark: #000000;
        --color-gray: #333333;
    }
    
    .btn-primary {
        border: 2px solid var(--color-primary);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}
