@media (max-width: 768px) {

    /* Container Reset */
    .uk-loan-page-container {
        width: 100% !important;
        max-width: 100vw !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
        margin-left: auto;
        margin-right: auto;
        overflow-x: hidden;
    }



    /* Hero Section Mobile Redesign */
    .hero {
        padding: 100px 0 10px;
        /* Reduced side padding to rely on container */
        text-align: center;
        min-height: auto;
        overflow: hidden;
        width: 100%;
    }

    .hero-grid {
        flex-direction: column;
        gap: 2rem;
        width: 100%;
        margin: 0;
    }

    .hero-text {
        padding: 0 20px;
        width: 100%;
    }

    .hero-badge {
        font-size: 25px;
        /* Adjusted to fit all screens */
        margin-bottom: 1rem;

        color: #fec64f;
        font-weight: 600;
        display: block;
        width: 100%;
        line-height: 1.2;
    }

    .hero h1 {
        font-size: 28px;
        line-height: 1.25;
        margin-bottom: 1.5rem;
        width: 100%;
    }

    .hero-subtitle {
        font-size: 16px;
        line-height: 1.6;
        margin-bottom: 2rem;
        opacity: 0.9;
        color: #ffffff;
        width: 100%;
    }

    /* Partners Mobile Fix */
    .partners {
        width: 100%;
    }

    .partners p {
        font-size: 18px;
        margin-bottom: 1.25rem;
    }

    .partner-list {
        width: 100% !important;
        height: auto !important;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
        max-width: 100%;
        margin: 0 auto;
    }

    .partner-list img {
        height: 65px !important;
        padding: 0.4rem 0.6rem;
        background: #ffffff;
        border-radius: 8px;
        max-width: 45%;
        /* Ensure they don't force width */
        object-fit: contain;
    }

    /* CTA Buttons Mobile */
    .hero-cta {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
        align-items: center;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        max-width: 280px;
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }

    .hero-image {
        display: block !important;
        width: 100% !important;
        margin-top: 0.5rem !important;
        text-align: center !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .hero-image-wrapper {
        transform: none !important;
        width: 100% !important;
        display: block !important;
        max-width: 400px;
        margin: 0 auto;
    }

    .hero-image img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        border-radius: 12px;
        display: block;
    }

    /* Prevent overlay from hiding image on mobile */
    .hero-image-wrapper::after {
        display: none !important;
    }

    /* Form Rows Fix */
    .form-row {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    /* Eligibility Section Mobile */
    .split {
        grid-template-columns: 1fr !important;
        gap: 2.5rem;
        width: 100%;
    }

    .eligibility-content {
        padding: 2rem 1rem;
        border-radius: 24px;
        width: 100%;
    }

    .eligibility-header h2 {
        font-size: 1.75rem;
    }

    .checklist li {
        font-size: 0.95rem;
        gap: 0.75rem;
    }

    .stats {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto;
        width: 100%;
        gap: 1rem;
    }

    .stat-card {
        padding: 1.5rem !important;
        border-radius: 20px !important;
    }

    .stat-num {
        font-size: 2.25rem !important;
    }

    .stat-label {
        font-size: 0.9rem !important;
    }

    /* Grids Mobile */
    .grid-3,
    .course-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem;
        width: 100%;
    }

    .doc-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
        width: 100%;
    }

    .doc-card {
        flex-direction: row !important;
        padding: 0.75rem !important;
        gap: 0.75rem !important;
        text-align: left !important;
        justify-content: flex-start !important;
        font-size: 0.85rem !important;
        border-radius: 12px !important;
        height: auto !important;
        min-height: 60px;
    }

    .doc-card i {
        width: 32px !important;
        height: 32px !important;
        font-size: 1rem !important;
        flex-shrink: 0;
    }

    /* Make the last document card full width and centered */
    .doc-card:last-child {
        grid-column: span 2;
        justify-content: center !important;
        text-align: center !important;
    }

    .course-items div {
        padding: 4px 1rem !important;
        margin: 5px 0 !important;
        font-size: 0.95rem !important;
        justify-content: flex-start !important;
        background: none !important;
        border: none !important;
    }

    .course-items div::before {
        font-size: 0.45rem !important;
    }

    .card {
        padding: 1.5rem !important;
        border-radius: 20px !important;
    }

    .icon {
        font-size: 2.25rem !important;
        margin-bottom: 0.75rem !important;
    }

    .card h3 {
        font-size: 1.25rem !important;
        line-height: 1.4 !important;
    }

    /* Section Spacing Mobile */
    section {
        padding: 30px 0;
        /* Horizontal padding handled by container */
        width: 100%;
    }

    h2 {
        font-size: 22px;
        line-height: 1.3;
        margin-bottom: 1rem;
    }

    .subtitle {
        font-size: 16px !important;
        margin-bottom: 1.5rem;
        padding: 0 10px;
    }

    /* Modal Mobile */
    .modal-content {
        width: 90% !important;
        max-width: 95vw !important;
        padding: 2rem 1.5rem;
    }


}

/* Extra Small Mobile (360px and below) */
@media (max-width: 360px) {
    .hero h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.35rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
    }

    .stat-num {
        font-size: 2rem;
    }

    .icon {
        font-size: 2rem;
    }
}

/* Landscape Mobile Orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 80px 20px 40px;
    }

    .hero h1 {
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
    }

    .hero-subtitle {
        margin-bottom: 1.5rem;
    }

    section {
        padding: 40px 20px;
    }
}

/* Touch Device Enhancements */
@media (hover: none) and (pointer: coarse) {

    /* Larger touch targets */
    .btn-primary,
    .btn-secondary {
        min-height: 48px;
    }

    .nav-links a {
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .faq-q {
        min-height: 56px;
    }

    .mobile-toggle {
        min-width: 48px;
        min-height: 48px;
    }

    /* Remove hover effects on touch */
    .card:hover {
        transform: none;
    }

    .btn-primary:hover {
        transform: none;
    }

    /* Active states for touch */
    .btn-primary:active {
        transform: scale(0.98);
    }

    .card:active {
        transform: scale(0.99);
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Print Styles */
@media print {

    .hero-cta,
    .btn-primary,
    .btn-secondary,
    .modal {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .card,
    .stat-card,
    .course-category {
        border: 1px solid #ccc;
        break-inside: avoid;
    }
}