/*
 * JustInsure Static Site Stylesheet
 * Version: 1.0
 * Author: Gemini
 */

/* ------------------- */
/* ROOT & VARIABLES    */
/* ------------------- */
:root {
    --primary-color: #0EA5E9; /* sky-500 */
    --primary-color-dark: #0284C7; /* sky-600 */
    --secondary-color: #475569; /* slate-600 */
    --bg-light: #f8fafc; /* slate-50 */
    --bg-dark: #0f172a; /* slate-900 */
    --text-light: #0f172a; /* slate-900 */
    --text-dark: #f1f5f9; /* slate-100 */
    --border-light: #e2e8f0; /* slate-200 */
    --border-dark: #334155; /* slate-700 */
    --surface-light: #ffffff;
    --surface-dark: #1e293b; /* slate-800 */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-serif: "Georgia", serif;
    --header-height: 70px;
    --border-radius: 8px;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --transition: all 0.3s ease-in-out;
}

[data-theme="dark"] {
    --secondary-color: #94a3b8; /* slate-400 */
    --bg-light: #0f172a;
    --bg-dark: #f8fafc;
    --text-light: #f1f5f9;
    --text-dark: #0f172a;
    --border-light: #334155;
    --border-dark: #e2e8f0;
    --surface-light: #1e293b;
    --surface-dark: #ffffff;
}

/* ------------------- */
/* BASE & RESET        */
/* ------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-sans);
    background-color: var(--bg-light);
    color: var(--text-light);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s, color 0.3s;
}
body.modal-open { overflow: hidden; }

/* Reduced motion preferences */
@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;
    scroll-behavior: auto !important;
  }
}

h1, h2, h3, h4, h5, h6 { margin: 0 0 0.5em 0; line-height: 1.2; font-weight: 600; }
h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }
p { margin: 0 0 1em 0; }
a { color: var(--primary-color); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-color-dark); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; padding: 0; margin: 0; }

/* ------------------- */
/* UTILITIES & HELPERS */
/* ------------------- */
.container {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    z-index: 100;
    transition: top 0.3s;
}
.skip-link:focus { top: 0; }
.button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
    user-select: none;
}
.button--primary {
    background-color: var(--primary-color);
    color: white;
}
.button--primary:hover { background-color: var(--primary-color-dark); }
.button--secondary {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}
.button--secondary:hover { background-color: var(--primary-color); color: white; }
.link-button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: underline;
}
.link-button:hover { color: var(--primary-color-dark); }

.section { padding: 4rem 0; }
.section__title { text-align: center; margin-bottom: 1rem; }
.section__subtitle { text-align: center; max-width: 600px; margin: 0 auto 3rem auto; color: var(--secondary-color); font-size: 1.1rem; }
.section--light { background-color: var(--surface-light); border-top: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); }
.section--dark { background-color: var(--bg-dark); color: var(--text-dark); }
.section--dark .section__subtitle { color: #cbd5e1; }
.section__cta { text-align: center; margin-top: 3rem; }

.grid { display: grid; gap: 2rem; }
.grid--3-col { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* Focus styles */
:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ------------------- */
/* HEADER              */
/* ------------------- */
.header {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 50;
    transition: background-color 0.3s, border-color 0.3s;
}
[data-theme="dark"] .header {
    background-color: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid var(--border-dark);
}
.header__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}
.header__logo img { height: 30px; width: auto; }
[data-theme="dark"] .header__logo img { filter: invert(1); }
.header__nav ul { display: flex; gap: 1.5rem; }
.header__nav a { font-weight: 500; color: var(--text-light); position: relative; }
.header__nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s;
}
.header__nav a:hover::after { width: 100%; }
.header__actions { display: flex; align-items: center; gap: 1rem; }
.header__mobile-menu-toggle { display: none; }

/* ------------------- */
/* THEME TOGGLE        */
/* ------------------- */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
}
.theme-toggle:hover { background-color: var(--border-light); }
.theme-toggle svg { width: 24px; height: 24px; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }
[data-theme="dark"] .theme-toggle:hover { background-color: var(--border-dark); }


