/* =============================================
   EGONEX - Home Page
   Fase A: visual alignment to approved mockup.
   ============================================= */

/* Header/navigation visuals are now shared in components/header.css */

.home-hero {
    position: relative;
    overflow: hidden;
    padding-top: calc(var(--spacing-3xl) + var(--spacing-xl));
}

.home-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 30% 20%, color-mix(in oklab, var(--color-blue) 24%, transparent) 0%, transparent 70%),
        radial-gradient(ellipse 50% 60% at 70% 80%, color-mix(in oklab, var(--bg-dark-mid) 65%, transparent) 0%, transparent 60%),
        radial-gradient(circle at 80% 20%, color-mix(in oklab, var(--color-orange) 10%, transparent) 0%, transparent 40%);
    pointer-events: none;
}

.home-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(color-mix(in oklab, var(--text-on-dark) 3%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in oklab, var(--text-on-dark) 3%, transparent) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

.home-hero__inner {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 900px;
    margin-inline: auto;
}

.home-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border: 1px solid color-mix(in oklab, var(--color-orange) 62%, transparent);
    border-radius: var(--radius-full);
    color: var(--color-orange);
    background: color-mix(in oklab, var(--color-orange) 22%, transparent);
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.section--dark .home-hero__badge {
    color: var(--color-orange);
}

.home-hero__badge-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--color-orange);
    box-shadow: 0 0 10px color-mix(in oklab, var(--color-orange) 55%, transparent);
    animation: home-badge-pulse 2s infinite;
}

@keyframes home-badge-pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.84);
    }
}

.home-hero__title {
    margin-top: 0;
    color: var(--text-on-dark);
    font-size: clamp(var(--font-size-3xl), 6.2vw, var(--font-size-5xl));
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.home-hero__title-part {
    color: var(--text-on-dark);
}

.home-hero__title-highlight {
    color: var(--color-orange);
}

.home-hero__title-break {
    display: block;
    color: var(--text-on-dark);
}

.home-hero__subtitle {
    max-width: 700px;
    margin: var(--spacing-md) auto 0;
    color: color-mix(in oklab, var(--text-on-dark) 66%, transparent);
    font-size: clamp(var(--font-size-base), 2vw, var(--font-size-lg));
    font-weight: 400;
}

.home-hero__stats {
    margin-top: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    gap: 0;
    background: color-mix(in oklab, var(--text-on-dark) 6%, transparent);
    border: 1px solid color-mix(in oklab, var(--text-on-dark) 12%, transparent);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.home-hero__stats .stat {
    background: transparent;
    border: 0;
    box-shadow: none;
    border-bottom: 1px solid color-mix(in oklab, var(--text-on-dark) 10%, transparent);
}

.home-hero__stats .stat:last-child {
    border-bottom: 0;
}

.home-hero__stats .stat__value {
    color: var(--text-on-dark);
}

.home-hero__stats .stat__accent {
    color: var(--color-orange);
}

.home-hero__stats .stat__label {
    color: color-mix(in oklab, var(--text-on-dark) 52%, transparent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.home-hero__note {
    margin-top: var(--spacing-sm);
    color: color-mix(in oklab, var(--text-on-dark) 36%, transparent);
    font-style: italic;
}

.home-products {
    padding-block: var(--spacing-3xl);
}

.home-products .section__header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.home-products .section__title {
    margin-bottom: 0;
}

.home-products__grid {
    display: grid;
    gap: var(--spacing-lg);
}

.home-product {
    padding: 0;
    gap: 0;
    overflow: hidden;
    transition:
        box-shadow var(--transition-slow),
        border-color var(--transition-slow),
        transform var(--transition-slow);
}

.home-product:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.home-product:focus-within {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.home-product__heading {
    padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-md);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xs);
}

.home-product__icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-xs);
}

.home-product__icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.home-product__icon--ecp {
    background: var(--color-blue);
    color: var(--text-on-dark);
    box-shadow: var(--shadow-md);
}

.home-product__icon--emergency {
    background: var(--color-orange);
    color: var(--text-on-dark);
    box-shadow: var(--shadow-md);
}

.home-products__grid .home-product:first-child .home-product__heading {
    background: linear-gradient(
        135deg,
        color-mix(in oklab, var(--color-blue) 12%, var(--bg-white)),
        color-mix(in oklab, var(--color-blue) 3%, var(--bg-white))
    );
}

.home-products__grid .home-product:last-child .home-product__heading {
    background: linear-gradient(
        135deg,
        color-mix(in oklab, var(--color-orange) 14%, var(--bg-white)),
        color-mix(in oklab, var(--color-orange) 4%, var(--bg-white))
    );
}

.home-product .card__label {
    margin-bottom: 0;
    border-radius: var(--radius-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    letter-spacing: 0.06em;
}

.home-products__grid .home-product:first-child .card__label {
    color: var(--color-blue);
    background: var(--bg-gray-medium);
}

.home-products__grid .home-product:last-child .card__label {
    color: var(--color-orange-dark);
    background: var(--color-orange-light);
}

.home-product .card__title {
    font-size: var(--font-size-2xl);
}

.home-product .comparison-bars,
.home-product .home-product__mini-stats,
.home-product .card__text,
.home-product .home-product__snippet,
.home-product .card__actions {
    margin-inline: var(--spacing-lg);
}

.home-product .comparison-bars,
.home-product .home-product__mini-stats {
    margin-top: var(--spacing-md);
}

.home-product .card__text {
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.home-product .card__actions {
    margin-bottom: var(--spacing-lg);
}

.home-product .card__actions .btn::after {
    content: "→";
    font-size: var(--font-size-xs);
    transition: transform var(--transition-fast);
}

.home-product .card__actions .btn:hover::after,
.home-product .card__actions .btn:focus-visible::after {
    transform: translateX(var(--spacing-xs));
}

.home-product .comparison-row:last-child .comparison-row__value {
    color: var(--color-blue);
}

.home-product .comparison-row__track {
    height: var(--spacing-sm);
    background: var(--bg-gray-medium);
}

.home-product .comparison-row__fill {
    display: block;
    height: 100%;
    border-radius: var(--radius-full);
}

.home-product .comparison-row__fill--cap {
    width: 100%;
    background: color-mix(in oklab, var(--text-muted) 65%, var(--bg-gray-medium));
}

.home-product .comparison-row__fill--json {
    width: 40.36%;
    background: color-mix(in oklab, var(--color-blue) 55%, var(--border-medium));
}

.home-product .comparison-row__fill--uet {
    width: 1.2%;
    min-width: var(--spacing-xs);
    background: color-mix(in oklab, var(--color-blue) 70%, var(--color-orange));
}

.home-product__snippet {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: calc(100% - (var(--spacing-lg) * 2));
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-gray-medium);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    overflow-x: auto;
    margin-bottom: var(--spacing-md);
}

.home-product__mini-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--spacing-xs);
    background: linear-gradient(
        135deg,
        color-mix(in oklab, var(--color-orange) 8%, var(--bg-white)),
        color-mix(in oklab, var(--color-orange) 3%, var(--bg-white))
    );
    border: 1px solid color-mix(in oklab, var(--color-orange) 16%, transparent);
    border-radius: var(--radius-sm);
    padding: var(--spacing-sm);
}

