/* ===== RESPONSIVE CSS ===== */

/* ===== TABLET STYLES (768px and below) ===== */
@media (max-width: 768px) {
    
    /* Typography adjustments */
    :root {
        --font-size-4xl: 2rem;          /* 32px - smaller for mobile */
        --font-size-3xl: 1.5rem;        /* 24px */
        --font-size-2xl: 1.25rem;       /* 20px */
        --font-size-xl: 1.125rem;       /* 18px */
        --spacing-3xl: 2rem;            /* Reduced spacing */
        --spacing-2xl: 1.5rem;
    }
    
    /* Container adjustments */
    .container {
        padding: 0 var(--spacing-lg);
    }
    
    /* Navigation */
    .nav-container {
        padding: 0 var(--spacing-lg);
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: var(--background);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: var(--spacing-2xl);
        transition: left var(--transition-normal);
        border-top: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .nav-link {
        padding: var(--spacing-lg);
        font-size: var(--font-size-lg);
        border-bottom: 1px solid var(--border-color);
        width: 100%;
        text-align: center;
    }
    
    /* Hero Section */
    .hero {
        padding: 100px 0 var(--spacing-2xl);
        min-height: auto;
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
        text-align: center;
    }
    
    .hero-title {
        font-size: var(--font-size-4xl);
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: var(--font-size-lg);
    }
    
    .hero-illustration {
        width: 200px;
        height: 200px;
    }
    
    .hero-illustration i {
        font-size: 80px;
    }
    
    /* Trust Section */
    .trust-indicators {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    /* Problem/Solution Section */
    .problem-solution .section-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
    }
    
    .problems-list {
        gap: var(--spacing-md);
    }
    
    .problem-item {
        padding: var(--spacing-md);
    }
    
    .solution-card {
        padding: var(--spacing-xl);
    }
    
    /* Newsletter Section */
    .newsletter-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
        text-align: center;
    }
    
    .form-card {
        padding: var(--spacing-xl);
    }
    
    /* Blog Preview */
    .blog-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
    
    /* CTA Features */
    .cta-features {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
        text-align: center;
    }
    
    /* Section padding adjustments */
    .trust-section,
    .problem-solution,
    .newsletter-section,
    .blog-preview,
    .testimonials,
    .final-cta,
    .footer {
        padding: var(--spacing-2xl) 0;
    }
}

/* ===== MOBILE STYLES (480px and below) ===== */
@media (max-width: 480px) {
    
    /* Further typography adjustments */
    :root {
        --font-size-4xl: 1.75rem;       /* 28px */
        --font-size-3xl: 1.375rem;      /* 22px */
        --font-size-2xl: 1.125rem;      /* 18px */
        --font-size-xl: 1rem;           /* 16px */
        --font-size-lg: 0.875rem;       /* 14px */
        --spacing-2xl: 1rem;
        --spacing-xl: 0.75rem;
    }
    
    /* Container */
    .container {
        padding: 0 var(--spacing-md);
    }
    
    /* Navigation */
    .nav-container {
        padding: 0 var(--spacing-md);
        height: 60px;
    }
    
    .nav-menu {
        top: 60px;
        height: calc(100vh - 60px);
        padding-top: var(--spacing-xl);
    }
    
    .nav-logo h2 {
        font-size: var(--font-size-xl);
    }
    
    /* Hero */
    .hero {
        padding: 80px 0 var(--spacing-xl);
    }
    
    .hero-container {
        gap: var(--spacing-xl);
    }
    
    .hero-title {
        font-size: var(--font-size-3xl);
    }
    
    .hero-subtitle {
        font-size: var(--font-size-base);
    }
    
    .hero-features {
        gap: var(--spacing-sm);
    }
    
    .feature span {
        font-size: var(--font-size-sm);
    }
    
    .hero-illustration {
        width: 150px;
        height: 150px;
    }
    
    .hero-illustration i {
        font-size: 60px;
    }
    
    /* Buttons */
    .btn {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: var(--font-size-sm);
    }
    
    .btn-large {
        padding: var(--spacing-md) var(--spacing-xl);
        font-size: var(--font-size-base);
    }
    
    /* Trust indicators */
    .trust-indicators {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .trust-item {
        padding: var(--spacing-lg);
    }
    
    .trust-number {
        font-size: var(--font-size-2xl);
    }
    
    /* Problem items */
    .problem-item {
        flex-direction: column;
        text-align: center;
        padding: var(--spacing-lg);
    }
    
    .problem-item i {
        align-self: center;
        margin-bottom: var(--spacing-sm);
        margin-top: 0;
    }
    
    /* Newsletter */
    .newsletter-content {
        gap: var(--spacing-xl);
    }
    
    .checklist-benefits {
        gap: var(--spacing-sm);
    }
    
    .benefit {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-xs);
    }
    
    .form-card {
        padding: var(--spacing-lg);
    }
    
    .form-group input {
        padding: var(--spacing-md);
    }
    
    /* Blog cards */
    .blog-card {
        margin: 0 var(--spacing-sm);
    }
    
    .blog-content {
        padding: var(--spacing-lg);
    }
    
    .blog-content h3 {
        font-size: var(--font-size-lg);
        line-height: 1.4;
    }
    
    /* Testimonials */
    .testimonial {
        padding: var(--spacing-lg);
        margin: 0 var(--spacing-sm);
    }
    
    /* Author credentials */
    .author-credentials {
        gap: var(--spacing-sm);
    }
    
    .credential {
        justify-content: center;
        text-align: center;
    }
    
    /* Footer sections */
    .footer-content {
        gap: var(--spacing-lg);
    }
    
    .footer-section {
        text-align: center;
    }
    
    /* Section headers */
    .section-header {
        margin-bottom: var(--spacing-2xl);
    }
    
    .section-header h2 {
        font-size: var(--font-size-2xl);
    }
    
    .section-header p {
        font-size: var(--font-size-base);
    }
    
    /* All sections padding */
    .trust-section,
    .problem-solution,
    .newsletter-section,
    .blog-preview,
    .testimonials,
    .final-cta {
        padding: var(--spacing-xl) 0;
    }
    
    .footer {
        padding: var(--spacing-2xl) 0 var(--spacing-lg);
    }
}

