/* ============================================================
   Local AI Referrals — Main Stylesheet
   AI-Powered Referral Services for Small Businesses
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* --- CSS Variables --- */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --accent: #10b981;
    --accent-dark: #059669;
    --accent-light: #d1fae5;
    --dark: #0f172a;
    --text: #334155;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --radius: 8px;
    --radius-lg: 12px;
    --max-width: 1200px;
    --nav-height: 72px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--white);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

ul {
    list-style: none;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    color: var(--dark);
    line-height: 1.2;
    font-weight: 700;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.3rem, 3vw, 1.75rem); }
h4 { font-size: 1.25rem; }

.section-title {
    text-align: center;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto 3rem;
}

/* --- Container --- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    line-height: 1.4;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: var(--white);
}

.btn-accent {
    background: var(--accent);
    color: var(--white);
}

.btn-accent:hover {
    background: var(--accent-dark);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-white {
    background: var(--white);
    color: var(--primary);
}

.btn-white:hover {
    background: var(--bg-light);
    color: var(--primary-dark);
}

.btn-lg {
    padding: 1rem 2.25rem;
    font-size: 1.125rem;
}

/* --- Navigation --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: box-shadow 0.3s ease;
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--dark);
}

.nav-logo .logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.1rem;
}

.nav-logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: var(--text);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.2s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-cta {
    margin-left: 1rem;
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--dark);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Page Header (for inner pages) --- */
.page-header {
    padding: calc(var(--nav-height) + 4rem) 0 3rem;
    background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
    text-align: center;
}

.page-header h1 {
    margin-bottom: 0.75rem;
}

.page-header p {
    color: var(--text-light);
    font-size: 1.125rem;
    max-width: 550px;
    margin: 0 auto;
}

/* --- Hero Section --- */
.hero {
    padding: calc(var(--nav-height) + 3rem) 0 4rem;
    background: linear-gradient(160deg, #eff6ff 0%, #f0fdf4 50%, #ffffff 100%);
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-content h1 {
    margin-bottom: 1.25rem;
}

.hero-content h1 .highlight {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    max-width: 520px;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    max-width: 380px;
    width: 100%;
}

.hero-card .stat {
    text-align: center;
    padding: 1rem 0;
}

.hero-card .stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
}

.hero-card .stat-label {
    color: var(--text-light);
    font-size: 0.9rem;
}

.hero-card .stat-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

/* --- Section Spacing --- */
.section {
    padding: 5rem 0;
}

.section-alt {
    background: var(--bg-light);
}

/* --- Features Grid --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.feature-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.feature-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    font-size: 1.5rem;
}

.feature-icon.blue {
    background: var(--primary-light);
    color: var(--primary);
}

.feature-icon.green {
    background: var(--accent-light);
    color: var(--accent);
}

.feature-card h3 {
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* --- How It Works Steps --- */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    counter-reset: step;
}

.step {
    position: relative;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
}

.step::before {
    counter-increment: step;
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: var(--white);
    font-weight: 700;
    font-size: 1.2rem;
    border-radius: 50%;
    margin: 0 auto 1.25rem;
}

.step h3 {
    margin-bottom: 0.5rem;
}

.step p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* --- CTA Section --- */
.cta-section {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    text-align: center;
    padding: 4rem 0;
}

.cta-section h2 {
    color: var(--white);
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Pricing Cards --- */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    align-items: start;
}

