/* Responsive rules extracted from the existing stylesheet */

/* Application steps */
@media (max-width: 900px) {
    .steps-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 16px;
    }

    .step-image {
        aspect-ratio: 1.3 / 1;
    }
}

@media (max-width: 480px) {
    .application-steps {
        padding: 14px 12px 24px;
    }

    .steps-title {
        font-size: 20px;
    }

    .steps-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .step-image {
        aspect-ratio: 1.4 / 1;
    }

    .step-card h3 {
        font-size: 16px;
    }

    .step-card p {
        font-size: 14px;
    }

    .desktop-break {
        display: none;
    }
}

/* Loan products */
@media (max-width: 768px) {
    .loan-products {
        padding: 14px 12px 20px;
    }

    .loan-products-title {
        font-size: 21px;
    }

    .loan-table {
        min-width: 800px;
        font-size: 13px;
    }

        .loan-table th,
        .loan-table td {
            padding: 9px;
        }
}

@media (max-width: 480px) {
    .loan-products-title {
        font-size: 19px;
    }

    .loan-table {
        min-width: 760px;
        font-size: 12px;
    }
}

/* Payment information */
@media (max-width: 768px) {
    .payment-header {
        padding: 14px 12px 16px;
    }

        .payment-header h2 {
            font-size: 27px;
        }

        .payment-header p {
            font-size: 13px;
        }

    .payment-disclaimer {
        padding: 10px 12px 16px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .payment-header h2 {
        font-size: 23px;
    }

    .payment-header p {
        font-size: 12px;
    }

    .payment-header {
        padding: 12px 8px;
    }

    .payment-disclaimer {
        font-size: 12px;
        line-height: 1.8;
    }

        .payment-disclaimer p + p {
            margin-top: 4px;
        }

    .disclaimer-separator {
        padding: 0 2px;
    }
}

/* About section */
@media (max-width: 900px) {
    .service-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .about-container {
        padding-right: 20px;
        padding-left: 20px;
    }
}

@media (max-width: 600px) {
    .about-hero {
        padding: 38px 18px 42px;
    }

        .about-hero h1 {
            font-size: 29px;
        }

        .about-hero p {
            font-size: 14px;
        }

    .about-container {
        padding: 8px 16px 35px;
    }

    .about-section {
        margin-top: 30px;
    }

    .about-section-heading {
        gap: 11px;
        margin-bottom: 16px;
    }

    .about-number {
        flex-basis: 40px;
        width: 40px;
        height: 40px;
        border-radius: 10px;
        font-size: 14px;
    }

    .about-section-heading h2 {
        font-size: 20px;
    }

    .about-subtitle {
        font-size: 12px;
        line-height: 1.7;
    }

    .about-content {
        padding-left: 0;
    }

        .about-content p {
            font-size: 14px;
            line-height: 1.9;
        }

    .service-grid,
    .benefit-list,
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .service-card {
        padding: 18px;
    }

        .service-card h3 {
            font-size: 16px;
        }

    .rate-card {
        margin-top: 30px;
        padding: 22px 18px;
    }

    .rate-content h2 {
        font-size: 20px;
    }

    .rate-button {
        width: 100%;
        justify-content: center;
    }

    .office-card {
        gap: 12px;
        padding: 18px;
    }

    .office-icon {
        flex-basis: 40px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

/* Repayment information */
@media (max-width: 768px) {
    .repayment-page {
        padding: 22px 16px 30px;
    }

    .repayment-header {
        margin-bottom: 24px;
    }

        .repayment-header h1 {
            font-size: 27px;
        }

    .repayment-grid {
        gap: 14px;
    }

    .repayment-card {
        padding: 19px;
    }

        .repayment-card h2 {
            font-size: 18px;
        }
}

@media (max-width: 540px) {
    .repayment-page {
        padding: 18px 12px 26px;
    }

    .repayment-header h1 {
        font-size: 24px;
    }

    .repayment-header p {
        font-size: 13px;
    }

    .repayment-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .repayment-card {
        padding: 20px;
        border-radius: 12px;
    }

        .repayment-card h2 {
            font-size: 19px;
        }

    .repayment-notice {
        padding: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .repayment-card {
        transition: none;
    }

        .repayment-card:hover {
            transform: none;
        }
}

/* Confirmation button */
@media (min-width: 768px) {
    .confirm-button {
        width: 500px;
        max-width: 90%;
    }
}

@media (max-width: 768px) {
    .consent-text {
        font-size: 14px;
    }

    .confirm-button {
        height: 55px;
        font-size: 24px;
        letter-spacing: 2px;
    }
}

/* Footer */
@media (min-width: 992px) {
    .footer-text {
        padding-bottom: 15px;
    }
}

/* Loan application layout */
@media (max-width: 991.98px) {
    .desktop-layout {
        gap: 12px;
    }

    .left-panel {
        flex-basis: 38%;
        width: 38%;
    }

    .right-panel {
        flex-basis: 62%;
        width: 62%;
        max-width: 62%;
    }

    .loan-label {
        font-size: clamp(21px, 3vw, 32px) !important;
    }

    #firstcon .custom-input {
        font-size: 17px !important;
    }

    #firstcon .loan-selector > span:first-child {
        font-size: 17px;
    }

    #firstcon .consent-text {
        font-size: 14px;
    }

    .steps-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px 14px;
    }

    .step-image {
        aspect-ratio: 1.3 / 1;
    }
}