/* ------------------- */
/* HERO SECTION        */
/* ------------------- */
.hero {
    position: relative;
    color: white;
    text-align: center;
    padding: 8rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-height));
    overflow: hidden;
}
.hero__background {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
}
.hero__background::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(15, 23, 42, 0.7);
}
.hero__background img { width: 100%; height: 100%; object-fit: cover; }
.hero__content { z-index: 1; }
.hero__title { font-size: 3.5rem; font-weight: 700; margin-bottom: 1rem; }
.hero__subtitle { font-size: 1.25rem; max-width: 650px; margin: 0 auto 2rem auto; opacity: 0.9; }
.hero__cta { display: flex; justify-content: center; gap: 1rem; }
.hero__cta .button--secondary { border-color: white; color: white; }
.hero__cta .button--secondary:hover { background-color: white; color: var(--text-light); }

/* ------------------- */
/* CARD COMPONENT      */
/* ------------------- */
.card {
    background-color: var(--surface-light);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1); }
.card__icon { width: 48px; height: 48px; margin-bottom: 1rem; color: var(--primary-color); }
[data-theme="dark"] .card__icon { filter: invert(0.5) sepia(1) saturate(5) hue-rotate(180deg); }
.card__title { font-size: 1.25rem; margin-bottom: 1rem; }
.card__body { color: var(--secondary-color); font-size: 0.95rem; flex-grow: 1; }
[data-theme="dark"] .card__body { color: #cbd5e1; }
.card__meta { font-size: 0.8rem; color: var(--secondary-color); margin-bottom: 0.5rem; }
.card__link {
    margin-top: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* ------------------- */
/* HOW IT WORKS        */
/* ------------------- */
.steps-container {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    text-align: center;
    position: relative;
    margin-top: 2rem;
}
.steps-container::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 15%;
    right: 15%;
    height: 2px;
    background: var(--border-light);
    z-index: 0;
}
.step { position: relative; z-index: 1; max-width: 300px; }
.step__number {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem auto;
    border: 4px solid var(--bg-light);
}
[data-theme="dark"] .step__number { border-color: var(--surface-light); }
.step__title { font-size: 1.25rem; }
.step p { color: var(--secondary-color); }
[data-theme="dark"] .step p { color: #cbd5e1; }


/* ------------------- */
/* WHY US SECTION      */
/* ------------------- */
.why-us__grid h3 { color: var(--primary-color); margin-bottom: 0.75rem; }

/* ------------------- */
/* TESTIMONIALS        */
/* ------------------- */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}
.testimonial {
    background-color: var(--surface-light);
    border-left: 4px solid var(--primary-color);
    padding: 2rem;
    margin: 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    box-shadow: var(--shadow);
}
.testimonial p {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 1rem;
}
.testimonial footer { font-weight: 600; color: var(--secondary-color); }

/* ------------------- */
/* FAQ ACCORDION       */
/* ------------------- */
.faq-container { max-width: 800px; }
.faq-accordion__item {
    border-bottom: 1px solid var(--border-light);
}
.faq-accordion__item:last-child { border-bottom: none; }
.faq-accordion__question {
    font-size: 1.1rem;
    font-weight: 500;
    padding: 1.5rem 0;
    cursor: pointer;
    list-style: none; /* Remove default marker */
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq-accordion__question::-webkit-details-marker { display: none; }
.faq-accordion__question::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform 0.3s;
}
.faq-accordion__item[open] > .faq-accordion__question::after {
    transform: rotate(45deg);
}
.faq-accordion__answer {
    padding-bottom: 1.5rem;
    color: var(--secondary-color);
}
[data-theme="dark"] .faq-accordion__answer { color: #cbd5e1; }

/* ------------------- */
/* CTA Section         */
/* ------------------- */
.cta-section {
    background-color: var(--primary-color);
    color: white;
    padding: 4rem 0;
    text-align: center;
}
.cta-section h2 { font-size: 2rem; }
.cta-section p { max-width: 500px; margin: 1rem auto 2rem; opacity: 0.9; }
.cta-section .button--primary { background-color: white; color: var(--primary-color); }
.cta-section .button--primary:hover { background-color: #f1f5f9; }

/* ------------------- */
/* FOOTER              */
/* ------------------- */
.footer {
    background-color: var(--bg-dark);
    color: #e2e8f0; /* slate-200 */
    padding-top: 4rem;
    font-size: 0.9rem;
}
.footer a, .footer .link-button { color: #e2e8f0; text-decoration: none; }
.footer a:hover, .footer .link-button:hover { color: var(--primary-color); }
.footer__container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 2rem;
    padding-bottom: 3rem;
}
.footer__logo { margin-bottom: 1rem; filter: invert(1); }
.footer address { font-style: normal; color: #94a3b8; line-height: 1.5; }
.footer h4 { color: white; margin-bottom: 1rem; }
.footer__links ul li { margin-bottom: 0.5rem; }
.footer__email { display: block; margin-bottom: 1rem; }
.footer__social { display: flex; gap: 1rem; }
.footer__social svg { width: 24px; height: 24px; }
.footer__bottom-bar {
    background-color: #020617; /* slate-950 */
    padding: 1rem 0;
    border-top: 1px solid var(--border-dark);
}
.footer__bottom-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #94a3b8; /* slate-400 */
}
.footer__bottom-bar p { margin: 0; }
.footer__bottom-bar ul { display: flex; gap: 1.5rem; }

/* ------------------- */
/* MODAL               */
/* ------------------- */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.modal[hidden] { display: flex; }
.modal.is-open {
    opacity: 1;
    visibility: visible;
}
.modal__backdrop {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(15, 23, 42, 0.8);
    cursor: pointer;
}
.modal__content {
    position: relative;
    background-color: var(--surface-light);
    color: var(--text-light);
    border-radius: var(--border-radius);
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1001;
    transform: scale(0.95);
    transition: var(--transition);
}
.modal.is-open .modal__content { transform: scale(1); }
.modal__content--large { max-width: 800px; }
.modal__close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: var(--secondary-color);
}
.modal__title { margin-bottom: 1rem; }
.legal-text h4 { margin-top: 1.5rem; color: var(--primary-color); }
.legal-text ul { list-style: disc; padding-left: 20px; }

/* ------------------- */
/* FORM STYLES         */
/* ------------------- */
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.5rem; }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-light);
    background-color: var(--bg-light);
    color: var(--text-light);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}
