/* CPR4Kids v3, modern parent-focused design */

:root {
    --color-primary: #c41e3a;
    --color-primary-dark: #9a1830;
    --color-navy: #1a2b4a;
    --color-navy-light: #2d4268;
    --color-teal: #0d7377;
    --color-bg: #f8f9fb;
    --color-white: #ffffff;
    --color-text: #2c3345;
    --color-muted: #5c6578;
    --color-border: #e2e6ee;
    --color-success: #1a7f4b;
    --shadow-sm: 0 1px 3px rgba(26, 43, 74, 0.08);
    --shadow-md: 0 8px 30px rgba(26, 43, 74, 0.12);
    --radius: 12px;
    --font-sans: 'DM Sans', system-ui, sans-serif;
    --font-serif: 'DM Serif Display', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--color-text);
    background: var(--color-bg);
    overflow-x: hidden;
}

.container {
    width: min(1120px, 92vw);
    margin: 0 auto;
}

h1, h2, h3 {
    font-family: var(--font-serif);
    font-weight: 400;
    line-height: 1.2;
    color: var(--color-navy);
}

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

/* Header */
.site-header {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 0;
    gap: 1rem;
}

.logo {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    text-decoration: none;
    line-height: 0;
}

.logo-bg {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 77px;
    min-width: 0;
    background: url('/images/cpr4kids.gif') left center no-repeat;
    background-size: auto 77px;
    overflow: hidden;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.site-nav a {
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-navy-light);
}

.nav-btn {
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--color-border);
}

.nav-btn-primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-white) !important;
}

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

/* Hero */
.hero {
    background: linear-gradient(160deg, var(--color-navy) 0%, #243a5e 55%, var(--color-navy-light) 100%);
    color: var(--color-white);
    padding: 3rem 0 4rem;
}

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

.hero h1 {
    color: var(--color-white);
    font-size: clamp(2rem, 4vw, 2.75rem);
    margin: 0 0 1rem;
}

.hero-lead {
    font-size: 1.15rem;
    opacity: 0.92;
    margin-bottom: 1.5rem;
}

.hero-price {
    display: inline-block;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

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

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

.btn-outline {
    background: transparent;
    color: var(--color-white);
    border: 2px solid rgba(255,255,255,0.5);
}

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

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

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

/* Video player */
.video-shell {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: #000;
    aspect-ratio: 16 / 9;
}

.video-shell video,
.video-shell iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    object-fit: cover;
}

/* Native controls sit at the bottom once user unmutes */
.video-shell--controls video {
    object-fit: contain;
}

.unmute-overlay {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.75);
    color: #fff;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    z-index: 2;
}

.unmute-overlay.hidden { display: none; }