.pricing-card {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.pricing-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.pricing-card.featured {
    border-color: var(--primary);
    position: relative;
    transform: scale(1.03);
}

.pricing-card.featured::before {
    content: 'Most Popular';
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: var(--white);
    padding: 0.3rem 1.25rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.pricing-card h3 {
    margin-bottom: 0.5rem;
}

.pricing-card .price {
    font-size: 3rem;
    font-weight: 800;
    color: var(--dark);
    margin: 1rem 0;
}

.pricing-card .price span {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-light);
}

.pricing-card .features-list {
    text-align: left;
    margin: 1.5rem 0;
}

.pricing-card .features-list li {
    padding: 0.5rem 0;
    color: var(--text-light);
    font-size: 0.95rem;
}

.pricing-card .features-list li::before {
    content: '✓ ';
    color: var(--accent);
    font-weight: 700;
}

/* --- Contact Form --- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-info h2 {
    margin-bottom: 1rem;
}

.contact-info p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.contact-detail {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contact-detail .detail-icon {
    width: 44px;
    height: 44px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
}

.contact-detail h4 {
    margin-bottom: 0.15rem;
}

.contact-detail p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.contact-form {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    transition: border-color 0.2s ease;
    background: var(--white);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group .error-msg {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 0.3rem;
    display: none;
}

.form-group.error input,
.form-group.error textarea {
    border-color: #ef4444;
}

.form-group.error .error-msg {
    display: block;
}

.form-success {
    display: none;
    text-align: center;
    padding: 2rem;
}

.form-success.show {
    display: block;
}

.form-success .success-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* --- Blog Cards --- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.blog-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.blog-card:hover {
    box-shadow: var(--shadow-lg);
}

.blog-card-image {
    height: 180px;
    background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.blog-card-body {
    padding: 1.5rem;
}

.blog-card-body .date {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.blog-card-body h3 {
    margin-bottom: 0.5rem;
    font-size: 1.15rem;
}

.blog-card-body p {
    color: var(--text-light);
    font-size: 0.92rem;
    margin-bottom: 1rem;
}

/* --- About Page --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-image {
    background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
    border-radius: var(--radius-lg);
    height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
}

.about-content h2 {
    margin-bottom: 1rem;
}

.about-content p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.value-item {
    text-align: center;
    padding: 1.5rem;
}

.value-item .value-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.value-item h4 {
    margin-bottom: 0.35rem;
}

.value-item p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
}

/* --- Services Page --- */
.service-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    padding: 3rem 0;
    border-bottom: 1px solid var(--border);
}

.service-detail:last-child {
    border-bottom: none;
}

.service-detail.reverse {
    direction: rtl;
}

.service-detail.reverse .service-detail-content {
    direction: ltr;
}

.service-detail-visual {
    background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
    border-radius: var(--radius-lg);
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}

.service-detail-content h3 {
    margin-bottom: 0.75rem;
}

.service-detail-content p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.service-detail-content ul {
    margin-bottom: 1.5rem;
}

.service-detail-content ul li {
    padding: 0.4rem 0;
    color: var(--text-light);
}

.service-detail-content ul li::before {
    content: '→ ';
    color: var(--primary);
    font-weight: 600;
}

/* --- Trust Bar --- */
.trust-bar {
    background: var(--bg-light);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 0;
    text-align: center;
}

.trust-bar p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.trust-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.trust-logos span {
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.9rem;
    opacity: 0.6;
}

/* --- Testimonials --- */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.testimonial-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.testimonial-card .quote {
    font-style: italic;
    color: var(--text);
    margin-bottom: 1.25rem;
    font-size: 1rem;
}

.testimonial-card .author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.testimonial-card .author-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
}

.testimonial-card .author-name {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.9rem;
}

.testimonial-card .author-role {
    color: var(--text-light);
    font-size: 0.8rem;
}

/* --- Footer --- */
.footer {
    background: var(--dark);
    color: #94a3b8;
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-brand h3 {
    color: var(--white);
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.footer-brand p {
    font-size: 0.9rem;
    line-height: 1.7;
}

.footer-col h4 {
    color: var(--white);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.footer-col a {
    display: block;
    color: #94a3b8;
    padding: 0.3rem 0;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
}

/* --- Utilities --- */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

/* --- FAQ --- */
.faq-list {
    max-width: 750px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0;
}

.faq-question {
    font-weight: 600;
    color: var(--dark);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--primary);
    transition: transform 0.3s;
}

.faq-item.open .faq-question::after {
    content: '−';
}

.faq-answer {
    margin-top: 0.75rem;
    color: var(--text-light);
    display: none;
    font-size: 0.95rem;
}

.faq-item.open .faq-answer {
    display: block;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content p {
        max-width: 100%;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-visual {
        order: -1;
    }

    .hero-card {
        max-width: 320px;
    }

    .about-grid,
    .contact-grid,
    .service-detail {
        grid-template-columns: 1fr;
    }

    .service-detail.reverse {
        direction: ltr;
    }

    .about-image,
    .service-detail-visual {
        height: 250px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --nav-height: 64px;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 1.5rem;
        gap: 1rem;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
        transform: translateY(-120%);
        transition: transform 0.3s ease;
        z-index: 999;
    }

    .nav-links.active {
        transform: translateY(0);
    }

    .nav-cta {
        margin-left: 0;
    }

    .section {
        padding: 3rem 0;
    }

    .pricing-card.featured {
        transform: none;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-buttons {
        flex-direction: column;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .features-grid,
    .steps,
    .pricing-grid,
    .blog-grid,
    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    .hero-card .stat-number {
        font-size: 2rem;
    }
}