.home-mini-stat {
    text-align: center;
    padding: var(--spacing-xs);
    border-right: 1px solid color-mix(in oklab, var(--color-orange) 18%, transparent);
}

.home-mini-stat:last-child {
    border-right: 0;
}

.home-mini-stat__value {
    color: var(--color-orange-dark);
    font-size: var(--font-size-xl);
    font-weight: 800;
    line-height: 1;
}

.home-mini-stat__label {
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.3;
}

.home-about-section {
    background: linear-gradient(135deg, var(--bg-dark), var(--bg-dark-mid));
    position: relative;
    overflow: hidden;
}

.home-about-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at 70% 45%,
        color-mix(in oklab, var(--color-blue) 20%, transparent) 0%,
        transparent 62%
    );
    pointer-events: none;
}

.home-about {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin-inline: auto;
    text-align: center;
}

.home-about .section__title {
    color: var(--text-on-dark);
}

.home-about__text {
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    color: var(--text-on-dark-muted);
}

.home-about__badges {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-md);
}

.home-about__badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    border: 1px solid var(--border-on-dark);
    border-radius: var(--radius-full);
    background: color-mix(in oklab, var(--text-on-dark) 8%, transparent);
    color: color-mix(in oklab, var(--text-on-dark) 88%, transparent);
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.home-about .btn--outline {
    color: var(--text-on-dark);
    border-color: var(--border-on-dark-light);
}

.home-about .btn--outline:hover,
.home-about .btn--outline:focus-visible {
    color: var(--text-on-dark);
    border-color: color-mix(in oklab, var(--text-on-dark) 30%, transparent);
    background: color-mix(in oklab, var(--text-on-dark) 12%, transparent);
}

