/* =============================================================================
   Luisa Family Coach - Main Stylesheet
   Mobile-first, accessible, performance-optimized CSS
   ============================================================================= */

/* Reset and Base Styles
   ========================================================================= */

/* Additional reset for consistency */
*,
*::before,
*::after {
    box-sizing: border-box;
}

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

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Focus styles for accessibility */
*:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Typography
   ========================================================================= */

h1, h2, h3, h4, h5, h6 {
    font-family: "Playfair Display", Georgia, serif;
    line-height: 1.3;
    font-weight: 600;
    color: var(--sage-600);
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 1.5rem;
    text-align: center;
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

a {
    color: var(--accent);
    text-decoration-color: transparent;
    transition: all 0.3s ease;
}

a:hover,
a:focus {
    text-decoration-color: currentColor;
}

/* Buttons and CTAs
   ========================================================================= */

.cta-button {
    display: inline-block;
    background: var(--accent);
    color: var(--white);
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: 2px solid var(--accent);
    cursor: pointer;
    text-align: center;
    min-width: 200px;
}

.cta-button:hover,
.cta-button:focus {
    background: transparent;
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(90, 163, 143, 0.3);
}

.cta-button:active {
    transform: translateY(0);
}

/* Secondary button style */
.cta-secondary {
    background: transparent;
    color: var(--sage-600);
    border: 2px solid var(--sage-600);
}

.cta-secondary:hover,
.cta-secondary:focus {
    background: var(--sage-600);
    color: var(--white);
}

/* Language Switcher
   ========================================================================= */

.language-switcher {
    position: relative;
    display: none;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 2px solid var(--sage-600);
    border-radius: 25px;
    padding: 0.5rem 1rem;
    color: var(--sage-600);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-toggle:hover,
.lang-toggle:focus {
    background: var(--sage-600);
    color: var(--white);
}

.lang-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.lang-toggle[aria-expanded="true"] .lang-arrow {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border: 2px solid var(--sage-100);
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(58, 95, 90, 0.1);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.language-switcher.active .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--ink-600);
    font-weight: 500;
    transition: background-color 0.3s ease;
    border-bottom: 1px solid var(--sage-100);
}

.lang-option:last-child {
    border-bottom: none;
}

.lang-option:hover,
.lang-option:focus {
    background: var(--sage-100);
    color: var(--sage-600);
}

.lang-option.active {
    background: var(--accent);
    color: var(--white);
}

.lang-flag {
    font-size: 1.2rem;
}

/* Mobile Language Switcher */
.mobile-lang-switcher {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--sage-100);
}

.mobile-lang-switcher h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--sage-600);
    margin-bottom: 1rem;
    font-family: inherit;
}

.mobile-lang-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-lang-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    text-decoration: none;
    color: var(--ink-600);
    font-weight: 500;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.mobile-lang-option:hover,
.mobile-lang-option:focus {
    background: var(--sage-100);
    color: var(--sage-600);
}

.mobile-lang-option.active {
    background: var(--accent);
    color: var(--white);
}

/* Mobile Navigation
   ========================================================================= */

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav {
    position: absolute;
    top: 0;
    right: 0;
    height: 100vh;
    width: 80vw;
    max-width: 300px;
    background: var(--white);
    padding: 2rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow: scroll;
}

.mobile-nav-overlay.active .mobile-nav {
    transform: translateX(0);
}

.mobile-nav-links {
    list-style: none;
    margin-top: 2rem;
}

.mobile-nav-links li {
    margin-bottom: 1rem;
}

.mobile-nav-links a {
    display: block;
    padding: 1rem 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--ink-900);
    text-decoration: none;
    border-bottom: 1px solid var(--sage-100);
    transition: color 0.3s ease;
}

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

/* Section Styles
   ========================================================================= */

section {
    padding: 4rem 0;
    position: relative;
}

section:nth-child(even) {
    background: var(--sage-100);
}

/* About Section
   ========================================================================= */

.about-section {
    background: var(--white);
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}

.about-image {
    flex: 0 0 auto;
    width: 100%;
    max-width: 400px;
}

.about-image img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(58, 95, 90, 0.2);
}

.about-text {
    flex: 1;
    max-width: 600px;
}

.about-text h2 {
    text-align: left;
    margin-bottom: 2rem;
}

.about-text p {
    font-size: 1.1rem;
    color: var(--ink-600);
    margin-bottom: 1.5rem;
}

/* Support Section
   ========================================================================= */

.support-section {
    background: var(--cream);
}

.support-cards {
    display: grid;
    gap: 2rem;
    margin-top: 3rem;
}