/* Mobile loan application layout */
@media (max-width: 767.98px) {
    #firstcon {
        padding: 0;
    }

        #firstcon > .row {
            margin: 0 !important;
            padding: 8px !important;
            border-radius: 14px;
        }

    .desktop-layout {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .left-panel {
        display: block;
        width: 100% !important;
        max-width: none !important;
        flex: 0 0 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible;
    }

    .side-image {
        display: block;
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        max-height: none !important;
        object-fit: contain;
        object-position: center;
        margin: 0;
    
    }

    .right-panel {
        width: 100%;
        max-width: 100%;
        flex: 1 1 auto;
        padding: 6px 2px !important;
    }

    .loan-label {
        font-size: clamp(21px, 5.5vw, 30px) !important;
    }

    #firstcon .right-panel > .row {
        margin: 12px 0 0 !important;
        padding: 10px !important;
        border-radius: 14px;
    }

    #firstcon .label-input100 {
        font-size: 15px;
    }

    #firstcon .loan-selector {
        min-height: 44px;
        padding: 9px 11px;
    }

        #firstcon .loan-selector > span:first-child {
            font-size: 16px;
        }

    #firstcon .loan-item span {
        font-size: 15px;
    }

    #firstcon .custom-input {
        height: 44px !important;
        font-size: 16px !important;
    }

    #firstcon .earthinfo {
        margin-top: 8px;
    }

    #firstcon .bird-card {
        padding: 12px;
    }

    #firstcon .bird-row span {
        font-size: 14px;
    }

    #firstcon .consent-section {
        padding-top: 6px;
    }

    #firstcon .consent-text {
        padding: 10px 4px;
        font-size: 13px;
        line-height: 1.65;
    }

    #firstcon .confirm-button {
        width: 100%;
        min-height: 52px;
        padding: 10px;
        font-size: 21px;
        border-width: 3px;
        border-radius: 12px;
    }

    .application-steps {
        padding: 16px 12px 24px;
    }

    .steps-title {
        font-size: 21px;
        line-height: 1.4;
    }

    .steps-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px 12px;
    }

    .step-image {
        aspect-ratio: 1.15 / 1;
        object-fit: contain;
    }

    .step-card h3 {
        font-size: 15px;
    }

    .step-card p {
        font-size: 13px;
        line-height: 1.65;
    }

    .desktop-break {
        display: none;
    }

    .loan-products {
        padding: 12px;
    }

    .loan-products-title {
        font-size: 21px;
        line-height: 1.5;
    }

    .loan-table {
        min-width: 780px;
        font-size: 12px;
    }

        .loan-table th,
        .loan-table td {
            padding: 8px;
            font-size: 12px;
        }

    .footer-text {
        padding: 12px 12px 8px;
        font-size: 11px;
    }
}

/* Very small mobile: keep the image full width without a height limit */
@media (max-width: 380px) {
    #firstcon > .row {
        padding: 5px !important;
    }

    .left-panel {
        width: 100% !important;
        max-width: none !important;
        flex-basis: 100% !important;
    }

    .side-image {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
    }

    #firstcon .right-panel > .row {
        padding: 8px !important;
    }

    #firstcon .loan-selector > span:first-child {
        font-size: 14px;
    }

    #firstcon .custom-input {
        font-size: 15px !important;
    }

    .steps-grid {
        gap: 16px 8px;
    }

    .step-card h3 {
        font-size: 14px;
    }

    .step-card p {
        font-size: 12px;
    }
}

/* Floating LINE button */
@media (max-width: 767.98px) {
    .floating-line-button {
        right: max(12px, env(safe-area-inset-right));
        bottom: max(12px, env(safe-area-inset-bottom));
        min-width: 116px;
        gap: 7px;
        padding: 8px 14px 8px 9px;
        font-size: 14px;
    }

        .floating-line-button .line-icon,
        .floating-line-button .line-icon svg {
            flex-basis: 32px;
            width: 32px;
            height: 32px;
        }
}
