/* ===== Home Page Layout ===== */
/* Scoped to real devices — avoids :has() (unsupported on some mobile browsers) */
body.page-home {
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
}

html.page-home {
    overflow-x: hidden;
    max-width: 100%;
}

.container.page-home-container {
    width: 100%;
    max-width: 100%;
    padding-left: 10px;
    padding-right: 10px;
    margin-top: 0.5rem;
    box-sizing: border-box;
    overflow-x: hidden;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

.home-page {
    margin-top: -0.5rem;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

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

/* ===== Hero Section ===== */
.homepage-hero {
    margin: 0 0 48px 0;
    background: linear-gradient(135deg, #e0e7ff 0%, #f0f4ff 45%, #f9fafb 100%);
    border-radius: 16px;
    padding: 1.25rem 0.85rem;
    box-shadow: 0 4px 24px rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(224, 231, 255, 0.9);
    overflow: hidden;
    position: relative;
    width: 100%;
    max-width: 100%;
}

.homepage-hero::before {
    display: none;
}

.hero-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
    position: relative;
    z-index: 1;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.hero-grid > * {
    min-width: 0;
    max-width: 100%;
}

.hero-content {
    text-align: center;
    order: 1;
    animation: fadeInUp 0.8s cubic-bezier(0.44, 0.13, 0.48, 0.87);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.85);
    color: #2563eb;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid #c7d2fe;
    margin-bottom: 1.25rem;
}

.hero-content h1 {
    font-size: clamp(2rem, 4vw, 2.85rem);
    font-weight: 900;
    color: #172554;
    margin-bottom: 0.55em;
    letter-spacing: -0.5px;
    line-height: 1.15;
}

.brand-highlight {
    color: #2563eb !important;
    font-weight: 900;
}

.hero-tagline {
    font-size: clamp(0.68rem, 3.1vw, 0.92rem);
    color: #334155;
    margin-bottom: 0.85rem;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    justify-content: center;
    align-items: center;
}

.hero-cta-block {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.15rem;
}

.hero-account-prompt {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 500;
    color: #64748b;
    line-height: 1.4;
}

.hero-signup-link {
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
}

.hero-signup-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.hero-actions-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
}

.btn-hero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.52rem 1.15rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.84rem;
    text-decoration: none !important;
    white-space: nowrap;
    min-height: 2.45rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    box-sizing: border-box;
}

.btn-hero-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff !important;
    border: 1.5px solid transparent;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}

.btn-hero-primary:hover {
    background: #1d4ed8;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.35);
}

.btn-hero-secondary {
    background: #fff;
    color: #2563eb;
    border: 1.5px solid #bfdbfe;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.08);
}

.btn-hero-secondary:hover {
    background: #f8fbff;
    color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.14);
}

.btn-hero-secondary.is-open {
    background: #eff6ff;
    border-color: #60a5fa;
}

.hero-dashboard-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
    text-decoration: none;
    transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
}

.hero-dashboard-btn:hover,
.hero-dashboard-btn:focus {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.35);
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    order: 2;
    animation: fadeInUp 0.9s 0.12s cubic-bezier(0.44, 0.13, 0.48, 0.87) both;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    padding: 0;
}

.hero-image-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: none;
    border: none;
    background: transparent;
}

.hero-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: contain;
    object-position: center;
    vertical-align: middle;
    -webkit-user-drag: none;
}

/* ===== Features Section ===== */
.features-section {
    text-align: left;
    margin: 0 0 2.5rem;
    animation: featuresReveal 0.45s ease;
}

.features-section.is-hidden,
.features-section[hidden] {
    display: none !important;
}

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

.features-panel {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.75rem 1.25rem 1.5rem;
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(239, 246, 255, 0.95) 0%, rgba(255, 255, 255, 0.98) 42%, #fff 100%);
    border: 1px solid #dbeafe;
    box-shadow: 0 10px 36px rgba(37, 99, 235, 0.08);
}

.features-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.features-section h2 {
    font-size: clamp(1.35rem, 2.5vw, 1.7rem);
    color: #172554;
    font-weight: 800;
    margin: 0 0 0.45rem;
    letter-spacing: -0.02em;
}

.features-intro {
    color: #64748b;
    font-size: 0.98rem;
    line-height: 1.5;
    margin: 0 auto;
    max-width: 34rem;
}

.features-list,
.home-tour-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    justify-content: stretch;
    flex-wrap: unset;
}

.feature-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.9rem;
    align-items: start;
    padding: 1rem 1.05rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #e2e8f0;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.feature-item:hover {
    border-color: #93c5fd;
    background: #fff;
    transform: translateY(-2px);
}

