/**
 * CodeCodec — Page code moto (tablette & desktop)
 * Mobile : style.css (< 768 px)
 */

.btn-register {
    background: transparent;
    color: #EA580C !important;
    border-color: #EA580C;
    box-shadow: none;
}

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

.btn-register i {
    color: #EA580C !important;
}

.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:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #FFFFFF;
}

.btn-slider-arrow.btn-slider-left:hover,
.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;
}

@media (min-width: 768px) {

    html { scroll-behavior: smooth; }

    body {
        background-color: var(--bg-body);
        overflow-x: hidden;
    }

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

    .app-container {
        max-width: 100%;
        margin: 0;
        padding: 0 0 60px 0;
        display: block;
        gap: 0;
        --codec-moto-stack-width: 480px;
    }

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

    /* Header — comme accueil */
    .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%;
        order: unset !important;
    }

    .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-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;
    }

    .app-header.codec-desktop-only .btn-account {
        padding: 10px 16px;
        font-size: 0.88rem;
    }

    .app-header.codec-desktop-only .btn-register {
        padding: 10px 16px;
    }

    /* Avis — bandeau orange en haut */
    .reviews-section {
        display: flex;
        flex-direction: column;
        gap: 0;
        max-width: 1200px;
        width: calc(100% - 48px);
        margin: 0 auto 28px auto;
        padding: 0 24px;
        background: transparent;
        box-sizing: border-box;
        order: unset !important;
    }

    .reviews-section .reviews-header {
        padding: 22px 28px 14px 28px;
        background: var(--primary-light);
        border-radius: 24px 24px 0 0;
    }

    .reviews-section .reviews-slider-container {
        background: var(--primary-light);
        border-radius: 0 0 24px 24px;
        padding: 0 28px 14px 28px;
        box-sizing: border-box;
    }

    .reviews-section .reviews-slider-container .btn-slider-arrow {
        display: flex;
        z-index: 20;
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14);
    }

    .reviews-section .btn-slider-arrow.btn-slider-left {
        left: 8px;
    }

    .reviews-section .btn-slider-arrow.btn-slider-right {
        right: 8px;
    }

    .reviews-section .reviews-header-left h2 {
        font-size: 1.5rem;
    }

    .reviews-section .reviews-list {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: calc((100% - 20px) / 2);
        align-items: start;
        gap: 20px;
        overflow-x: auto;
        scroll-behavior: smooth;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        padding: 6px 0 10px 0;
    }

    .reviews-section .reviews-list::-webkit-scrollbar {
        display: none;
    }

    .reviews-section .review-card-new {
        flex: unset;
        width: 100%;
        min-width: 0;
        padding: 18px;
        border-radius: 18px;
        scroll-snap-align: start;
    }

    .reviews-section .review-quote {
        font-size: 0.82rem;
    }

    /* Colonne Fernande + tests + bannière */
    .moto-content-stack {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0;
        max-width: 1200px;
        width: calc(100% - 48px);
        margin: 0 auto 32px auto;
        padding: 0 24px;
        box-sizing: border-box;
        order: unset !important;
    }

    .moto-content-stack .tests-list,
    .moto-content-stack .banner-moto,
    .moto-content-stack .moto-evitement-sidebar,
    .moto-content-stack .codec-sidebar-videos {
        width: 100%;
        max-width: var(--codec-moto-stack-width);
        margin-left: 0;
        margin-right: 0;
        order: unset !important;
    }

    .moto-sidebar-sticky {
        display: contents;
    }

    /* Carte évitement */
    .moto-evitement-card {
        margin-bottom: 20px;
        padding: 16px;
        min-height: 96px;
        box-sizing: border-box;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-sm);
    }

    .moto-evitement-avatar-wrap {
        width: 64px;
        height: 64px;
    }

    .moto-evitement-title {
        font-size: 1.1rem;
    }

    .moto-evitement-desc {
        font-size: 0.78rem;
    }

    .moto-evitement-badge {
        font-size: 0.58rem;
        top: -8px;
        right: 12px;
    }

    .moto-evitement-play {
        width: 36px;
        height: 36px;
    }

    /* Hero */
    .hero-section {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 24px;
        align-items: center;
        max-width: 1200px;
        width: calc(100% - 48px);
        margin: 0 auto 32px auto;
        padding: 0 24px;
        box-sizing: border-box;
        order: unset !important;
    }

    .hero-content {
        order: unset !important;
        width: 100%;
    }

    .hero-title {
        font-size: clamp(2rem, 4vw, 3rem);
        margin-bottom: 16px;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 20px;
        max-width: 560px;
    }

    .promo-badge-splash {
        transform: rotate(-2deg);
        padding: 12px 20px;
    }

    .splash-line-1 {
        font-size: 0.95rem;
    }

    .splash-line-2 {
        font-size: 1.25rem;
    }

    .hero-image-container {
        display: flex;
        justify-content: center;
        align-items: center;
        order: unset !important;
        width: 100%;
        padding: 0 16px;
        box-sizing: border-box;
    }

    .hero-preview-card {
        position: relative;
        width: 100%;
        max-width: 520px;
        margin: 0 auto;
        background: #FFFFFF;
        border: 1px solid #E2E8F0;
        border-radius: 24px;
        padding: 18px 18px 22px;
        box-shadow:
            0 16px 40px rgba(15, 23, 42, 0.1),
            0 6px 18px rgba(15, 23, 42, 0.06);
        box-sizing: border-box;
    }

    .hero-preview-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin-bottom: 14px;
        color: #64748B;
        font-size: 0.68rem;
        font-weight: 800;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    .hero-preview-badge-icon {
        width: 14px;
        height: 14px;
        color: var(--primary-green);
        flex-shrink: 0;
    }

    .hero-moto-illustration {
        width: 100%;
        max-width: 100%;
        height: auto;
        display: block;
        border-radius: 16px;
        box-shadow: none;
    }

    /* Tests empilés — format carte d’origine */
    .tests-list {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        margin: 0 0 24px 0;
        padding: 0;
        box-sizing: border-box;
    }

    .tests-list .section-title {
        grid-column: 1 / -1;
        font-size: 1.35rem;
        margin-bottom: 4px;
    }

    .test-card {
        width: 100%;
        height: auto;
        display: flex;
        flex-direction: column;
    }

    .test-card-content {
        display: flex;
        flex-direction: column;
        padding: 14px;
        gap: 12px;
    }

    .test-title {
        font-size: 1rem;
    }

    .test-desc {
        font-size: 0.72rem;
    }

    .test-desc-keep {
        white-space: nowrap;
    }

    .btn-test-action {
        width: 100%;
        padding: 10px 16px;
        font-size: 0.8rem;
    }

    .tests-list {
        gap: 14px;
    }

    /* Bannière premium */
    .banner-moto {
        margin-bottom: 0;
        min-height: 0;
        box-sizing: border-box;
    }

    .banner-moto .banner-overlay-content {
        width: 100%;
        padding: 11px 16px;
    }

    .banner-moto .banner-overlay-content h2 {
        font-size: 0.86rem;
        line-height: 1.32;
        padding-right: 0;
    }

    .banner-moto .banner-character-img {
        display: none;
    }

    /* Footer */
    .app-footer {
        max-width: 1200px;
        width: calc(100% - 48px);
        margin: 0 auto;
        padding-left: 24px;
        padding-right: 24px;
        order: unset !important;
    }

    .footer-features-bar {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }

    .footer-feat-item {
        justify-content: center;
        padding-left: 0;
    }
}