.support-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(58, 95, 90, 0.1);
    transition: all 0.3s ease;
}

.support-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(58, 95, 90, 0.15);
}

.support-card h3 {
    color: var(--sage-600);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.support-card p {
    color: var(--ink-600);
    line-height: 1.7;
}

/* Approach Section
   ========================================================================= */

.approach-section {
    background: var(--white);
}

.approach-intro {
    text-align: center;
    font-size: 1.1rem;
    color: var(--ink-600);
    max-width: 700px;
    margin: 0 auto 3rem;
}

.approach-grid {
    display: grid;
    gap: 2rem;
    margin-bottom: 3rem;
}

.approach-item {
    background: var(--sage-100);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.approach-item:hover {
    background: var(--blush-200);
    transform: translateY(-3px);
}

.approach-icon {
    width: 60px;
    height: 60px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: var(--white);
    font-size: 1.5rem;
}

.approach-item h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--sage-600);
}

.approach-item p {
    color: var(--ink-600);
    font-style: italic;
    margin: 0;
}

.approach-quote {
    text-align: center;
    font-size: 1.25rem;
    font-style: italic;
    color: var(--sage-600);
    font-family: "Playfair Display", Georgia, serif;
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--blush-200);
    border-radius: 20px;
    position: relative;
}

.approach-quote::before {
    content: """;
    font-size: 4rem;
    color: var(--accent);
    position: absolute;
    top: -10px;
    left: 20px;
    line-height: 1;
}

/* Why Families Section
   ========================================================================= */

.why-families-section {
    background: var(--sage-600);
    color: var(--white);
}

.why-families-section h2 {
    color: var(--white);
}

.why-families-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.why-families-lead {
    font-size: 1.3rem;
    font-style: italic;
    margin-bottom: 2rem;
    color: var(--sage-100);
}

.why-families-list {
    list-style: none;
    margin: 2rem 0;
    padding: 0;
}

.why-families-list li {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-left: 2rem;
    position: relative;
}

.why-families-list li::before {
    content: "🌱";
    position: absolute;
    left: 0;
    top: 0;
}

.why-families-conclusion {
    font-size: 1.2rem;
    margin: 2rem 0;
    color: var(--sage-100);
}

.why-families-cta {
    font-size: 1.3rem;
    font-family: "Playfair Display", Georgia, serif;
    color: var(--white);
    margin: 2rem 0 0;
}

/* Testimonials Section
   ========================================================================= */

.testimonials-section {
    background: var(--cream);
}

.testimonials-grid {
    display: grid;
    gap: 2rem;
    margin-top: 3rem;
}

.testimonial {
    background: var(--white);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(58, 95, 90, 0.1);
    position: relative;
}

.testimonial::before {
    content: """;
    font-size: 3rem;
    color: var(--accent);
    position: absolute;
    top: 10px;
    left: 20px;
    line-height: 1;
    opacity: 0.3;
}

.testimonial blockquote {
    margin: 0;
    padding-top: 1rem;
}

.testimonial blockquote p {
    font-size: 1.1rem;
    color: var(--ink-600);
    font-style: italic;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.testimonial cite {
    display: block;
    text-align: right;
    font-weight: 600;
    color: var(--sage-600);
    font-style: normal;
    font-size: 0.9rem;
}

/* FAQ Section
   ========================================================================= */

.faq-section {
    background: var(--white);
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--sage-100);
    margin-bottom: 1rem;
}

.faq-question {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 1.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--sage-600);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.3s ease;
}

.faq-question:hover,
.faq-question:focus {
    color: var(--accent);
}

.faq-icon {
    font-size: 1.5rem;
    color: var(--accent);
    transition: transform 0.3s ease;
    min-width: 30px;
    text-align: center;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding-bottom: 1.5rem;
}

.faq-answer p {
    color: var(--ink-600);
    line-height: 1.7;
    margin: 0;
}

/* Contact Section
   ========================================================================= */

.contact-section {
    background: var(--sage-100);
}

.contact-content {
    display: grid;
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
}

.contact-info h2 {
    text-align: left;
    margin-bottom: 2rem;
}

.contact-info p {
    font-size: 1.1rem;
    color: var(--ink-600);
    margin-bottom: 1.5rem;
}

.contact-methods {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--sage-600);
    transition: color 0.3s ease;
}

.contact-link:hover,
.contact-link:focus {
    color: var(--accent);
}

.contact-icon {
    font-size: 1.2rem;
}

/* Contact Form
   ========================================================================= */

.contact-form-container {
    background: var(--white);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(58, 95, 90, 0.1);
}

