@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Open Sans', sans-serif;
    font-weight: 300;
    background: linear-gradient(to bottom, #f0f8ff, #ffffff);
    color: #333;
    line-height: 1.6;
    font-size: 1.1em;
}

h1, h2, h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    text-align: center;
}

h1 {
    font-size: 2.5em;
}

h2 {
    font-size: 1.8em;
}

h3 {
    font-size: 1.4em;
}

p, li {
    font-weight: 400;
    font-size: 1.1em;
}
h3 {
    text-align: center;
    color: #2c3e50;
        }
p {
    text-align: center;
    color: #666;
}
header {
    background: linear-gradient(45deg, #7425e3, #1fb1ff, #64fe3e);
    color: white;
    padding: 10px 20px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

footer {
    background: linear-gradient(45deg, #64fe3e, #1fb1ff, #7425e3);
    color: white;
    padding: 2px 10px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
}

nav ul li {
    display: inline-block;
    margin: 0 15px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: #ffd700;
}

.bestloanusa-hero {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
}
.bestloanusa-hero .bestloanusa-placeholder text {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: bestloanusa-handwriting 5s ease-out forwards;
}
@keyframes bestloanusa-handwriting {
    to {
        stroke-dashoffset: 0;
    }
}
.bestloanusa-hero .hero-image {
    background-image: url('https://via.placeholder.com/600x400?text=Cityscape+Skyline');
    background-size: cover;
    background-position: center;
}
.bestloanusa-hero .bestloanusa-apply-btn {
    background: linear-gradient(to right, #ff7e5f, #feb47b);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none; /* Prevent global link styles */
}
.bestloanusa-hero .bestloanusa-apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
 /* Ensure text styles are specific */
.bestloanusa-hero h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937; /* Gray-800 equivalent */
}
.bestloanusa-hero p {
    font-size: 1.125rem;
    color: #4b5563; /* Gray-600 equivalent */
}

.placeholder text {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: handwriting 5s ease-out forwards;
}

@keyframes handwriting {
    to {
        stroke-dashoffset: 0;
    }
}

.hero h2 {
    font-size: 2em;
    font-weight: 600;
    color: #fff;
}

.hero p {
    font-size: 1.1em;
    color: #fff;
}

.handwriting-svg {
    max-width: 100%;
    height: auto;
}

#handwriting-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: handwriting 5s linear forwards;
}

.application-container {
    max-width: 600px;
    margin: auto;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}


.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.benefit-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.benefit-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.benefit-icon {
    width: 50px;
    margin-bottom: 10px;
    animation: pulse 1.5s infinite;
}

.benefit-card h3 {
    font-size: 1.3em;
    margin-bottom: 10px;
    color: #2c3e50;
}

.benefit-card:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
}

.benefit-card.hidden {
    opacity: 0;
    transform: translateY(20px);
}

.enhanced-benefit-card p {
    font-size: 1.1em;
    color: #333;
}

.benefits-grid p {
    text-align: center;
    font-style: italic;
    color: #999;
    margin: 20px 0;
}

.progress-bar {
    display: flex;
    margin-bottom: 20px;
}
.progress-step {
    flex: 1;
    text-align: center;
    padding: 10px;
    background-color: #c2e9ff;
    border-radius: 8px;
    margin: 0 5px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
}
.progress-step.active {
    background-color: #83c3f7;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transform: scale(1.05);
}
.step {
    display: none;
}
.step.active {
    display: block;
}
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}
input[type="text"], input[type="email"], input[type="tel"], input[type="range"], input[type="date"], input[type="number"], select {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1em;
    transition: border-color 0.3s;
}
input:focus, select:focus {
    border-color: #2c3e50;
    outline: none;
}
.radio-group {
    margin-bottom: 20px;
    text-align: center;
}
.radio-group label {
    display: inline-block;
    margin-right: 20px;
}
.next-btn {
    padding: 10px 20px;
    background: #1d6ab8;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 10px 5px;
    align: center;
}
.prev-btn {
    padding: 10px 20px;
    background: #a0bfde;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 10px 5px;
}
.next-btn:hover, .prev-btn:hover {
    background: #34495e;
}
.range-slider {
    text-align: center;
}
.range-value {
    display: block;
    font-size: 1.2em;
    margin-top: 10px;
}
.amount-input {
    width: 200px;
    margin: 10px auto;
    display: block;
}
.time-select {
    display: flex;
    align-items: center;
}
.time-select select {
    width: auto;
    margin-left: 10px;
}
.congrats-message {
    text-align: center;
    margin-bottom: 20px;
}

.time-select label {
    font-weight: 600;
    display: flex;
    gap: 10px;
}

.time-select select {
    flex: 1;
}

.section {
    margin: 20px auto;
    border-radius: 12px;
    padding: 40px 30px;
    min-height: 100px;
    text-align: center;
    align-items: center;
    max-width: 1200px;
}

.services, .resources, .testimonials, .faq, .comparison-section {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 60px;
    padding: 40px;
}

