﻿/**
 * CodeCodec — Accueil desktop
 * Mobile  : style.css (< 768 px)
 * Desktop : ≥ 768 px (structure unique ; hero 2 colonnes dès 1024 px)
 */

.codec-desktop-only {
    display: none !important;
}

.desktop-only-block {
    display: none;
}

.text-highlight-green {
    color: #0A8F5A;
    font-weight: 700;
}

.btn-register {
    background: transparent;
    color: var(--orange-brand) !important;
    border-color: var(--orange-brand);
    box-shadow: none;
}

.btn-register:hover {
    background: var(--orange-light);
    border-color: var(--orange-brand);
    color: var(--orange-brand) !important;
    transform: scale(1.03);
    box-shadow: 0 4px 10px rgba(234, 88, 12, 0.08);
}

.btn-register i {
    color: var(--orange-brand) !important;
}

.section-separator {
    height: 1px;
    width: 100%;
    max-width: 100%;
    margin: 5px auto;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0) 0%, rgba(148, 163, 184, 0.25) 20%, rgba(148, 163, 184, 0.25) 80%, rgba(148, 163, 184, 0) 100%);
}

.footer-seo-text {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 16px;
    text-align: left;
    box-sizing: border-box;
}

.footer-seo-text p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-weight: 500;
    margin: 0;
}

.reviews-slider-container {
    position: relative;
    width: 100%;
}

.btn-slider-arrow {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    cursor: pointer;
    transition: var(--transition-bounce);
    outline: none;
}

