:root {
    --ctv-bg: #0a0a0c;
    --ctv-surface: #141419;
    --ctv-surface-2: #1c1c24;
    --ctv-border: #2a2a35;
    --ctv-accent: #e50914;
    --ctv-accent-soft: rgba(229, 9, 20, 0.15);
    --ctv-text: #f5f5f7;
    --ctv-muted: #9a9aa5;
    /* Hauteur navbar sticky + marge pour les ancres (#en-vente, #replays, …) */
    --ctv-navbar-offset: 5rem;
}

html {
    scroll-padding-top: var(--ctv-navbar-offset);
}

body {
    background-color: var(--ctv-bg);
    color: var(--ctv-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
}

a {
    text-decoration: none;
}

/* Navbar */
.ctv-navbar {
    background: rgba(10, 10, 12, 0.85);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--ctv-border);
}

.ctv-brand {
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ctv-text);
}

.ctv-brand span {
    color: var(--ctv-accent);
}

/* Hero */
.ctv-hero {
    position: relative;
    width: 100%;
    min-height: 78vh;
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.ctv-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 10, 12, 0.15) 0%, rgba(10, 10, 12, 0.7) 60%, var(--ctv-bg) 100%);
}

.ctv-hero__content {
    position: relative;
    z-index: 2;
    padding: 3rem;
    max-width: 720px;
}

.ctv-hero__title {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

/* Accueil : live — même hero pleine largeur, lecteur centré à droite */
.ctv-hero--live {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 46%);
    align-items: stretch;
}

.ctv-hero--live .ctv-hero__content {
    align-self: end;
}

.ctv-hero__player {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    padding: 3rem 3rem 3rem 1.5rem;
}

.ctv-hero--live .ctv-live-player {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

.ctv-live-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.ctv-live-player iframe,
.ctv-live-player video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #000;
}

.ctv-live-player__empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
    color: rgba(242, 239, 230, 0.8);
}

@media (max-width: 991.98px) {
    .ctv-hero--live {
        grid-template-columns: 1fr;
    }

    .ctv-hero__player {
        padding: 0 1.5rem 2.5rem;
        align-items: stretch;
    }
}

/* Cartes captation */
.ctv-card {
    background: var(--ctv-surface);
    border: 1px solid var(--ctv-border);
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
    height: 100%;
}

.ctv-card:hover {
    transform: translateY(-4px);
    border-color: var(--ctv-accent);
}

.ctv-card__thumb {
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    background-color: var(--ctv-surface-2);
    position: relative;
}

.ctv-card__badges {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    max-width: calc(100% - 1rem);
}

.ctv-badge-new {
    background: var(--ctv-accent);
    color: #fff;
}

/* Bouton play sur les vignettes lisibles */
.ctv-card__play {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    background: rgba(10, 10, 12, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(6px);
    transition: background 0.2s ease, transform 0.2s ease;
}

.ctv-card__play svg {
    margin-left: 3px; /* recentre visuellement le triangle */
}

.ctv-card:hover .ctv-card__play {
    background: var(--ctv-accent);
    border-color: var(--ctv-accent);
    transform: scale(1.08);
}

.ctv-card__body {
    padding: 0.85rem 1rem 1.1rem;
}

/* Faux lecteur : vidéo verrouillée tant que l'achat n'est pas fait */
.ctv-player-locked {
    aspect-ratio: 16 / 9;
    max-height: 70vh;
    background-size: cover;
    background-position: center;
    background-color: var(--ctv-surface-2);
    border: 1px solid var(--ctv-border);
    border-radius: 14px;
    overflow: hidden;
    position: relative;
}

.ctv-player-locked__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
    background: rgba(10, 10, 12, 0.72);
    backdrop-filter: blur(8px);
}

.ctv-player-locked__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 1rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.ctv-purchased {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #3dd68c;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
}

.ctv-purchased__icon {
    flex-shrink: 0;
}

.ctv-card__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ctv-text);
    margin: 0;
}

.ctv-card__meta {
    color: var(--ctv-muted);
    font-size: 0.82rem;
}

/* Sections */
.ctv-section-title {
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.ctv-live-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--ctv-accent);
    animation: ctv-pulse 1.4s infinite;
    margin-right: 0.35rem;
}