.services div, .resources div, .testimonials div, .faq div {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.lender-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.comparison-section h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 2em;
    font-weight: 700;
    color: #001f3f;
    margin-bottom: 20px;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Open Sans', sans-serif;
    font-size: 1em;
    color: #333;
}

.comparison-table th, .comparison-table td {
    padding: 15px;
    border: 1px solid #e0e0e0;
    text-align: left;
    vertical-align: middle;
    display: table-cell;
}

.comparison-table th {
    background: linear-gradient(45deg, #7794b6, #dffaff);
    color: white;
    font-weight: 600;
    font-size: 1.1em;
}

.comparison-table td {
    background: #f9f9f9;
    position: relative;
}

.comparison-table .bestloanusa {
    background: linear-gradient(45deg, #6a8aff, #b2fbff);
    color: white;
}

.comparison-table .check {
    font-size: 1.2em;
    text-align: center;
    color: #28a745;
}

.comparison-table .cross {
    font-size: 1.2em;
    text-align: center;
    color: #4d4d4d;
}

.comparison-table .explanation {
    font-size: 0.88em;
    color: #333;
    display: inline;
    margin-left: 5px;
}

.comparison-table tr:hover .bestloanusa {
    background: linear-gradient(45deg, #7425e3, #1fb1ff, #64fe3e);
    transition: background 0.3s;
}


.testimonials {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.stats-box {
    text-align: center;
    margin-bottom: 20px;
    background: #e9f7ff;
    padding: 20px;
    border-radius: 8px;
}
.stats-box h3 {
    margin: 0;
    color: #007bff;
}
.filter-buttons {
    text-align: center;
    margin-bottom: 30px;
}
.filter-btn {
    background: #ffd21f;
    color: white;
    border: none;
    padding: 10px 20px;
    margin: 5px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s;
}
.filter-btn:hover {
    background: #0097b2;
}
.filter-btn.active {
    background: #0097b2;
}
.carousel {
    position: relative;
    overflow: hidden;
}
.testimonial-slider {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    transition: transform 0.5s ease;
}
.testimonial {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    width: 300px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: none; /* Initially hidden, shown by filter */
}
.testimonial.show {
    display: block;
}
.review-text {
    font-style: italic;
    color: #555;
}
.client-info {
    margin-top: 10px;
}
.stars {
    color: #ffd700;
}
.client-name {
    font-weight: bold;
    color: #333;
}
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 10;
}
.prev-btn {
    left: 10px;
}
.next-btn {
    right: 10px;
}
.carousel-dots {
    text-align: center;
    margin-top: 20px;
}
.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #ddd;
    border-radius: 50%;
    margin: 5px;
    cursor: pointer;
}
.dot.active {
    background: #007bff;
}

.faq details {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 8px;
    display: none;
}

.faq details.visible {
    display: block;
}

.faq summary {
    font-weight: 600;
    cursor: pointer;
}

#see-more-btn {
    background-color: #31edae;
    color: #001f3f;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 20px;
}

#see-more-btn:hover {
    background-color: #e6c200;
}