.contact-form-container h3 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--sage-600);
}

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

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

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

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    outline: none;
}

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

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

/* Checkbox styling */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--sage-100);
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-label input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: "✓";
    color: var(--white);
    font-size: 14px;
    position: absolute;
    top: -2px;
    left: 2px;
}

/* Error messages */
.error-message {
    color: #e53e3e;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: none;
}

.error-message.show {
    display: block;
}

/* Form messages */
.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 10px;
    font-weight: 500;
    text-align: center;
    display: none;
}

.form-message.success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.form-message.error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #fc8181;
}

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

/* Footer
   ========================================================================= */

.footer {
    background: var(--ink-900);
    color: var(--white);
    padding: 3rem 0 2rem;
}

.footer-content {
    display: grid;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    color: var(--white);
    margin-bottom: 1rem;
}

.footer-section p {
    color: var(--sage-100);
    margin-bottom: 0.5rem;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.social-links a {
    color: var(--sage-100);
    text-decoration: none;
    transition: color 0.3s ease;
}

.social-links a:hover,
.social-links a:focus {
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid var(--sage-600);
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
}

.footer-bottom p {
    color: var(--sage-100);
    margin: 0;
}

.footer-legal {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.footer-legal a {
    color: var(--sage-100);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-legal a:hover,
.footer-legal a:focus {
    color: var(--accent);
}

/* Mobile Sticky CTA
   ========================================================================= */

.mobile-cta-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 1rem;
    border-top: 2px solid var(--sage-100);
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
    z-index: 50;
    display: block;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.mobile-cta-bar.hidden {
    transform: translateY(100%);
}

.mobile-cta-button {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--accent);
    color: var(--white);
    padding: 1rem;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.mobile-cta-button:hover,
.mobile-cta-button:focus {
    background: var(--sage-600);
    transform: translateY(-2px);
}

/* Animation Classes
   ========================================================================= */

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in.animate {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease;
}

.slide-in-left.animate {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease;
}

.slide-in-right.animate {
    opacity: 1;
    transform: translateX(0);
}

/* Tablet Styles (768px and up)
   ========================================================================= */

@media (min-width: 768px) {
    /* Navigation */
    .mobile-cta-bar {
        display: none;
    }

    .language-switcher {
        display: block;
    }

    /* Sections */
    section {
        padding: 5rem 0;
    }

    /* About Section */
    .about-content {
        flex-direction: row;
        gap: 4rem;
        text-align: left;
    }

    .about-image {
        flex: 0 0 400px;
    }

    /* Support Cards */
    .support-cards {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }

    /* Approach Grid */
    .approach-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

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

    /* Contact */
    .contact-content {
        grid-template-columns: 2fr 3fr;
        gap: 4rem;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }

    /* Contact methods */
    .contact-methods {
        flex-direction: row;
        gap: 2rem;
        align-items: center;
    }
}

/* Desktop Styles (1024px and up)
   ========================================================================= */

@media (min-width: 1024px) {
    /* Enhanced hover effects */
    .support-card:hover,
    .testimonial:hover {
        transform: translateY(-8px);
    }

    .approach-item:hover {
        transform: translateY(-5px);
    }

    /* Larger containers */
    .container {
        max-width: 1200px;
        padding: 0 3rem;
    }

    /* Enhanced spacing */
    section {
        padding: 6rem 0;
    }

    /* Typography improvements */
    .hero h1 {
        font-size: 4rem;
    }

    h2 {
        font-size: 3rem;
    }

    /* Grid improvements */
    .support-cards {
        grid-template-columns: repeat(3, 1fr);
    }

    .approach-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 1000px;
        margin: 3rem auto 0;
    }
}

/* Large Desktop Styles (1200px and up)
   ========================================================================= */

@media (min-width: 1200px) {
    .testimonials-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: none;
    }

    .approach-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1000px;
        margin: 0 auto 3rem;
    }
}

/* Print Styles
   ========================================================================= */

@media print {
    .header,
    .mobile-cta-bar,
    .mobile-nav-overlay,
    .contact-form-container {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    section {
        page-break-inside: avoid;
        background: white !important;
    }

    a {
        color: black;
        text-decoration: underline;
    }

    .cta-button {
        border: 2px solid black;
        background: white;
        color: black;
    }
}

/* High Contrast Mode Support
   ========================================================================= */

@media (prefers-contrast: high) {
    :root {
        --sage-600: #000000;
        --ink-900: #000000;
        --accent: #0066cc;
    }

    .cta-button {
        border: 3px solid currentColor;
    }

    .support-card,
    .testimonial,
    .contact-form-container {
        border: 2px solid var(--ink-900);
    }
}