/* Stats */
.stats-section {
    padding: 4rem 0;
    background: linear-gradient(180deg, #f0f4fa 0%, var(--color-white) 40%, var(--color-white) 100%);
}

.stats-section h2 {
    text-align: center;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    margin-bottom: 0.5rem;
}

.stats-intro {
    text-align: center;
    color: var(--color-muted);
    max-width: 640px;
    margin: 0 auto 2.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.stats-animate-heading {
    opacity: 1;
    transform: none;
}

.stats-section.stats-animate-ready:not(.is-inview) .stats-animate-heading {
    opacity: 0;
    transform: translateY(24px);
}

.stats-section.is-inview .stats-animate-heading {
    animation: stats-fade-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.stats-section.is-inview .stats-intro.stats-animate-heading {
    animation-delay: 0.12s;
}

/* Dark bold stat cards (Style B + icons) */
.stat-card {
    position: relative;
    text-align: center;
    overflow: hidden;
    opacity: 1;
    transform: none;
}

.stat-card-dark {
    background: linear-gradient(145deg, var(--color-navy) 0%, #243a5e 100%);
    border-radius: 16px;
    padding: 2rem 1.5rem 1.75rem;
    color: var(--color-white);
    box-shadow: 0 10px 36px rgba(26, 43, 74, 0.28);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.stat-card-dark:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 48px rgba(26, 43, 74, 0.38);
}

.stats-section.stats-animate-ready:not(.is-inview) .stat-card {
    opacity: 0;
    transform: translateY(48px) scale(0.92);
}

.stats-section.is-inview .stat-card {
    animation: stats-card-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: calc(var(--stat-delay, 0) * 150ms + 200ms);
}

.stat-card-dark .stat-number {
    color: #ffd166;
    font-size: clamp(2.5rem, 6vw, 3.25rem);
}

.stat-card-dark .stat-label {
    color: rgba(255, 255, 255, 0.92);
}

.stat-card-dark .stat-source {
    color: rgba(255, 255, 255, 0.55);
}

/* Icon circles on dark cards */
.stat-icon-wrap {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto 1.15rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon-wrap-dark {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.stat-icon-wrap-dark .stat-icon {
    width: 30px;
    height: 30px;
    position: relative;
    z-index: 1;
}

.stat-icon-animate-heart {
    color: #ff6b8a;
}

.stats-section.is-inview .stat-icon-animate-heart {
    animation: icon-ring-pulse-heart 2s ease-in-out infinite;
}

.stat-icon-animate-heart .stat-icon {
    transform-origin: center;
}

.stats-section.is-inview .stat-icon-animate-heart .stat-icon {
    animation: icon-heartbeat 1.25s ease-in-out infinite;
}

.stat-icon-animate-chart {
    color: #5eead4;
}

.stats-section.is-inview .stat-icon-animate-chart {
    animation: icon-ring-pulse-teal 2.4s ease-in-out infinite;
}

.stat-icon-animate-chart .stat-icon {
    transform-origin: center bottom;
}

.stats-section.is-inview .stat-icon-animate-chart .stat-icon {
    animation: icon-chart-rise 2s ease-in-out infinite;
}

.stat-icon-animate-bolt {
    color: #ffd166;
}

.stats-section.is-inview .stat-icon-animate-bolt {
    animation: icon-ring-pulse-gold 1.8s ease-in-out infinite;
}

.stat-icon-animate-bolt .stat-icon {
    transform-origin: center;
}

.stats-section.is-inview .stat-icon-animate-bolt .stat-icon {
    animation: icon-bolt-flash 1.5s ease-in-out infinite;
}

.stat-icon-animate-alert {
    color: #ff8a8a;
}

.stats-section.is-inview .stat-icon-animate-alert {
    animation: icon-ring-pulse-alert 2.2s ease-in-out infinite;
}

.stat-icon-animate-alert .stat-icon {
    transform-origin: center;
}

.stats-section.is-inview .stat-icon-animate-alert .stat-icon {
    animation: icon-alert-pulse 2s ease-in-out infinite;
}

.stats-section.stats-animate-ready:not(.is-inview) .stat-icon-wrap {
    opacity: 0;
    transform: scale(0.5);
}

.stats-section.is-inview .stat-icon-wrap {
    animation: stats-icon-pop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: calc(var(--stat-delay, 0) * 150ms + 450ms);
}

.stat-number {
    font-family: var(--font-serif);
    line-height: 1;
    margin-bottom: 0.65rem;
    font-variant-numeric: tabular-nums;
    min-height: 3rem;
}

.stats-section.is-inview .stat-number.is-counted {
    animation: stats-pop 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.stat-label {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.45;
}

.stat-source {
    font-size: 0.75rem;
    margin-top: 0.85rem;
    font-style: italic;
}

@keyframes stats-fade-up {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes stats-card-in {
    from { opacity: 0; transform: translateY(48px) scale(0.92); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes stats-icon-pop {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes stats-pop {
    0% { transform: scale(1); }
    35% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes icon-heartbeat {
    0%, 100% { transform: scale(1); }
    12% { transform: scale(1.18); }
    24% { transform: scale(1); }
    36% { transform: scale(1.12); }
    48% { transform: scale(1); }
}

@keyframes icon-chart-rise {
    0%, 100% { transform: translateY(5px); opacity: 0.85; }
    50% { transform: translateY(-6px); opacity: 1; }
}

@keyframes icon-bolt-flash {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    45% { transform: scale(1.08); filter: brightness(1.5); }
    55% { transform: scale(1); filter: brightness(1.3); }
}

@keyframes icon-alert-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes icon-ring-pulse-heart {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 138, 0.45); }
    50% { box-shadow: 0 0 0 14px rgba(255, 107, 138, 0); }
}

@keyframes icon-ring-pulse-teal {
    0%, 100% { box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.4); }
    50% { box-shadow: 0 0 0 14px rgba(94, 234, 212, 0); }
}

@keyframes icon-ring-pulse-gold {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 209, 102, 0.5); }
    50% { box-shadow: 0 0 0 14px rgba(255, 209, 102, 0); }
}

@keyframes icon-ring-pulse-alert {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 138, 138, 0.4); }
    50% { box-shadow: 0 0 0 14px rgba(255, 138, 138, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .stats-section.stats-animate-ready:not(.is-inview) .stat-card,
    .stats-section.stats-animate-ready:not(.is-inview) .stats-animate-heading,
    .stats-section.stats-animate-ready:not(.is-inview) .stat-icon-wrap {
        opacity: 1;
        transform: none;
    }

    .stats-section.is-inview .stat-card,
    .stats-section.is-inview .stats-animate-heading,
    .stats-section.is-inview .stat-icon-wrap,
    .stats-section.is-inview .stat-number.is-counted,
    .stat-icon-animate-heart,
    .stat-icon-animate-chart,
    .stat-icon-animate-bolt,
    .stat-icon-animate-alert,
    .stat-icon-animate-heart .stat-icon,
    .stat-icon-animate-chart .stat-icon,
    .stat-icon-animate-bolt .stat-icon,
    .stat-icon-animate-alert .stat-icon {
        animation: none;
    }
}

/* About instructor */
.about-section {
    padding: 4rem 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2.5rem;
    align-items: start;
}

.about-photo {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.about-photo img {
    width: 100%;
    display: block;
}

.about-credentials {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.credential-tag {
    background: #eef2f8;
    color: var(--color-navy);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
}

/* Course / What You'll Learn */
.course-section {
    padding: 4rem 0;
    background: linear-gradient(180deg, var(--color-white) 0%, #f0f4fa 100%);
}

.course-section h2 {
    text-align: center;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    margin-bottom: 0.75rem;
}

.course-intro {
    text-align: center;
    color: var(--color-muted);
    max-width: 720px;
    margin: 0 auto 2rem;
    line-height: 1.65;
}

.learn-graphic-svg {
    width: 100%;
    height: auto;
    display: block;
}

.learn-graphic-svg-strip {
    max-width: 88px;
}

/* Bold feature strips */
.learn-stack-d {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
}

.learn-strip-d {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: center;
    gap: 1.25rem;
    background: linear-gradient(90deg, var(--color-navy) 0%, #243a5e 100%);
    border-radius: 12px;
    padding: 1rem 1.5rem 1rem 1rem;
    color: var(--color-white);
    box-shadow: 0 6px 20px rgba(26, 43, 74, 0.2);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.learn-strip-d:hover {
    transform: translateX(4px);
    box-shadow: 0 10px 28px rgba(26, 43, 74, 0.28);
}

.learn-strip-graphic {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.learn-strip-body h3 {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    color: #ffd166;
    margin: 0 0 0.25rem;
}

.learn-strip-body p {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.45;
}

@media (max-width: 560px) {
    .learn-strip-d {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .learn-strip-graphic {
        margin: 0 auto;
        max-width: 120px;
    }
}

/* Subscribe / Login panels */
.action-section {
    padding: 4rem 0;
}

.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.action-panel {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.action-panel h2 {
    margin-top: 0;
    font-size: 1.5rem;
}

.action-panel-highlight {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.paypal-wrap {
    min-height: 55px;
    margin-top: 1rem;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.form-group input {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus {
    outline: 2px solid var(--color-teal);
    border-color: var(--color-teal);
}

.form-hint {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-top: 0.35rem;
}

.alert {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.alert-error { background: #fde8ec; color: #8b1a2e; }
.alert-success { background: #e6f5ed; color: var(--color-success); }
.alert-info { background: #e8f0fe; color: #1a4a8a; }

.test-plan-banner {
    background: #fff3cd;
    color: #664d03;
    text-align: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-bottom: 1px solid #ffecb5;
}

.hidden { display: none !important; }

/* Page layouts */
.page-header {
    padding: 2.5rem 0 1.5rem;
}

.page-header h1 {
    margin: 0;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
}

.content-panel {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

/* Video library */
.video-library {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.video-lesson {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 2.5rem;
}

.video-lesson:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.lesson-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.lesson-number {
    background: var(--color-navy);
    color: var(--color-white);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    flex-shrink: 0;
}

.lesson-header h2 {
    margin: 0;
    font-size: 1.35rem;
}

.lesson-desc {
    color: var(--color-muted);
    margin-bottom: 1rem;
}

/* Account */
.account-detail {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0;
}

.account-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
}

.account-row strong { color: var(--color-navy); }

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-active { background: #e6f5ed; color: var(--color-success); }
.status-cancelled { background: #fde8ec; color: #8b1a2e; }
.status-suspended { background: #fff3e0; color: #b45309; }
.status-pending { background: #e8f0fe; color: #1a4a8a; }

/* Legal pages */
.legal-content h2 {
    font-size: 1.25rem;
    margin-top: 2rem;
}

.legal-content p, .legal-content li {
    color: var(--color-muted);
}

/* Footer */
.site-footer {
    background: var(--color-navy);
    color: rgba(255,255,255,0.85);
    padding: 3rem 0 0;
    margin-top: 3rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
    padding-bottom: 2rem;
}

.site-footer a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
}

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

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: 1.25rem 0;
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 860px) {
    .hero-grid,
    .about-grid,
    .action-grid {
        grid-template-columns: 1fr;
    }

    .hero-grid {
        gap: 1.75rem;
    }

    .hero-video {
        order: -1;
    }

    .about-photo {
        max-width: 280px;
        margin: 0 auto;
    }

    .about-text {
        text-align: center;
    }

    .about-credentials {
        justify-content: center;
    }

    .header-inner {
        flex-wrap: wrap;
        padding: 0.65rem 0;
    }

    .logo {
        flex: 1 1 100%;
    }

    .logo-bg {
        height: clamp(48px, 14vw, 64px);
        background-size: contain;
    }

    .site-nav {
        flex: 1 1 100%;
        justify-content: center;
        font-size: 0.85rem;
        gap: 0.5rem;
    }

    .stats-section,
    .about-section,
    .course-section,
    .action-section {
        padding: 2.5rem 0;
    }

    .stat-card-dark {
        padding: 1.5rem 1.25rem;
    }

    .account-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 1rem;
    }

    .container {
        width: min(1120px, 94vw);
    }

    .hero {
        padding: 1.75rem 0 2.5rem;
    }

    .hero h1 {
        font-size: clamp(1.65rem, 8vw, 2rem);
    }

    .hero-lead {
        font-size: 1rem;
    }

    .hero-cta {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-cta .btn {
        width: 100%;
        text-align: center;
    }

    .action-panel {
        padding: 1.25rem;
    }

    .site-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .site-nav .nav-btn {
        text-align: center;
        width: 100%;
    }

    .lesson-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .lesson-header h2 {
        font-size: 1.15rem;
    }

    .content-panel {
        padding: 1.25rem;
    }

    .unmute-overlay {
        font-size: 0.8rem;
        padding: 0.5rem 0.9rem;
        max-width: calc(100% - 2rem);
        white-space: nowrap;
    }

    #login-back {
        margin-left: 0 !important;
        margin-top: 0.5rem;
        width: 100%;
    }

    .action-panel .btn-dark {
        width: 100%;
    }

    #code-form .btn-dark:first-of-type {
        width: 100%;
    }
}
