/* ================================
   Digital Wellness Site Styles
   Mobile-First Responsive Design
   ================================ */

/* === CSS Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --primary: #4A7C8C;
    --primary-dark: #3A6270;
    --secondary: #F4A261;
    --secondary-dark: #E89350;
    --bg-white: #FDFDFB;
    --bg-light: #F7F7F5;
    --text-dark: #2D3142;
    --text-medium: #4E515F; /* Darkened from #5C5F6F for WCAG AA compliance (4.5:1 ratio) */
    --text-light: #75788A; /* Darkened from #8B8E9A for better contrast */
    --success: #6EAF7D;
    --alert: #E76F51;
    --border-light: #E5E5E3;

    /* Typography */
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Georgia', 'Times New Roman', serif;
    --font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-xxl: 4rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.12);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* Container */
    --container-max: 1200px;
    --container-padding: 20px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

h1 {
    font-size: 32px;
    margin-bottom: var(--space-md);
    margin-top: var(--space-md);
}

h2 {
    font-size: 24px;
    margin-bottom: var(--space-md);
    margin-top: var(--space-md);
}

h3 {
    font-size: 20px;
    margin-bottom: var(--space-sm);
    margin-top: var(--space-sm);
}

h4 {
    font-size: 18px;
    margin-bottom: var(--space-sm);
    margin-top: var(--space-sm);
}

p {
    margin-bottom: var(--space-md);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-base);
}

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

a:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* === Accessibility === */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

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

/* === Container === */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* === Header === */
.site-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    padding: var(--space-sm) 0;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 20px;
    color: var(--text-dark);
}

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

.desktop-nav {
    display: none;
}

.desktop-nav ul {
    display: flex;
    gap: var(--space-lg);
    list-style: none;
}

.desktop-nav a {
    font-family: var(--font-heading);
    font-size: 16px;
    color: var(--text-medium);
}

.desktop-nav a:hover {
    color: var(--primary);
}

.search-btn,
.mobile-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-dark);
    transition: color var(--transition-base);
}

.search-btn:hover,
.mobile-menu-btn:hover {
    color: var(--primary);
}

.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 40px;
    height: 40px;
    justify-content: center;
    align-items: center;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: currentColor;
    transition: all var(--transition-base);
}

.mobile-menu-btn[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* === Search Overlay === */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45, 49, 66, 0.95);
    z-index: 100;
    display: none;
    align-items: flex-start;
    padding-top: 10vh;
}

.search-overlay.active {
    display: flex;
}

.search-content {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
    position: relative;
}

.search-close {
    position: absolute;
    top: -60px;
    right: var(--container-padding);
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
}

.search-input {
    width: 100%;
    padding: var(--space-md);
    font-size: 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
}

.search-input:focus {
    outline: 3px solid var(--primary);
}

.search-results {
    margin-top: var(--space-md);
    background: white;
    border-radius: var(--radius-md);
    max-height: 60vh;
    overflow-y: auto;
}

/* === Mobile Menu === */
.mobile-menu {
    position: fixed;
    top: 73px;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
    z-index: 100;
}

.mobile-menu.active {
    max-height: calc(100vh - 73px);
    overflow-y: auto;
}

.mobile-menu ul {
    list-style: none;
    padding: var(--space-md);
}

.mobile-menu li {
    border-bottom: 1px solid var(--border-light);
}

.mobile-menu li:last-child {
    border-bottom: none;
}

.mobile-menu a {
    display: block;
    padding: var(--space-md);
    font-family: var(--font-heading);
    color: var(--text-dark);
}

.mobile-menu a:hover {
    background: var(--bg-light);
    color: var(--primary);
}

/* === Hero Section === */
.hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #4A7C8C 0%, #6B9AA8 100%);
    color: white;
    padding: var(--space-xxl) 0;
    text-align: center;
}

.hero h1 {
    color: white;
    font-size: 36px;
    margin-bottom: var(--space-sm);
}

.subtitle {
    font-size: 20px;
    margin-bottom: var(--space-xl);
    opacity: 0.95;
}

.quick-start {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    max-width: 600px;
    margin: 0 auto;
}

