/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.65;
    color: #011a30;
    background-color: #ffffff;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

/* Page Transition */
body.preload {
    opacity: 0;
}

body.ready {
    opacity: 1;
    transition: opacity 250ms ease;
}

body.fade-exit {
    opacity: 0 !important;
    transition: opacity 180ms ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Typography - Following Heartify's style */
.header1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.header2 {
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.3;
    margin-bottom: 2rem;
    text-align: center;
}

.header3 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.05em;
    margin-bottom: 1rem;
}

/* Header Navigation - Heartify Style */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px);
    border-bottom: 1px solid rgba(237, 241, 243, 0.5);
    padding: 0;
    height: 80px;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.header-brand .logo {
    height: 50px;
    width: auto;
}

.header-nav {
    display: flex;
    gap: 2rem;
}

.header-nav div a {
    color: #011a30;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.headerlink > div > a:hover {
    color: #FF003F !important;
    transition: .2s;
}

.header-cta .btn-download {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #FF003F;
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.btn-download img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

/* Opacity hover effect */
.opacity70:hover {
    opacity: 0.7 !important;
    transition: opacity .2s;
}

/* Hero Section */
.hero {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

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

.hero-text {
    animation: fadeInLeft 1s ease-out;
}

.hero-text p {
    font-size: 1.125rem;
    color: #64748b;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.medical-disclaimer {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 1rem;
    margin: 1.5rem 0;
}

.medical-disclaimer p {
    color: #92400e;
    font-size: 0.875rem;
    margin: 0;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    padding: 14px 28px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 18px;
    transition: all 0.3s ease;
    display: inline-block;
    border: 2px solid transparent;
}

.btn-primary {
    background: #FF003F;
    color: white;
    border-color: #FF003F;
}

.btn-primary:hover {
    background: #e6002e;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: #FF003F;
    border: 2px solid #FF003F;
}

.btn-secondary:hover {
    background: #FF003F;
    color: white;
    transform: translateY(-2px);
}

/* Button with arrows - Heartify style */
.button-arrows {
    padding-left: 75px !important;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 24 24" fill="white"><path d="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"/></svg>');
    background-size: 60px;
    background-repeat: no-repeat;
    background-position: left center;
}

.hero-image {
    position: relative;
    animation: fadeInRight 1s ease-out;
}

.hero-image img {
    width: 100%;
    height: auto;
    max-width: 400px;
    border-radius: 16px;
    /* box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1); */
    position: relative;
    z-index: 2;
}

.hero-image-bg {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 100%;
    height: 100%;
    /* background: linear-gradient(135deg, #FF003F 0%, #e6002e 100%); */
    border-radius: 16px;
    z-index: 1;
}

/* Hero Carousel */
.hero-carousel {
    position: relative;
    width: 100%;
    max-width: 340px; /* slightly smaller while keeping proportions */
    margin: 0 auto;
    overflow: hidden;
}

.hero-carousel .hero-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* show full image content */
    border-radius: 16px;
    opacity: 0;
    transform: scale(0.995);
    transition: opacity 420ms cubic-bezier(0.22, 0.61, 0.36, 1),
                transform 420ms cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: opacity, transform;
    background: transparent;
    z-index: 1;
}

.hero-carousel .hero-slide.active {
    opacity: 1;
    transform: scale(1);
    z-index: 2;
}

/* When sizing in JS to compute consistent height */
.hero-carousel.is-sizing { visibility: hidden; }

/* Features Section */
.features {
    padding: 80px 0;
    background: white;
}

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

.feature-card {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(255, 0, 63, 0.1);
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: #ffe4e8;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.feature-icon img {
    width: 32px;
    height: 32px;
    filter: invert(10%) sepia(90%) saturate(7491%) hue-rotate(348deg) brightness(95%) contrast(107%);
}

.feature-card p {
    color: #64748b;
    line-height: 1.6;
}

/* How It Works Section */
.how-it-works {
    padding: 80px 0;
    background: #f8fafc;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
}

.step-card {
    text-align: center;
    padding: 2rem;
}

.step-number {
    font-size: 3rem;
    font-weight: 700;
    color: #FF003F;
    margin-bottom: 1rem;
}

.step-card img {
    width: 100%;
    max-width: 200px;
    height: auto;
    margin-top: 2rem;
    border-radius: 12px;
}

/* Video in steps (Measure) uses same sizing as image, keeps full content */
.step-card .measure-video {
    width: 100%;
    max-width: 200px; /* match image cap for consistent layout */
    height: auto;
    margin: 2rem auto 0; /* center horizontally */
    border-radius: 12px;
    display: block;
    background: #000; /* letterbox background if aspect differs */
    object-fit: contain; /* show full video without cropping */
    transition: opacity .4s ease-in-out; /* smooth fade at loop */
}

/* Slideshow in steps (Record) — reuse same sizing, add fade */
.step-card .record-slideshow {
    transition: opacity .4s ease-in-out;
}

.step-card .measure-video.alt {
    margin-top: 1rem; /* tighter gap for second video */
}

.step-card .measure-video-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* (reverted) removed Measure animation specific styles */

/* Stats Section */
.stats {
    padding: 60px 0;
    background: #011a30;
}

/* FAQ Section */
.faq {
    padding: 80px 0;
    background: #ffffff;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-accordion .faq-item {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.faq-summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hide default marker */
.faq-accordion summary::-webkit-details-marker { display: none; }
.faq-accordion summary::marker { content: ''; }

/* Caret indicator */
.faq-summary::after {
    content: '\25BC';
    font-size: 0.85rem;
    color: #64748b;
    margin-left: 12px;
    flex: 0 0 auto;
}

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

.faq-body {
    display: none;
    padding: 0 18px 16px 18px;
}

.faq-accordion details[open] .faq-body {
    display: block;
}

.faq-body p {
    color: #64748b;
    margin-top: 6px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-item h3 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #FF003F;
    margin-bottom: 0.5rem;
}

.stat-item p {
    color: #cbd5e1;
    font-size: 1.125rem;
}

/* Download Section */
.download {
    padding: 80px 0;
    background: linear-gradient(135deg, #FF003F 0%, #e6002e 100%);
    color: white;
    text-align: center;
}

.download h2 {
    color: white;
}

.download p {
    font-size: 1.125rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
}

.download-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.download-btn img {
    height: 60px;
    width: auto;
    transition: transform 0.3s ease;
}

.download-btn:hover img {
    transform: scale(1.05);
}

.google-play {
    background: #000;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    min-width: 150px;
    height: 60px;
    justify-content: center;
}

.google-play span {
    font-size: 12px;
    opacity: 0.8;
}

.google-play strong {
    font-size: 16px;
    font-weight: 600;
}

/* Disclaimer Section */
.disclaimer {
    padding: 60px 0;
    background: #fefefe;
    border-top: 1px solid #e5e7eb;
}

.disclaimer h2 {
    color: #dc2626;
}

.disclaimer-content {
    max-width: 800px;
    margin: 0 auto;
}

.disclaimer-content p {
    color: #374151;
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.disclaimer-content ul {
    color: #6b7280;
    line-height: 1.6;
    margin: 2rem 0;
    padding-left: 2rem;
}

.disclaimer-content li {
    margin-bottom: 0.75rem;
    padding: 5px 0;
}

/* Footer */
.footer {
    background: #011a30;
    color: white;
    padding: 40px 0 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.footer-brand .logo {
    height: 40px;
    filter: brightness(0) invert(1);
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links div a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.3s ease;
    background-image: linear-gradient(currentColor, currentColor);
    background-position: 0% 100%;
    background-repeat: no-repeat;
    background-size: 0% 1px;
    transition: background-size .2s;
    padding-bottom: 2px;
}

.footer > div > div > a:hover {
    background-size: 100% 1px;
}

.footer-links div a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #374151;
}

.footer-bottom p {
    color: #9ca3af;
}

/* Popup Styles */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(1, 26, 48, 0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-container {
    position: relative;
    max-width: 80%;
    max-height: 80%;
}

.popup-close {
    position: absolute;
    top: -40px;
    right: -40px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 2001;
}

.popup-content video {
    width: 100%;
    height: auto;
    border-radius: 12px;
}

/* Animations */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Responsive Design */
@media (max-width: 1199px) {
    .container {
        padding: 0 20px;
    }

    .header-container {
        padding: 0 20px;
    }
}

@media (max-width: 959px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .header2 {
        letter-spacing: -0.05em;
    }
}

@media (max-width: 768px) {
    .header-nav {
        display: none;
    }

    .hero {
        padding: 100px 0 60px;
    }

    .header1 {
        font-size: 2.25rem;
    }

    .header2 {
        font-size: 2rem;
    }

    .hero-buttons {
        justify-content: center;
        flex-direction: column;
        align-items: center;
    }

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

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

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

    .download-buttons {
        flex-direction: column;
        align-items: center;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 639px) {
    .button-arrows {
        padding-left: 50px !important;
        background-size: 40px;
    }
}

@media (max-width: 479px) {
    .container {
        padding: 0 15px;
    }

    .header-container {
        padding: 0 15px;
    }

    .header1 {
        font-size: 1.875rem;
    }

    .btn {
        padding: 12px 24px;
        font-size: 16px;
    }

    .feature-card {
        padding: 1.5rem;
    }

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

    .stat-item h3 {
        font-size: 2rem;
    }
}