.btn-slider-arrow.btn-slider-left {
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.btn-slider-arrow.btn-slider-right {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.btn-slider-arrow .slider-arrow-glyph {
    font-size: 1.65rem;
    line-height: 1;
    font-weight: 700;
    display: block;
    margin-top: -3px;
    color: inherit;
    pointer-events: none;
    user-select: none;
}

.btn-slider-arrow i,
.btn-slider-arrow svg {
    width: 18px;
    height: 18px;
}

.btn-slider-arrow:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #FFFFFF;
}

.btn-slider-arrow.btn-slider-left:hover {
    transform: translateY(-50%) scale(1.08);
}

.btn-slider-arrow.btn-slider-right:hover {
    transform: translateY(-50%) scale(1.08);
}

.btn-slider-arrow.is-disabled,
.btn-slider-arrow:disabled {
    opacity: 0.35;
    cursor: default;
}

.hero-and-cards-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 768px) {

    html { scroll-behavior: smooth; }

    body {
        background-color: var(--bg-body);
        display: block !important;
        padding: 0 !important;
        position: relative;
        overflow-x: hidden;
    }

    body::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 1000px;
        background-image: url('/codecodec/hero_background.png');
        background-repeat: no-repeat;
        background-position: top center;
        background-size: 100% auto;
        z-index: -1;
        opacity: 0.95;
        filter: saturate(1.25) contrast(1.05) brightness(0.98);
        pointer-events: none;
    }

    .codec-mobile-only {
        display: none !important;
    }

    .codec-desktop-only.codec-desktop-flex {
        display: flex !important;
    }

    .desktop-only-block {
        display: block !important;
    }

    .app-container {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 0 60px 0 !important;
        background-color: transparent !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
        height: auto !important;
        min-height: auto !important;
        overflow-x: clip !important;
        overflow-y: visible !important;
        display: block !important;
    }

    .app-container > * {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    /* Header */
    .header-tagline-row {
        font-size: 0.82rem;
        padding: 8px 12px;
    }

    .app-header.codec-desktop-only {
        position: relative;
        margin: 0;
        background: transparent;
        backdrop-filter: none;
        box-shadow: none;
        border-bottom: none;
        width: 100%;
    }

    .app-header.codec-desktop-only .brand-logo-img {
        height: calc(68px * 0.95) !important;
        width: auto !important;
    }

    .app-header.codec-desktop-only .brand-text {
        font-size: calc(2.15rem * 0.95);
    }

    .app-container {
        --codec-rail-pad-x: 30px;
    }

    .app-header.codec-desktop-only .header-main-row {
        padding: 16px 48px;
        gap: 24px;
        max-width: 1504px;
        width: calc(100% - 96px);
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box;
    }

    /* Hero : 1 colonne (768–1023 px) — 2 colonnes dès 1024 px */
    .hero-and-cards-wrapper.codec-desktop-only {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 24px;
        align-items: start;
        max-width: 1504px !important;
        width: calc(100% - 96px) !important;
        margin: 0 auto 32px auto !important;
        padding-left: var(--codec-rail-pad-x);
        padding-right: var(--codec-rail-pad-x);
        box-sizing: border-box;
        min-width: 0;
    }

    .hero-and-cards-wrapper .hero-content {
        padding-right: 20px;
        padding-left: 0;
        margin-left: 0;
        margin-top: 30px;
        order: unset !important;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .hero-and-cards-wrapper .hero-section {
        display: block !important;
        min-width: 0;
    }

    .hero-and-cards-wrapper .hero-title {
        font-size: clamp(3rem, 4.5vw, 4.8rem);
        font-weight: 850;
        line-height: 1.05;
        margin-bottom: 16px;
    }

    .hero-and-cards-wrapper .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 24px;
        line-height: 1.5;
    }

    .hero-and-cards-wrapper .features-bar {
        width: 100%;
        max-width: 100%;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
        align-items: center;
        box-sizing: border-box;
        padding: 12px 14px;
        gap: 8px 10px;
        margin-bottom: 28px;
    }

    .hero-and-cards-wrapper .feature-item {
        width: auto;
        min-width: 0;
        justify-content: flex-start;
        align-items: center;
        gap: 6px;
    }

    .hero-and-cards-wrapper .feature-text {
        font-size: 0.82rem;
        min-width: 0;
    }

    .dashboard-cards-container {
        display: flex;
        flex-direction: column;
        width: 100%;
        margin-top: 0;
        min-width: 0;
    }

    .promo-badge-cards {
        background: var(--yellow-badge);
        border: 1px solid rgba(15, 23, 42, 0.08);
        border-radius: 16px;
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
        padding: 10px 18px;
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
        width: fit-content;
        max-width: 100%;
        margin: 0 auto 16px auto;
        box-sizing: border-box;
        transition: var(--transition-bounce);
    }

    .promo-badge-cards:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    }

    .promo-badge-title {
        font-size: 1.04rem;
        font-weight: 850;
        color: #1E293B;
        letter-spacing: -0.01em;
        white-space: nowrap;
    }

    .hero-and-cards-wrapper .dashboard-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 24px !important;
        order: unset !important;
        align-items: start !important;
    }

    .hero-and-cards-wrapper .card-action,
    .hero-and-cards-wrapper .grid-card {
        height: auto !important;
        align-self: start !important;
    }

    .hero-and-cards-wrapper .card-action {
        border-radius: 32px;
    }

    .hero-and-cards-wrapper .card-content-bottom {
        padding: 24px 20px;
        flex-grow: 0 !important;
        flex-shrink: 0;
    }

    .hero-and-cards-wrapper .card-title {
        font-size: 1.7rem;
    }

    .hero-and-cards-wrapper .card-subtitle {
        font-size: 0.85rem;
    }

    .hero-and-cards-wrapper .card-image-top {
        aspect-ratio: 478 / 492;
        flex: 0 0 auto;
    }

    .hero-and-cards-wrapper .card-image-top img {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: contain;
        object-position: center bottom;
    }

    #btn-permis-moto-desktop .card-image-top img {
        object-position: 52% 100%;
    }

    /* Fernande */
    .fernande-section.codec-desktop-only {
        max-width: 1504px !important;
        width: calc(100% - 96px) !important;
        margin: 0 auto 32px auto !important;
        gap: 16px;
        padding: 20px 30px !important;
        display: flex !important;
    }

    .fernande-section.codec-desktop-only .fernande-section-header h2 {
        font-size: 2.05rem;
    }

    .fernande-section.codec-desktop-only .fernande-header-badge {
        font-size: 1.08rem;
        height: 45px;
        padding: 0 30px;
        box-sizing: border-box;
    }

    .fernande-section.codec-desktop-only .fernande-resources-grid {
        flex-direction: row;
        gap: 20px;
        width: 100%;
    }

    .fernande-section.codec-desktop-only .fernande-resource-card {
        flex: 1 1 0;
        padding: 22px 24px;
        border-radius: 24px;
        min-height: 132px;
    }

    .fernande-section.codec-desktop-only .resource-card-left {
        gap: 20px;
    }

    .fernande-section.codec-desktop-only .resource-title-prefix {
        font-size: 0.82rem;
    }

    .fernande-section.codec-desktop-only .resource-title-main {
        font-size: 1.4rem;
    }

    .fernande-section.codec-desktop-only .resource-desc {
        font-size: 0.88rem;
    }

    .fernande-section.codec-desktop-only .resource-avatar-container {
        width: 100px;
        height: 100px;
    }

    /* Séparateur */
    .section-separator.codec-desktop-only {
        max-width: 1504px !important;
        width: calc(100% - 96px) !important;
        margin: 0 auto 18px auto !important;
    }

    /* Ressources complémentaires */
    .secondary-resources-section.codec-desktop-only {
        display: flex !important;
        flex-direction: column;
        gap: 14px;
        max-width: 1504px !important;
        width: calc(100% - 96px) !important;
        margin: 20px auto 32px auto !important;
        padding: 0 30px !important;
        box-sizing: border-box;
    }

    .secondary-resources-section.codec-desktop-only .secondary-resources-header {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .secondary-resources-section.codec-desktop-only .secondary-resources-header h2 {
        font-size: 1.35rem;
        font-weight: 800;
        color: var(--text-bright);
        margin: 0;
        line-height: 1.2;
    }

    .secondary-resources-section.codec-desktop-only .secondary-resources-header i,
    .secondary-resources-section.codec-desktop-only .secondary-resources-header svg {
        width: 22px;
        height: 22px;
        color: var(--primary);
        flex-shrink: 0;
    }

    .secondary-resources-section.codec-desktop-only .secondary-row {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 20px !important;
        max-width: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box;
    }

    .secondary-resources-section.codec-desktop-only .card-secondary-new {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 22px 24px !important;
        min-height: 132px !important;
        border-radius: 24px !important;
        background: #FFFFFF !important;
        border: 1px solid rgba(203, 213, 225, 0.95) !important;
        box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 8px 16px -6px rgba(15, 23, 42, 0.04) !important;
        transition: var(--transition-bounce) !important;
    }

    .secondary-resources-section.codec-desktop-only .card-secondary-new:hover {
        transform: translateY(-4px) !important;
        box-shadow: 0 16px 32px -8px rgba(15, 23, 42, 0.12) !important;
        border-color: #94A3B8 !important;
    }

    .secondary-resources-section.codec-desktop-only .card-sec-left {
        flex-direction: row !important;
        text-align: left !important;
        align-items: center !important;
        gap: 20px !important;
    }

    .secondary-resources-section.codec-desktop-only .sec-card-text {
        align-items: flex-start !important;
        gap: 4px !important;
    }

    .secondary-resources-section.codec-desktop-only .sec-card-img {
        height: 56px !important;
        width: auto !important;
    }

    .secondary-resources-section.codec-desktop-only .sec-card-label {
        font-size: 0.88rem !important;
        font-weight: 600 !important;
        color: var(--text-muted) !important;
    }

    .secondary-resources-section.codec-desktop-only .sec-card-title {
        font-size: 1.35rem !important;
        font-weight: 800 !important;
        color: var(--text-bright) !important;
        line-height: 1.2 !important;
    }

    .secondary-resources-section.codec-desktop-only .card-sec-arrow-green {
        display: flex !important;
        align-items: center;
        justify-content: center;
        color: #FFFFFF;
        width: 44px;
        height: 44px;
        background: var(--primary);
        border-radius: 50%;
        flex-shrink: 0;
        box-shadow: 0 4px 10px rgba(15, 23, 42, 0.1);
        transition: var(--transition-bounce);
    }

    .secondary-resources-section.codec-desktop-only .card-sec-arrow-green i,
    .secondary-resources-section.codec-desktop-only .card-sec-arrow-green svg {
        width: 22px;
        height: 22px;
    }

    .secondary-resources-section.codec-desktop-only .card-secondary-new:hover .card-sec-arrow-green {
        transform: scale(1.08);
        background: var(--primary-dark);
        color: #FFFFFF;
    }

    /* Avis — fond vert démarre au titre, pas au-dessus */
    .reviews-section.codec-desktop-only {
        display: flex !important;
        flex-direction: column;
        gap: 0;
        max-width: 1504px !important;
        width: calc(100% - 96px) !important;
        margin: 0 auto 32px auto !important;
        padding: 0 30px !important;
        background: transparent !important;
        border-radius: 0 !important;
        box-sizing: border-box;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .reviews-section.codec-desktop-only .reviews-header {
        padding: 24px 30px 16px 30px;
        background: #eef7f2 !important;
        border-radius: 30px 30px 0 0;
    }

    .reviews-section.codec-desktop-only .reviews-slider-container {
        background: #eef7f2 !important;
        border-radius: 0 0 30px 30px;
        padding: 0 30px 12px 30px;
        box-sizing: border-box;
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    .reviews-section.codec-desktop-only .btn-slider-arrow {
        z-index: 20 !important;
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14) !important;
    }

    .reviews-section.codec-desktop-only .btn-slider-arrow.btn-slider-left {
        left: 10px !important;
    }

    .reviews-section.codec-desktop-only .btn-slider-arrow.btn-slider-right {
        right: 10px !important;
    }

    .reviews-section.codec-desktop-only .reviews-header-left h2 {
        font-size: 1.8rem;
    }

    .reviews-section.codec-desktop-only .reviews-list {
        display: grid !important;
        grid-auto-flow: column !important;
        grid-auto-columns: calc((100% - 20px) / 2) !important;
        align-items: start !important;
        gap: 20px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-behavior: smooth;
        scroll-snap-type: x mandatory !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch;
        padding: 6px 0 12px 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .reviews-section.codec-desktop-only .reviews-list::-webkit-scrollbar {
        display: none !important;
    }

    .reviews-section.codec-desktop-only .review-card-new {
        flex: unset !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        padding: 20px !important;
        border-radius: 20px !important;
        scroll-snap-align: start !important;
        box-sizing: border-box;
    }

    .reviews-section.codec-desktop-only .review-card-top {
        min-width: 0;
    }

    .reviews-section.codec-desktop-only .review-top-content {
        flex: 1 1 auto;
        min-width: 0;
    }

    .reviews-section.codec-desktop-only .review-quote {
        font-size: 0.85rem !important;
    }

    .reviews-section.codec-desktop-only .review-username {
        font-size: 0.85rem !important;
    }

    .reviews-section.codec-desktop-only .review-success-tag {
        font-size: 0.8rem !important;
    }

    /* SEO + footer */
    .footer-seo-text.codec-desktop-only {
        max-width: 800px !important;
        width: calc(100% - 96px) !important;
        padding: 0 24px !important;
        margin: 0 auto !important;
        text-align: left;
    }

    .footer-seo-text.codec-desktop-only .footer-seo-title {
        font-size: 1.15rem;
        font-weight: 800;
        color: var(--text-bright);
        line-height: 1.35;
        margin: 0 0 14px 0;
    }

    .footer-seo-text.codec-desktop-only p {
        font-size: 0.95rem;
        color: var(--text-muted);
        line-height: 1.8;
    }

    .app-footer {
        margin: 24px auto 0 auto !important;
        padding: 28px 48px 16px 48px;
        border-top: 1px solid var(--border-color);
        max-width: 1600px;
        width: 100%;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .app-footer .footer-features-bar {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        border: none;
        border-top: none;
        border-bottom: none;
        padding: 0 0 20px 0;
        width: 100%;
        max-width: 100%;
        grid-template-columns: unset;
    }

    .app-footer .footer-feat-item {
        gap: 10px;
    }

    .app-footer .footer-feat-item span {
        font-size: 0.85rem;
        font-weight: 700;
    }

    .app-footer .footer-links {
        gap: 14px;
    }

    .app-footer .footer-links a {
        font-size: 0.72rem;
    }
}

/* --- 768–1023 px : ajustements visuels légers (même structure desktop) --- */
@media (min-width: 768px) and (max-width: 1023px) {

    .app-header.codec-desktop-only .brand-logo-img {
        height: calc(68px * 0.95 * 0.9) !important;
    }

    .app-header.codec-desktop-only .brand-text {
        font-size: calc(2.15rem * 0.95 * 0.9);
    }

    .hero-and-cards-wrapper .hero-title {
        font-size: clamp(2.2rem, 4vw, 3.4rem);
    }

    /* Cartes permis : hauteur auto, pas d'étirement vertical */
    .hero-and-cards-wrapper .dashboard-grid {
        align-items: start !important;
    }

    .hero-and-cards-wrapper .card-action,
    .hero-and-cards-wrapper .grid-card {
        height: auto !important;
        align-self: start !important;
    }

    .hero-and-cards-wrapper .card-content-bottom {
        flex-grow: 0 !important;
    }

    .hero-and-cards-wrapper .promo-badge-cards {
        width: fit-content !important;
        max-width: 100% !important;
        padding: 10px 20px !important;
    }

    .hero-and-cards-wrapper .promo-badge-title {
        font-size: clamp(0.88rem, 2.1vw, 1.04rem) !important;
        white-space: nowrap !important;
    }

    .hero-and-cards-wrapper .features-bar {
        padding: 10px 12px !important;
        gap: 6px 8px !important;
    }

    .hero-and-cards-wrapper .feature-text {
        font-size: clamp(0.68rem, 1.8vw, 0.78rem) !important;
        line-height: 1.15 !important;
    }

    .hero-and-cards-wrapper .feature-icon-wrapper i {
        width: 14px !important;
        height: 14px !important;
    }

    .hero-and-cards-wrapper .feature-divider {
        height: 18px !important;
    }
}

/* --- ≥ 1024 px : hero 2 colonnes --- */
@media (min-width: 1024px) {

    .hero-and-cards-wrapper.codec-desktop-only {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) !important;
        gap: 48px;
        align-items: start;
        justify-items: stretch;
        margin: 0 auto -8px auto !important;
    }

    .hero-and-cards-wrapper .hero-section {
        grid-column: 1;
        width: 100%;
        min-width: 0;
        margin-left: 0;
        padding-left: 0;
    }

    .hero-and-cards-wrapper .trust-badge-hero,
    .hero-and-cards-wrapper .hero-title,
    .hero-and-cards-wrapper .hero-subtitle,
    .hero-and-cards-wrapper .features-bar {
        margin-left: 0;
        align-self: flex-start;
    }

    .hero-and-cards-wrapper .features-bar {
        padding: 8px 10px;
        gap: 4px 6px;
        margin-bottom: 24px;
    }

    .hero-and-cards-wrapper .feature-item {
        gap: 4px;
    }

    .hero-and-cards-wrapper .feature-icon-wrapper i {
        width: 13px;
        height: 13px;
    }

    .hero-and-cards-wrapper .feature-text {
        font-size: clamp(0.62rem, 0.95vw, 0.72rem);
        line-height: 1.15;
    }

    .hero-and-cards-wrapper .feature-divider {
        height: 16px;
    }

    .hero-and-cards-wrapper .dashboard-cards-container {
        margin-top: 0;
        width: 100%;
        max-width: 100%;
        align-self: start;
        margin-left: auto;
        margin-right: 0;
    }

    .hero-and-cards-wrapper .promo-badge-cards {
        width: fit-content !important;
        max-width: 100% !important;
        align-self: center;
        margin: 0 auto 14px auto;
    }

    .hero-and-cards-wrapper .promo-badge-title {
        font-size: clamp(0.78rem, 1.05vw, 0.98rem) !important;
        white-space: nowrap !important;
    }

    .hero-and-cards-wrapper .dashboard-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: calc(24px * 0.85) !important;
        width: 85%;
        max-width: 85%;
        margin: 0 0 0 auto;
    }

    .hero-and-cards-wrapper .card-content-bottom {
        padding: calc(24px * 0.85) calc(20px * 0.85);
        flex-grow: 0 !important;
    }

    .hero-and-cards-wrapper .card-title {
        font-size: calc(1.7rem * 0.85);
    }

    .hero-and-cards-wrapper .card-subtitle {
        font-size: calc(0.85rem * 0.85);
    }

    .hero-and-cards-wrapper .btn-arrow-circle {
        width: calc(44px * 0.85);
        height: calc(44px * 0.85);
    }

    .reviews-section.codec-desktop-only .reviews-list {
        grid-auto-columns: calc((100% - 40px) / 3) !important;
    }
}