.quick-start-label {
    font-family: var(--font-heading);
    margin-bottom: var(--space-md);
    font-size: 18px;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* === Buttons === */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    border: 2px solid transparent;
    min-height: 48px;
    line-height: 1.5;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
    background: var(--secondary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: white;
    border-color: white;
}

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

/* === Tiles Section === */
.tiles-section {
    padding: var(--space-xxl) 0;
}

.tiles-grid {
    display: grid;
    gap: var(--space-lg);
    grid-template-columns: 1fr;
}

.tile {
    background: white;
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.tile:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.tile-featured {
    background: linear-gradient(135deg, #F4A261 0%, #F6B380 100%);
    color: white;
}

.tile-featured h3,
.tile-featured p {
    color: white;
}

.tile-icon {
    margin-bottom: var(--space-md);
}

.tile h3 {
    font-size: 22px;
    margin-bottom: var(--space-sm);
}

.tile p {
    margin-bottom: var(--space-md);
    color: var(--text-medium);
}

.tile-featured p {
    color: rgba(255, 255, 255, 0.9);
}

.tile-link {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
}

.tile-featured .tile-link {
    color: white;
}

/* === Content Sections === */
.content-section {
    padding: var(--space-xxl) 0;
}

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

.section-intro {
    font-size: 20px;
    color: var(--text-medium);
    text-align: center;
    margin-bottom: var(--space-xl);
}

.two-column {
    display: grid;
    gap: var(--space-xl);
}

.info-cards {
    display: grid;
    gap: var(--space-md);
}

.info-card {
    background: white;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
}

.info-card h4 {
    color: var(--primary);
    font-size: 18px;
}

.info-card p {
    margin-bottom: 0;
    color: var(--text-medium);
}

/* === Strategy Grid === */
.strategy-grid {
    display: grid;
    gap: var(--space-lg);
}

.strategy-card {
    background: white;
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.strategy-card h3 {
    color: var(--primary);
}

/* === Content prose lists (CSS reset strips browser defaults) === */
main ul:not([class]),
main ol:not([class]) {
    padding-left: 1.5rem;
    margin: 0.75rem 0;
}

main ul:not([class]) { list-style: disc; }
main ol:not([class]) { list-style: decimal; }

main ul:not([class]) li,
main ol:not([class]) li {
    margin-bottom: 0.35rem;
}

.check-list {
    list-style: none;
    margin: var(--space-md) 0;
}

.check-list li {
    padding-left: 28px;
    position: relative;
    margin-bottom: var(--space-sm);
}

.check-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
    font-size: 18px;
}

/* === Resource Grid === */
.resource-grid {
    display: grid;
    gap: var(--space-md);
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.resource-card {
    background: white;
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: all var(--transition-base);
    display: block;
}

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

.resource-icon {
    font-size: 40px;
    margin-bottom: var(--space-sm);
}

.resource-card h3 {
    font-size: 18px;
    margin-bottom: var(--space-xs);
}

.resource-card p {
    margin-bottom: 0;
    font-size: 16px;
    color: var(--text-medium);
}

/* === Principles Section === */
.newsletter-section {
    background: var(--primary);
    color: white;
    padding: var(--space-xxl) 0;
}

.newsletter-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.newsletter-content h2,
.newsletter-content p {
    color: white;
}

.principle-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    margin: var(--space-xl) 0;
    text-align: center;
}

.principle-item {
    background: rgba(255, 255, 255, 0.1);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
}

.principle-item h3 {
    color: white;
    font-size: 20px;
    margin-bottom: var(--space-sm);
}

.principle-item p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0;
    font-size: 16px;
}

/* === Footer === */
.site-footer {
    background: var(--text-dark);
    color: white;
    padding: var(--space-xxl) 0 var(--space-lg);
}

.footer-grid {
    display: grid;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.footer-column h3 {
    color: white;
    font-size: 16px;
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-column ul {
    list-style: none;
}

.footer-column li {
    margin-bottom: var(--space-sm);
}

.footer-column a {
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--font-heading);
    font-size: 15px;
}

.footer-column a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--space-lg);
    text-align: center;
}

.footer-bottom p {
    margin-bottom: var(--space-sm);
    font-family: var(--font-heading);
    font-size: 14px;
}

.footer-notice {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 14px;
    opacity: 0.8;
}

/* === Floating Action Button === */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--secondary);
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    z-index: 30;
}

.fab:hover {
    transform: scale(1.1);
    background: var(--secondary-dark);
}

.fab:active {
    transform: scale(0.95);
}

/* === Tablet Styles === */
@media (min-width: 768px) {
    :root {
        --container-padding: 40px;
    }

    h1 {
        font-size: 48px;
    }

    h2 {
        font-size: 36px;
    }

    h3 {
        font-size: 28px;
    }

    .hero h1 {
        font-size: 48px;
    }

    .subtitle {
        font-size: 24px;
    }

    .button-group {
        flex-direction: row;
        justify-content: center;
    }

    .tiles-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .two-column {
        grid-template-columns: 1fr 1fr;
    }

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

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

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* === Desktop Styles === */
@media (min-width: 1024px) {
    .mobile-menu-btn {
        display: none;
    }

    .mobile-menu {
        display: none;
    }

    .desktop-nav {
        display: block;
    }

    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }

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

/* === Activity Filter Styles === */
.filter-bar {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary);
    background: white;
    color: var(--primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 14px;
    transition: all var(--transition-base);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary);
    color: white;
}