/* ===== VERY SMALL MOBILE (360px and below) ===== */
@media (max-width: 360px) {
    
    /* Extra small adjustments */
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .nav-container {
        padding: 0 var(--spacing-sm);
    }
    
    .hero-title {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    .hero-subtitle {
        font-size: var(--font-size-sm);
    }
    
    .btn {
        padding: var(--spacing-xs) var(--spacing-md);
        font-size: var(--font-size-xs);
    }
    
    .btn-large {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: var(--font-size-sm);
    }
    
    .trust-number {
        font-size: var(--font-size-xl);
    }
    
    .form-card,
    .solution-card,
    .testimonial {
        padding: var(--spacing-md);
    }
    
    .blog-content {
        padding: var(--spacing-md);
    }
    
    .hero-illustration {
        width: 120px;
        height: 120px;
    }
    
    .hero-illustration i {
        font-size: 40px;
    }
}

/* ===== LANDSCAPE MOBILE ADJUSTMENTS ===== */
@media (max-height: 500px) and (orientation: landscape) {
    
    .hero {
        padding: 80px 0 var(--spacing-lg);
        min-height: auto;
    }
    
    .hero-container {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-xl);
    }
    
    .hero-illustration {
        width: 120px;
        height: 120px;
    }
    
    .hero-illustration i {
        font-size: 50px;
    }
    
    .nav-menu {
        height: calc(100vh - 60px);
    }
}

/* ===== ACCESSIBILITY & PRINT STYLES ===== */

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0000ff;
        --text-primary: #000000;
        --text-secondary: #333333;
        --border-color: #000000;
    }
    
    .btn-primary {
        border: 2px solid #000000;
    }
    
    .btn-outline {
        border-width: 3px;
    }
}

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

/* Print styles */
@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    .navbar,
    .nav-toggle,
    .hero-illustration,
    .social-links,
    .newsletter-section,
    .final-cta {
        display: none !important;
    }
    
    .hero {
        padding: var(--spacing-lg) 0;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
}

/* ===== FOCUS STYLES FOR ACCESSIBILITY ===== */
.btn:focus,
.nav-link:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

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

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

/* ===== LOADING STATES ===== */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ===== ERROR STATES ===== */
.error {
    border-color: var(--accent-color) !important;
    background-color: rgba(220, 38, 38, 0.05);
}

.error-message {
    color: var(--accent-color);
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-xs);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.success-message {
    color: var(--secondary-color);
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-xs);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

/* ===== MICRO-INTERACTIONS ===== */
.btn:active {
    transform: translateY(1px);
}

.blog-card:hover .read-more {
    transform: translateX(4px);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width var(--transition-fast);
}

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

/* ===== DARK MODE SUPPORT (if needed in future) ===== */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here if requested */
    /* Currently maintaining light theme for professional banking appearance */
}