@media (prefers-reduced-motion: no-preference) {
    .home-hero__badge,
    .home-hero__title,
    .home-hero__subtitle,
    .home-hero__stats,
    .home-hero__note {
        opacity: 0;
        transform: translateY(var(--spacing-md));
        animation: home-fade-up 600ms ease forwards;
    }

    .home-hero__badge {
        animation-delay: 50ms;
    }

    .home-hero__title {
        animation-delay: 120ms;
    }

    .home-hero__subtitle {
        animation-delay: 180ms;
    }

    .home-hero__stats {
        animation-delay: 240ms;
    }

    .home-hero__note {
        animation-delay: 300ms;
    }

    .home-products__grid .home-product {
        opacity: 0;
        transform: translateY(var(--spacing-md));
        animation: home-fade-up 650ms ease forwards;
    }

    .home-products__grid .home-product:first-child {
        animation-delay: 160ms;
    }

    .home-products__grid .home-product:last-child {
        animation-delay: 240ms;
    }
}

@keyframes home-fade-up {
    from {
        opacity: 0;
        transform: translateY(var(--spacing-md));
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════ CONTACT SEPARATOR ═══════════════ */
.contact-separator {
    height: 4px;
    background: linear-gradient(90deg, var(--color-blue), var(--color-orange), var(--color-blue));
}

/* ═══════════════ HOME CONTACT (Card flottanti - design Claudio) ═══════════════ */
.home-contact {
    padding: var(--spacing-2xl) var(--spacing-md) var(--spacing-3xl);
    background: color-mix(in oklab, var(--bg-gray-medium) 70%, var(--bg-gray));
}

.home-contact .container {
    max-width: 1100px;
    margin: 0 auto;
}

.home-contact__header {
    margin-bottom: var(--spacing-xl);
}

.home-contact__title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.home-contact__subtitle {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

.home-contact__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
}

/* Contact info card */
.contact-info-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg), var(--shadow-sm);
}

.contact-info-card__header {
    border-bottom: 2px solid var(--color-blue);
    padding-bottom: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.contact-info-card__title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
}

.contact-info-card__body {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.ci-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ci-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.ci-value {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
}

.ci-value a {
    color: var(--color-orange);
    text-decoration: none;
}

.ci-value a:hover {
    text-decoration: underline;
}

/* Contact form card */
.contact-form-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg), var(--shadow-sm);
}

.contact-form-card__title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.home-contact .contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.home-contact__form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

.home-contact .form-input,
.home-contact .form-textarea {
    background: var(--bg-gray);
}

.home-contact .form-input:focus,
.home-contact .form-textarea:focus {
    background: var(--bg-white);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-blue) 10%, transparent);
}

.home-contact__privacy {
    padding: var(--spacing-sm);
    background: transparent;
    border: none;
}

.home-contact__privacy .form-checkbox__label a {
    color: var(--color-orange);
}

@media (min-width: 768px) {
    .home-hero__stats {
        flex-direction: row;
        border-radius: var(--radius-lg);
    }

    .home-hero__stats .stat {
        flex: 1;
        border-bottom: 0;
        border-right: 1px solid color-mix(in oklab, var(--text-on-dark) 10%, transparent);
    }

    .home-hero__stats .stat:last-child {
        border-right: 0;
    }

    .home-products__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-product .card__title {
        min-height: calc(var(--font-size-2xl) * 2.6);
    }

    .home-contact__grid {
        grid-template-columns: 1fr 1.3fr;
    }

    .home-contact__form-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .home-hero__title {
        font-size: clamp(var(--font-size-4xl), 4vw, var(--font-size-5xl));
    }

    .home-hero__stats .stat {
        padding: var(--spacing-lg);
    }
}

@media (max-width: 767px) {
    .home-hero {
        padding-top: calc(var(--spacing-3xl) + var(--spacing-lg));
    }

    .home-hero__stats .stat {
        padding: var(--spacing-md) var(--spacing-sm);
    }

    .home-hero__stats .stat__value {
        font-size: var(--font-size-2xl);
    }

    .home-hero__stats .stat__label {
        letter-spacing: 0.03em;
    }

    .home-product .comparison-row {
        grid-template-columns: 72px 1fr auto;
    }

    .home-product .comparison-row__value {
        min-width: 32px;
        text-align: right;
    }

    .home-contact {
        padding: var(--spacing-xl) var(--spacing-md) var(--spacing-2xl);
    }
}

@media (prefers-reduced-motion: reduce) {
    body[data-page="home"] .site-header,
    body[data-page="home"] .mobile-menu,
    .home-hero__stats {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .home-product,
    .home-product:focus-within,
    .home-product:hover {
        transform: none;
    }
}