@media (min-width: 1024px) {

    .hero-section {
        grid-template-columns: 1.08fr 0.92fr;
        gap: 40px 56px;
        align-items: center;
    }

    .hero-content {
        padding-right: 8px;
    }

    .hero-image-container {
        justify-content: flex-start;
        padding: 0 32px 0 0;
    }

    .hero-preview-card {
        max-width: 480px;
        margin-left: -18px;
        margin-right: auto;
    }

    .app-container {
        --codec-moto-stack-width: 500px;
        --codec-moto-aside-width: 480px;
        --codec-moto-aside-shift: -18px;
    }

    .moto-content-stack {
        display: grid;
        grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
        grid-template-rows: auto;
        gap: 20px 56px;
        align-items: start;
    }

    .moto-content-stack .tests-list {
        grid-column: 1;
        grid-row: 1;
        width: 100%;
        max-width: var(--codec-moto-stack-width);
    }

    .moto-sidebar-sticky {
        display: flex;
        flex-direction: column;
        gap: 16px;
        grid-column: 2;
        grid-row: 1;
        width: 100%;
        max-width: var(--codec-moto-aside-width);
        justify-self: start;
        margin-left: var(--codec-moto-aside-shift);
        margin-right: auto;
        position: sticky;
        top: 28px;
        align-self: start;
        z-index: 5;
    }

    .moto-sidebar-sticky .moto-evitement-sidebar {
        width: 100%;
        max-width: 100%;
        margin-bottom: 0;
    }

    .moto-sidebar-sticky .banner-moto {
        width: 100%;
        max-width: 100%;
        margin-bottom: 0;
    }

    .moto-sidebar-sticky .codec-sidebar-videos {
        width: 100%;
        max-width: 100%;
    }

    .tests-list {
        gap: 16px;
    }

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

/* 768–1023 px : en-tête comme accueil */
@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);
    }
}