.feature-icon {
    width: 44px;
    height: 44px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
    color: #1d4ed8;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.feature-copy h3 {
    color: #0f172a;
    margin: 0.1rem 0 0.35rem;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.25;
}

.feature-copy p {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.45;
}

/* Legacy card styles kept for safety if referenced elsewhere */
.feature-card {
    display: none;
}

@media (min-width: 640px) {
    .features-panel {
        padding: 2rem 1.75rem 1.75rem;
    }

    .features-list,
    .home-tour-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
}

@media (min-width: 960px) {
    .features-list,
    .home-tour-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* ===== CTA Section ===== */
.cta-section {
    background: linear-gradient(135deg, hsl(178, 45%, 38%) 0%, hsl(178, 50%, 32%) 100%);
    color: #fff;
    padding: 44px 32px 38px;
    text-align: center;
    border-radius: 20px;
    max-width: 900px;
    margin: 0 auto 40px;
    box-shadow: 0 8px 32px rgba(51, 129, 129, 0.18);
}

.cta-section h2 {
    font-size: 1.5rem;
    margin-bottom: 0.45em;
    font-weight: 800;
}

.cta-section > p {
    font-size: 1.05rem;
    margin-bottom: 1.35rem;
    opacity: 0.95;
}

.cta-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.cta-section a {
    background: #fff;
    color: hsl(178, 45%, 32%);
    padding: 0.7rem 1.6rem;
    border-radius: 9px;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: background 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s;
    display: inline-block;
}

.cta-section a:hover {
    background: #d1f5f5;
    color: hsl(178, 50%, 24%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(32px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Responsive ===== */
@media (min-width: 993px) {
    .homepage-hero {
        padding: 48px 40px;
        border-radius: 24px;
        margin-bottom: 64px;
    }

    .homepage-hero::before {
        display: block;
        content: "";
        position: absolute;
        top: -120px;
        right: -80px;
        width: 320px;
        height: 320px;
        background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
        pointer-events: none;
    }

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

    .hero-content {
        text-align: left;
        order: unset;
    }

    .hero-visual {
        order: unset;
    }

    .hero-tagline {
        font-size: 1.15rem;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }

    .hero-actions {
        justify-content: flex-start;
    }

    .hero-cta-block {
        align-items: flex-start;
    }

    .hero-actions-main {
        justify-content: flex-start;
    }

    .btn-hero {
        padding: 0.65rem 1.35rem;
        font-size: 0.92rem;
    }

    .hero-image-wrap {
        border-radius: 18px;
        box-shadow: 0 16px 48px rgba(23, 37, 84, 0.14);
        border: 1px solid rgba(255, 255, 255, 0.75);
        background: #fff;
    }

    .hero-image {
        max-height: none;
    }
}

@media (max-width: 1100px) {
    .features-list {
        gap: 1.4rem;
    }

    .feature-card {
        width: 270px;
    }
}

@media (max-width: 900px) {
    .features-list {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }

    .feature-card {
        width: 100%;
        max-width: 420px;
    }

    .cta-section {
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .homepage-hero {
        padding: 1.1rem 0.75rem;
        margin-bottom: 28px;
    }

    .hero-content h1 {
        font-size: 1.5rem;
    }

    .hero-badge {
        font-size: 0.7rem;
    }

    .features-section {
        margin-bottom: 40px;
    }

    .features-section h2,
    .cta-section h2 {
        font-size: 1.2rem;
    }

    .feature-card {
        padding: 24px 18px;
    }

    .cta-section {
        padding: 28px 16px 24px;
        border-radius: 16px;
    }
}

/* ===== How it works + feature tour + pricing teaser ===== */
.home-how,
.home-pricing {
    margin: 0 0 48px;
    padding: 0 0.25rem;
}

.home-how h2,
.home-pricing h2 {
    text-align: center;
    font-size: 1.45rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.home-section-intro {
    text-align: center;
    color: #64748b;
    max-width: 560px;
    margin: 0 auto 1.5rem;
    font-size: 0.98rem;
}

.home-steps {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.home-steps li {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.15rem;
}

.home-step-num {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.home-steps strong {
    display: block;
    color: #0f172a;
    margin-bottom: 0.2rem;
}

.home-steps p {
    margin: 0;
    color: #64748b;
    font-size: 0.92rem;
}

.home-tour-grid {
    /* inherits features-list grid */
}

.home-pricing {
    text-align: center;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    border: 1px solid #bfdbfe;
    border-radius: 16px;
    padding: 2rem 1.25rem;
}

.home-pricing-note {
    color: #475569;
    font-size: 0.92rem;
    max-width: 480px;
    margin: 0 auto 1.25rem;
}

.home-pricing-cta {
    justify-content: center;
}
