/* Base styles and variables */
:root {
    --primary-color: #4c6ef5;
    --secondary-color: #748ffc;
    --accent-color: #228be6;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --grey-color: #e9ecef;
    --success-color: #37b24d;
    --warning-color: #f59f00;
    --danger-color: #f03e3e;
    --border-radius: 8px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    --transition: all 0.3s ease;
}

/* Reset and base styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 62.5%; /* 10px base size for easier rem calculations */
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: 1.6rem;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1.5rem;
    line-height: 1.2;
    font-weight: 600;
    color: var(--dark-color);
}

h1 {
    font-size: 4rem;
    font-weight: 700;
}

h2 {
    font-size: 3.2rem;
    position: relative;
    margin-bottom: 3rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 0;
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

h3 {
    font-size: 2.4rem;
}

h4 {
    font-size: 2rem;
}

p {
    margin-bottom: 1.5rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-color);
}

ul, ol {
    padding-left: 2rem;
    margin-bottom: 1.5rem;
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.site-header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    position: relative;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.site-logo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
}

.site-logo:hover {
    color: var(--primary-color);
}

/* Navigation */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--dark-color);
    margin: 5px 0;
    transition: var(--transition);
}

.main-nav {
    margin-left: auto;
}

.main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

.main-nav a {
    color: var(--dark-color);
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 0;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.main-nav a:hover {
    color: var(--primary-color);
}

.main-nav a:hover::after {
    width: 100%;
}

/* Language Selector */
.language-selector {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.current-language {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.current-language img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 0.5rem;
    width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 10;
}

.language-selector.active .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.language-option:hover {
    background-color: var(--grey-color);
}

.language-option img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

/* Hero Section */
.hero-section {
    padding: 8rem 0;
    position: relative;
    overflow: hidden;
}

.gradient-bg {
    background: linear-gradient(135deg, #4c6ef5, #15aabf);
    color: white;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.hero-text {
    flex: 1;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.hero-section h1,
.hero-section p {
    color: white;
}

.lead {
    font-size: 2rem;
    margin-bottom: 3rem;
}

/* Buttons and CTAs */
.cta-button {
    display: inline-block;
    padding: 1.2rem 2.4rem;
    background-color: var(--accent-color);
    color: white;
    font-weight: 600;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    font-size: 1.6rem;
}

.cta-button:hover {
    background-color: #1c7ed6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: white;
}

.cta-button:active {
    transform: translateY(0);
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 139, 230, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(34, 139, 230, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 139, 230, 0);
    }
}

/* Content Sections */
.content-section {
    padding: 8rem 0;
}

.alt-bg {
    background-color: #f8f9fa;
}

.section-header {
    text-align: center;
    margin-bottom: 5rem;
}

.section-header h2::after {
    left: 50%;
    transform: translateX(-50%);
}

.section-description {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.8rem;
}

/* Content Layouts */
.content-columns {
    display: flex;
    gap: 4rem;
    margin-bottom: 4rem;
}

.content-columns.reverse {
    flex-direction: row-reverse;
}

.text-column {
    flex: 1;
}

.image-column {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tips-column {
    flex: 1;
}

.card-image {
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.card-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.card-image img {
    max-width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.card-image:hover img {
    transform: scale(1.05);
}

/* Benefit list */
.benefit-list {
    list-style: none;
    padding: 0;
}

.benefit-list li {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.benefit-list .icon {
    color: var(--success-color);
    font-weight: bold;
}

/* ZIP Search Containers */
.zip-search-container {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 3rem;
    box-shadow: var(--box-shadow);
    margin: 4rem 0;
}

.center-aligned {
    text-align: center;
}

.zip-search-form h3 {
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
}

.input-group input {
    flex: 1;
    padding: 1.2rem 1.5rem;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    font-size: 1.6rem;
    outline: none;
    transition: var(--transition);
}

.input-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 110, 245, 0.2);
}

.input-group .cta-button {
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.form-caption {
    font-size: 1.4rem;
    margin-top: 1rem;
    color: #6c757d;
}

/* Company Cards */
.company-cards {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 4rem;
}

.company-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem;
    display: flex;
    gap: 2rem;
    transition: var(--transition);
}

.company-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.company-logo {
    flex: 0 0 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.company-logo img {
    max-width: 100%;
    height: auto;
}

.company-info {
    flex: 1;
}

.company-features {
    list-style: none;
    padding: 0;
    margin-bottom: 2rem;
}

.company-features li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.5rem;
}

.company-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

/* Grid Layouts */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.grid-item {
    display: flex;
}

.cost-card, .choose-card, .tips-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2.5rem;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.cost-card:hover, .choose-card:hover, .tips-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.card-icon {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.choose-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.card-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
    border-radius: 50%;
    margin-bottom: 1.5rem;
}

/* Cost Table */
.cost-table-container {
    margin: 4rem 0;
    text-align: center;
}

.table-responsive {
    overflow-x: auto;
}

.cost-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.cost-table th, .cost-table td {
    padding: 1.2rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.cost-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.cost-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.table-caption {
    font-size: 1.4rem;
    color: #6c757d;
    text-align: center;
}

/* Tips List */
.tips-list {
    list-style: none;
    padding: 0;
}

.tips-list li {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.tip-number {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.8rem;
    flex: 0 0 50px;
}

.tip-content {
    flex: 1;
}

/* Worth Section */
.worth-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.worth-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2.5rem;
    transition: var(--transition);
}

.worth-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.common-expenses {
    grid-column: 1 / -1;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2.5rem;
    margin-top: 2rem;
}

.expense-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.expense-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
}

.expense-cost {
    font-weight: 600;
    color: var(--primary-color);
}

.expense-note {
    font-style: italic;
    color: #6c757d;
    text-align: center;
}

/* CTA Section */
.cta-section {
    padding: 8rem 0;
    text-align: center;
}

.final-cta {
    max-width: 800px;
    margin: 0 auto;
}

.final-cta h2, .final-cta p {
    color: white;
}

.final-cta p {
    font-size: 1.8rem;
    margin-bottom: 3rem;
}

/* FAQ Section */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

details {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

summary {
    padding: 1.5rem;
    cursor: pointer;
    position: relative;
    font-weight: 600;
    font-size: 1.8rem;
    list-style: none;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: '+';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    transition: var(--transition);
}

details[open] summary::after {
    content: '−';
}

.faq-content {
    padding: 0 1.5rem 1.5rem;
}

/* Footer */
.site-footer {
    background-color: #212529;
    color: white;
    padding: 4rem 0;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 3rem;
}

.footer-info {
    flex: 1 1 300px;
}

.copyright {
    font-weight: 600;
    margin-bottom: 1rem;
}

.disclaimer {
    font-size: 1.4rem;
    color: #adb5bd;
}

.footer-nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 0;
}

.footer-nav a {
    color: #adb5bd;
    transition: var(--transition);
}

.footer-nav a:hover {
    color: white;
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-content {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 3rem;
    width: 90%;
    max-width: 600px;
    text-align: center;
}

.search-message {
    margin-bottom: 2rem;
}

#search-status {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

.loader {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-radius: 50%;
    border-top: 5px solid var(--primary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.company-logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
}

.company-logos img {
    max-width: 100px;
    height: auto;
}

/* Responsive styles */
@media (max-width: 1024px) {
    html {
        font-size: 56.25%; /* 9px base */
    }
    
    .hero-content {
        flex-direction: column;
    }
    
    .hero-text {
        text-align: center;
    }
    
    .hero-text h1 {
        font-size: 3.6rem;
    }
    
    .section-header h2 {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 50%; /* 8px base */
    }
    
    .content-columns {
        flex-direction: column;
    }
    
    .content-columns.reverse {
        flex-direction: column;
    }
    
    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: white;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        padding: 2rem;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: var(--transition);
    }
    
    .main-nav.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .main-nav ul {
        flex-direction: column;
        align-items: center;
    }
    
    .desktop-only {
        display: none;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .company-card {
        flex-direction: column;
        align-items: center;
    }
    
    .company-info {
        text-align: center;
    }
    
    .company-features {
        text-align: left;
    }
}

@media (max-width: 576px) {
    .header-content {
        padding: 1rem 0;
    }
    
    .site-logo {
        font-size: 1.8rem;
    }
    
    .zip-search-container {
        padding: 2rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group input {
        border-radius: var(--border-radius) var(--border-radius) 0 0;
    }
    
    .input-group .cta-button {
        border-radius: 0 0 var(--border-radius) var(--border-radius);
    }
    
    .hero-section {
        padding: 4rem 0;
    }
    
    .content-section {
        padding: 4rem 0;
    }
    
    .tips-list li {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .expense-items {
        grid-template-columns: 1fr;
    }
}