/* Initial hidden state for elements */
.animate-on-scroll {
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

/* Keyframes for sliding in from left */
@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Keyframes for sliding in from right */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Classes to trigger animations */
.visible-left {
  animation: slideInLeft 1s ease-out forwards;
}

.visible-right {
  animation: slideInRight 1s ease-out forwards;
}

.enhanced-why-section {
    background: linear-gradient(180deg, #001f65, #6895fd);
    padding: 40px 20px;
    text-align: center;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    border-radius: 12px;
    margin: 30px auto;
    max-width: 1500px;
}

.enhanced-why-section h2 {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 30px;
}

.enhanced-why-section > p {
    font-size: 1.1em;
    margin-bottom: 30px;
    color: white;
}

.enhanced-benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.enhanced-benefit-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    color: #333;
    position: relative;
    overflow: hidden;
}

.enhanced-benefit-card:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.enhanced-benefit-card .icon {
    font-size: 40px;
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
}

.enhanced-why-section .enhanced-benefit-card:nth-child(1) .icon::before { content: "🌐"; animation: pulse 1.5s infinite; }
.enhanced-why-section .enhanced-benefit-card:nth-child(2) .icon::before { content: "⏱️"; animation: rotate 1.5s infinite; }
.enhanced-why-section .enhanced-benefit-card:nth-child(3) .icon::before { content: "💸"; animation: pulse 1.5s infinite; }
.enhanced-why-section .enhanced-benefit-card:nth-child(4) .icon::before { content: "🔒"; animation: bounce 1.5s infinite; }
.enhanced-why-section .enhanced-benefit-card:nth-child(5) .icon::before { content: "👨‍💼"; animation: pulse 1.5s infinite; }
.enhanced-why-section .enhanced-benefit-card:nth-child(6) .icon::before { content: "📅"; animation: rotate 1.5s infinite; }
.enhanced-why-section .enhanced-benefit-card:nth-child(7) .icon::before { content: "📈"; animation: bounce 1.5s infinite; }
.enhanced-why-section .enhanced-benefit-card:nth-child(8) .icon::before { content: "📚"; animation: pulse 1.5s infinite; }

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.enhanced-apply-now-btn {
    background: linear-gradient(to right, #ff7e5f, #feb47b);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.enhanced-apply-now-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.enhanced-apply-now-btn::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: width 0.6s ease, height 0.6s ease;
}

.enhanced-apply-now-btn:hover::after {
    width: 200px;
    height: 200px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.apply-now-btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: #1068e3;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    margin: 20px 0;
    transition: background-color 0.3s;
}

.apply-now-btn:hover {
    background-color: #e6c200;
}

#apply-now-fixed {
    position: fixed;
    right: 20px;
    top: 5%;
    transform: translateY(-50%);
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.hamburger {
    cursor: pointer;
    font-size: 2rem;
    padding: 10px;
    display: none;
}

@media (min-width: 769px) {
    .testimonial {
        min-width: calc(25% - 16px);
    }
    .testimonial-slider {
        overflow: hidden;
    }
    .hamburger {
        display: none !important;
    }
    .nav-menu {
        display: block !important;
    }
    .blog-link {
        color: #001f3f;
        text-decoration: none;
        font-weight: 600;
        transition: color 0.3s;
    }
    .blog-link:hover {
        color: #ffd700;
    }
}


@media (max-width: 768px) {
    .bestloanusa-hero .hero-image {
        height: 16rem; /* Adjusted for mobile */
    }

    .placeholder text {
        font-size: 40px;
        stroke-width: 1.5;
        stroke-dasharray: 1500;
    }
    footer {
        font-size: 0.9em;
    }
    nav ul li {
        display: block;
        margin: 10px 0;
    }
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
    .container {
        margin: 30px auto;
        padding: 30px 20px;
        max-width: 100%;
        overflow: hidden;
        text-align: center;
    }
    .progress-bar {
        flex-direction: column;
    }
    .progress-step {
        margin: 5px 0;
    }
    .range-slider {
        flex-direction: column;
        justify-content: center;
    }
    .hamburger {
        display: block;
        position: absolute;
        top: 20px;
        right: 20px;
    }
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: linear-gradient(135deg, #7f30cb, #01dcba);
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
        z-index: 1001;
    }
    .nav-menu.active {
        display: flex !important;
    }
    .nav-menu ul {
        flex-direction: column;
        gap: 20px;
        padding: 0;
        margin: 0;
    }
    .nav-menu ul li {
        margin: 20px 0;
        text-align: center;
    }
    .section {
        padding: 30px 15px;
    }
    .hero {
        padding: 20px 10px;
    }
    .hero h2 {
        font-size: 1.8em;
    }
    .hero p {
        font-size: 1em;
    }
    #apply-now-fixed {
        right: 10px;
        bottom: 20px;
        transform: translateX(0);
        width: 90%;
        max-width: 200px;
        margin: 0 auto;
    }
    .testimonial {
        min-width: 100%;
        padding: 15px;
    }
    .review-text {
        font-size: 1em;
    }
    .client-name {
        font-size: 0.85em;
    }
    .testimonial-slider {
        scroll-behavior: smooth;
    }
    .filter-buttons {
        flex-wrap: wrap;
        gap: 5px;
    }
    .filter-btn {
        padding: 8px 15px;
        font-size: 0.9em;
    }
    .carousel-btn {
        padding: 8px;
        font-size: 1em;
    }
    .stats-box h3 {
        font-size: 1.2em;
    }
    .stats-box p {
        font-size: 0.9em;
    }
    .comparison-table thead {
        display: none;
    }
    .comparison-table tbody,
    .comparison-table tr,
    .comparison-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    .comparison-table tr {
        margin-bottom: 20px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        background: #f9f9f9;
        padding: 10px;
    }
    .comparison-table td {
        border: none;
        border-bottom: 1px solid #e0e0e0;
        padding: 10px 0;
        text-align: left;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
    }
    .comparison-table td::before {
        content: attr(data-label);
        flex: 0 0 30%;
        padding-left: 10px;
        font-weight: bold;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .comparison-table td .content {
        flex: 1;
        display: flex;
        align-items: center;
    }
    .comparison-table td .content span:first-child {
        margin-right: 10px;
    }
    .comparison-table td .explanation {
        font-size: 0.72em;
        display: inline;
        margin-left: auto;
    }
    .comparison-table td[data-label="BestLoanUSA"]::before {
        color: #001f3f;
    }
    .comparison-table td[data-label="Banks"]::before {
        color: #4d4d4d;
    }
    .comparison-table td:last-child {
        border-bottom: none;
    }
    .comparison-table td:first-child {
        font-weight: bold;
        padding-left: 10px;
        display: block;
    }
    .comparison-table td:first-child::before {
        display: none;
    }
    .comparison-table .bestloanusa::before {
        display: none;
    }
    .enhanced-why-section h2 {
        font-size: 2em;
    }
    .enhanced-benefits-grid {
        grid-template-columns: 1fr;
    }
    .enhanced-apply-now-btn {
        width: 90%;
        max-width: 300px;
    }
    /* Adjust animation duration or style if needed for mobile */
    .visible-left, .visible-right {
      animation-duration: 0.8s; /* Slightly faster on mobile */
    }
}