.activity-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary);
}

.activity-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
    font-size: 14px;
    color: var(--text-medium);
}

.tag {
    background: var(--bg-light);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-medium);
}

/* === Quiz Assessment Styles === */
.quiz-container {
    max-width: 700px;
    margin: 0 auto;
}

.question-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    display: none;
}

.question-card.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.quiz-option {
    padding: 1rem 1.5rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: white;
    cursor: pointer;
    transition: all var(--transition-base);
    text-align: left;
    font-family: var(--font-heading);
    font-size: 16px;
}

.quiz-option:hover {
    border-color: var(--primary);
    background: var(--bg-light);
}

.quiz-option.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

.results-section {
    display: none;
    background: white;
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.results-section.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

.recommendation-card {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    margin: 1rem 0;
    border-left: 4px solid var(--primary);
}

/* === Family Agreement Styles === */
.agreement-template {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    margin: 2rem 0;
    border: 2px solid var(--border-light);
}

.agreement-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
}

.agreement-item {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    padding: 0.75rem;
    background: white;
    border-radius: var(--radius-sm);
}

.checkbox-placeholder {
    width: 24px;
    height: 24px;
    border: 2px solid var(--primary);
    border-radius: 4px;
    flex-shrink: 0;
}

.signature-line {
    border-bottom: 2px solid var(--text-dark);
    min-width: 200px;
    margin: 0 0.5rem;
    display: inline-block;
}

.no-print {
    display: block;
}

/* === Back to Top Button === */
#backToTop {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
    box-shadow: var(--shadow-lg);
}

#backToTop:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* === Quick Help Modal === */
.quick-help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.quick-help-modal.active {
    opacity: 1;
    visibility: visible;
}

.quick-help-content {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    width: 90%;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.quick-help-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-medium);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.quick-help-close:hover {
    color: var(--text-dark);
}

.quick-help-content h3 {
    margin: 0 0 0.5rem 0;
    color: var(--primary);
    font-size: 24px;
}

.quick-help-content p {
    margin: 0 0 1.5rem 0;
    color: var(--text-medium);
    font-size: 16px;
}

.quick-help-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quick-help-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.quick-help-link:hover {
    background: white;
    border-color: var(--primary);
    transform: translateX(4px);
}

.quick-help-icon {
    font-size: 24px;
    width: 32px;
    text-align: center;
}

.quick-help-label {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 16px;
}

/* === Print Styles === */
@media print {
    .site-header,
    .mobile-menu,
    .search-overlay,
    .newsletter-section,
    .site-footer,
    .fab,
    #backToTop,
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: black;
        background: white;
    }

    a {
        text-decoration: underline;
    }

    /* Remove URL printing for internal links */
    a[href^="/"]:after,
    a[href^="./"]:after,
    a[href^="#"]:after {
        content: "";
    }

    /* Only show URLs for external links */
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 10pt;
    }

    /* Prevent page breaks inside these elements */
    .strategy-card,
    .tile,
    .info-card,
    .agreement-section,
    .agreement-item {
        page-break-inside: avoid;
        break-inside: avoid;
        box-shadow: none;
    }

    /* Keep agreement sections together */
    .agreement-template {
        background: white;
    }

    .agreement-section {
        margin-bottom: 1.5rem;
        padding: 1rem;
        border: 1px solid #ddd;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .agreement-section h3 {
        page-break-after: avoid;
        break-after: avoid;
        margin-top: 0;
    }

    /* Avoid breaking between checkbox and label */
    .agreement-item {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* Remove shadows and optimize for print */
    * {
        box-shadow: none !important;
    }

    /* Ensure signature section stays together */
    .signature-line {
        border-bottom: 1px solid #000;
        display: inline-block;
    }
}

/* === FAQ / Details Accordion === */
.faq-item {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    background: var(--bg-white);
    overflow: hidden;
}

.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-family: var(--font-heading);
    color: var(--primary);
    cursor: pointer;
    list-style: none;
    gap: 0.75rem;
    transition: background 0.15s ease;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
    content: '';
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background-color: var(--primary);
    border-radius: 50%;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center/contain no-repeat;
    transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
    transform: rotate(180deg);
}

.faq-item summary:hover {
    background: var(--bg-light);
}

.faq-item[open] summary {
    border-bottom: 1px solid var(--border-light);
}

.faq-item > *:not(summary) {
    padding: 1rem 1.25rem 1.25rem !important;
}