.form-group--checkbox { display: flex; align-items: flex-start; gap: 0.75rem; }
.form-group--checkbox input[type="checkbox"] { margin-top: 4px; }
.form-group--checkbox label { margin-bottom: 0; }
.error-message { color: #ef4444; font-size: 0.875rem; margin-top: 0.25rem; display: none; }
input:invalid:not(:placeholder-shown) + .error-message,
textarea:invalid:not(:placeholder-shown) + .error-message { display: block; }
.form-group.has-error input, .form-group.has-error textarea { border-color: #ef4444; }
.form-group.has-error .error-message { display: block; }
.honeypot { display: none; }
#submit-button:disabled { background-color: var(--secondary-color); cursor: not-allowed; }
#form-status { margin-top: 1rem; font-weight: 500; }
#form-status.success { color: #22c55e; }
#form-status.error { color: #ef4444; }


/* ------------------- */
/* BLOG STYLES         */
/* ------------------- */
.blog-header { text-align: center; padding: 4rem 0; background-color: var(--section--light); border-bottom: 1px solid var(--border-light); }
.blog-post { max-width: 800px; margin: 4rem auto; }
.blog-post h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }
.blog-post__meta { color: var(--secondary-color); margin-bottom: 2rem; }
.blog-post__content h2 { font-size: 1.75rem; margin: 2rem 0 1rem; color: var(--primary-color); }
.blog-post__content h3 { font-size: 1.4rem; margin: 1.5rem 0 1rem; }
.blog-post__content ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 1rem; }
.blog-post__content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--secondary-color);
}
.blog-post__content a { text-decoration: underline; }

/* ------------------- */
/* RESPONSIVE STYLES   */
/* ------------------- */
@media (max-width: 992px) {
    .header__nav { display: none; }
    .header__mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 100;
    }
    .header__mobile-menu-toggle span {
        display: block;
        width: 25px;
        height: 3px;
        background-color: var(--text-light);
        margin: 5px 0;
        transition: var(--transition);
    }

    .footer__container { grid-template-columns: 1fr 1fr; }
    .footer__about, .footer__connect { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    .hero__title { font-size: 2.8rem; }
    .hero { padding: 6rem 0; }
    .steps-container { flex-direction: column; align-items: center; }
    .steps-container::before { display: none; }
    .testimonials-grid { grid-template-columns: 1fr; }
}

@media (max-width: 576px) {
    .hero__cta { flex-direction: column; align-items: center; }
    .footer__container { grid-template-columns: 1fr; text-align: center; }
    .footer__about, .footer__connect { text-align: center; }
    .footer__social { justify-content: center; }
    .footer__bottom-bar .container { flex-direction: column; gap: 0.5rem; }
}