@keyframes ctv-pulse {
    0% { box-shadow: 0 0 0 0 var(--ctv-accent-soft); }
    70% { box-shadow: 0 0 0 10px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

/* Surfaces génériques */
.ctv-surface {
    background: var(--ctv-surface);
    border: 1px solid var(--ctv-border);
    border-radius: 14px;
}

.form-control, .form-select {
    background-color: var(--ctv-surface-2);
    border-color: var(--ctv-border);
    color: var(--ctv-text);
}

.form-control:focus, .form-select:focus {
    background-color: var(--ctv-surface-2);
    color: var(--ctv-text);
    border-color: var(--ctv-accent);
    box-shadow: 0 0 0 0.2rem var(--ctv-accent-soft);
}

.btn-accent {
    background-color: var(--ctv-accent);
    border-color: var(--ctv-accent);
    color: #fff;
    font-weight: 600;
}

.btn-accent:hover {
    background-color: #c40812;
    border-color: #c40812;
    color: #fff;
}

.ctv-chip {
    border: 1px solid var(--ctv-border);
    background: var(--ctv-surface-2);
    color: var(--ctv-muted);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
    appearance: none;
    -webkit-appearance: none;
}

.ctv-chip:hover,
.ctv-chip.active {
    border-color: var(--ctv-accent);
    color: var(--ctv-text);
    background: var(--ctv-accent-soft);
}

/* Page /live : compte à rebours */
.ctv-countdown {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.ctv-countdown__cell {
    background: var(--ctv-surface);
    border: 1px solid var(--ctv-border);
    border-radius: 14px;
    min-width: 6.5rem;
    padding: 1.1rem 0.75rem 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ctv-countdown__num {
    font-size: clamp(2rem, 6vw, 3.2rem);
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.ctv-countdown__label {
    margin-top: 0.45rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--ctv-muted);
}

/* Bandeau live (accueil) */
.ctv-live-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: linear-gradient(90deg, #7a0308, var(--ctv-accent), #7a0308);
    color: #fff;
    padding: 0.6rem 1rem;
    font-weight: 600;
    text-decoration: none;
}

.ctv-live-banner:hover {
    color: #fff;
    filter: brightness(1.1);
}

.ctv-live-banner--next {
    background: linear-gradient(90deg, #1a1a24, #2a2a35, #1a1a24);
}

/* Pages CMS (légales, etc.) */
.ctv-legal h2 {
    font-size: 1.15rem;
    margin-top: 1.5rem;
    margin-bottom: 0.65rem;
}
.ctv-legal p,
.ctv-legal li {
    line-height: 1.65;
    color: var(--ctv-muted);
}
.ctv-legal strong {
    color: var(--ctv-text);
}
.ctv-legal a {
    color: var(--ctv-accent);
}
.ctv-legal ul {
    padding-left: 1.25rem;
}

/* Import dossier montage */
.ctv-upload__list {
    max-height: 16rem;
    overflow: auto;
    border: 1px solid var(--ctv-border);
    border-radius: 0.5rem;
    background: var(--ctv-surface-2);
}

.ctv-upload__item {
    display: grid;
    grid-template-columns: 1.5rem 1fr auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--ctv-border);
    font-size: 0.85rem;
}

.ctv-upload__item:last-child {
    border-bottom: 0;
}

.ctv-upload__mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    color: var(--ctv-muted);
}

.ctv-upload__check {
    width: 1.25rem;
    height: 1.25rem;
    display: block;
}

.ctv-upload__item.is-uploading .ctv-upload__mark {
    color: var(--ctv-text);
}

.ctv-upload__item.is-done .ctv-upload__mark {
    color: #3ddc84;
}

.ctv-upload__spinner {
    width: 0.85rem;
    height: 0.85rem;
    border: 2px solid var(--ctv-border);
    border-top-color: var(--ctv-text);
    border-radius: 50%;
    animation: ctv-upload-spin 0.7s linear infinite;
}

@keyframes ctv-upload-spin {
    to { transform: rotate(360deg); }
}

.ctv-upload__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ctv-upload__size {
    color: var(--ctv-muted);
    font-variant-numeric: tabular-nums;
}

.ctv-upload .progress {
    height: 1.1rem;
    background: var(--ctv-surface-2);
}

.ctv-upload .progress-bar {
    font-size: 0.75rem;
    font-weight: 700;
}
