/* =====================================================================
   Espace intervenant
   Sobre et chaleureux : beaucoup d'air, grandes cibles tactiles,
   vidéos mises en avant. Même palette que l'administration
   (encre, sarcelle, ambre « projecteur ») avec une typographie plus ample.
   ===================================================================== */

:root {
    --ink: #1c2230;
    --ink-soft: #4a5265;
    --muted: #767e90;
    --line: #e3e6ec;
    --bg: #f4f5f8;
    --surface: #ffffff;
    --accent: #0e6b67;
    --accent-hover: #0a5753;
    --accent-soft: #e2f0ef;
    --amber: #e8a93a;
    --danger: #b42318;
    --danger-soft: #fdecea;
    --success: #157f3d;
    --success-soft: #e7f5ec;
    --info-soft: #e8eef9;

    --font: "Avenir Next", Avenir, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    --radius: 12px;
    --radius-l: 18px;
    --shadow: 0 1px 2px rgba(28, 34, 48, .05), 0 8px 28px rgba(28, 34, 48, .06);
    --focus: 0 0 0 3px rgba(14, 107, 103, .3);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; min-height: 100vh; display: flex; flex-direction: column;
    font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--ink); background: var(--bg);
}
h1, h2 { margin: 0; line-height: 1.2; letter-spacing: -0.015em; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

/* --- Boutons ------------------------------------------------------------ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-height: 46px; padding: .7rem 1.25rem; border-radius: var(--radius); border: 1px solid transparent;
    font: inherit; font-size: .97rem; font-weight: 600; line-height: 1.2; text-decoration: none; text-align: center;
    cursor: pointer; transition: background-color .15s, border-color .15s, color .15s, transform .1s;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); color: #fff; }
.btn--secondary { background: var(--surface); color: var(--ink); border-color: #cfd4dd; }
.btn--secondary:hover { border-color: var(--ink-soft); color: var(--ink); }
.btn--quiet { background: transparent; color: var(--ink-soft); min-height: 40px; padding: .5rem .9rem; font-weight: 500; }
.btn--quiet:hover { background: var(--bg); color: var(--ink); }
.btn--large { min-height: 54px; font-size: 1.02rem; padding: .85rem 1.5rem; }
.btn--block { width: 100%; }
.btn.is-busy { opacity: .75; pointer-events: none; }

/* --- Barre supérieure --------------------------------------------------- */
.bar { background: var(--surface); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.bar__inner { max-width: 1180px; margin: 0 auto; padding: .7rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.bar__event { display: flex; align-items: center; gap: .7rem; color: var(--ink); text-decoration: none; font-weight: 600; min-width: 0; }
.bar__logo { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; }
.bar__mark, .access-card__mark {
    position: relative; flex: none; width: 32px; height: 32px; border-radius: 9px; background: var(--ink);
}
.bar__mark::after, .access-card__mark::after {
    content: ""; position: absolute; left: 12px; top: 9px; width: 11px; height: 14px; background: var(--amber);
    clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.bar__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar__logout { margin: 0; flex: none; }

/* --- Messages ----------------------------------------------------------- */
.notice { padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: 1.25rem; font-size: .95rem; }
.notice--error { background: var(--danger-soft); color: var(--danger); }
.notice--success { background: var(--success-soft); color: var(--success); }
.notice--info { background: var(--info-soft); color: #2a4a7a; }

/* --- Page d'accès ------------------------------------------------------- */
.center-page {
    flex: 1; display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.25rem;
    background:
        radial-gradient(ellipse 70% 45% at 50% 0%, rgba(232, 169, 58, .13), transparent 70%),
        radial-gradient(ellipse 60% 40% at 50% 100%, rgba(14, 107, 103, .07), transparent 70%);
}
.access-card, .message-card {
    width: 100%; max-width: 440px; background: var(--surface); border-radius: var(--radius-l);
    padding: 2.5rem 2.25rem; box-shadow: var(--shadow); border: 1px solid var(--line);
}
.access-card__mark { width: 44px; height: 44px; border-radius: 12px; margin-bottom: 1.25rem; }
.access-card__mark::after { left: 17px; top: 13px; width: 14px; height: 18px; }
.access-card__site { font-size: .85rem; color: var(--muted); font-weight: 600; letter-spacing: .02em; margin-bottom: .35rem; }
.access-card h1 { font-size: 1.75rem; margin-bottom: .6rem; }
.access-card__intro { color: var(--ink-soft); margin-bottom: 1.5rem; }
.access-form { display: flex; flex-direction: column; gap: .6rem; }
.access-form label { font-size: .9rem; font-weight: 600; }
.access-form input {
    font: inherit; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 1.15rem; letter-spacing: .08em; text-transform: uppercase; text-align: center;
    padding: .85rem 1rem; min-height: 56px; border: 1.5px solid #cfd4dd; border-radius: var(--radius);
    background: var(--surface); color: var(--ink); width: 100%;
}
.access-form input::placeholder { color: #b3b9c6; letter-spacing: .04em; font-size: .95rem; }
.access-form input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.access-form .btn { margin-top: .5rem; }
.access-card__help { font-size: .84rem; color: var(--muted); margin: 1.1rem 0 0; text-align: center; }

.message-card { text-align: center; }
.message-card h1 { font-size: 1.5rem; margin-bottom: .75rem; }
.message-card p { color: var(--ink-soft); }
.message-card__icon {
    width: 48px; height: 48px; margin: 0 auto 1.25rem; border-radius: 50%;
    background: var(--bg); border: 2px solid var(--line); position: relative;
}
.message-card__icon::before {
    content: ""; position: absolute; left: 50%; top: 10px; width: 3px; height: 15px; margin-left: -1.5px;
    background: var(--ink-soft); border-radius: 2px; transform-origin: 50% 100%;
}
.message-card__icon::after {
    content: ""; position: absolute; left: 50%; top: 23px; width: 3px; height: 10px; margin-left: -1.5px;
    background: var(--ink-soft); border-radius: 2px; transform: rotate(-60deg); transform-origin: 50% 0;
}
.message-card__contact { font-weight: 600; color: var(--ink) !important; }

/* --- Espace vidéos ------------------------------------------------------ */
.cover { max-height: 300px; overflow: hidden; background: var(--ink); }
.cover img { width: 100%; height: 300px; object-fit: cover; }

.page { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 2.5rem 1.25rem 3rem; }

.welcome { margin-bottom: 2.5rem; max-width: 760px; }
.welcome__hello { font-size: .95rem; font-weight: 600; color: var(--accent); margin-bottom: .4rem; }
.welcome__event { font-size: 2.3rem; margin-bottom: .9rem; }
.welcome__text { font-size: 1.05rem; color: var(--ink-soft); margin-bottom: 1.4rem; }
.welcome__facts { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0; }
.welcome__facts div {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: .65rem 1rem; min-width: 180px;
}
.welcome__facts dt { font-size: .8rem; color: var(--muted); }
.welcome__facts dd { margin: 0; font-weight: 600; }

/* Galerie : 3 colonnes / 2 / 1 */
.gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.card {
    background: var(--surface); border-radius: var(--radius-l); overflow: hidden;
    border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.card__media { position: relative; display: block; aspect-ratio: 16 / 9; background: #e9ecf1; overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
a.card__media:hover img { transform: scale(1.03); }
.card__placeholder, .player-placeholder {
    position: absolute; inset: 0;
    background:
        radial-gradient(circle at 30% 20%, rgba(232, 169, 58, .28), transparent 55%),
        linear-gradient(160deg, #2a3246, #1c2230);
}
.card__play {
    position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px;
    border-radius: 50%; background: rgba(28, 34, 48, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    transition: background-color .2s, transform .2s;
}
.card__play::after {
    content: ""; position: absolute; left: 23px; top: 18px; width: 17px; height: 22px; background: #fff;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
}
a.card__media:hover .card__play { background: var(--accent); transform: scale(1.06); }
.card__duration {
    position: absolute; right: .6rem; bottom: .6rem; padding: .15rem .5rem; border-radius: 6px;
    background: rgba(0, 0, 0, .7); color: #fff; font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.card__body { padding: 1.15rem 1.25rem 1.3rem; display: flex; flex-direction: column; flex: 1; }
.card__title { font-size: 1.1rem; margin-bottom: .4rem; }
.card__meta { display: flex; flex-wrap: wrap; gap: .25rem .9rem; font-size: .85rem; color: var(--muted); margin-bottom: .6rem; }
.card__desc {
    font-size: .92rem; color: var(--ink-soft); margin-bottom: .9rem;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card__actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: .6rem; margin-top: auto; padding-top: .4rem; }
.card__actions .btn:only-child { grid-column: 1 / -1; }
.card__note { font-size: .82rem; color: var(--muted); margin: .7rem 0 0; }

.empty-state {
    text-align: center; padding: 3rem 1.5rem; background: var(--surface);
    border: 1px dashed #cfd4dd; border-radius: var(--radius-l);
}
.empty-state p:first-child { font-weight: 600; font-size: 1.05rem; }
.tip { margin-top: 2rem; font-size: .88rem; color: var(--muted); text-align: center; }

/* --- Lecteur ----------------------------------------------------------- */
.page--watch { max-width: 1040px; }
.back {
    display: inline-flex; align-items: center; gap: .4rem; margin-bottom: 1.1rem;
    color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: .95rem; min-height: 40px;
}
.back::before { content: "←"; }
.back:hover { color: var(--accent); }
.watch__title { font-size: 1.8rem; margin-bottom: 1.1rem; }
.player { background: #000; border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow); }
.player video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.player__note { font-size: .84rem; color: var(--muted); margin: .75rem .25rem 1.75rem; }
.watch__grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2rem; align-items: start; }
.watch__desc { font-size: 1rem; color: var(--ink-soft); }
.facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .9rem; }
.facts dt { font-size: .78rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.watch__download {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
    padding: 1.25rem; box-shadow: var(--shadow);
}
.watch__download p { margin: .7rem 0 0; text-align: center; word-break: break-all; }
.watch__nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }

/* --- Pied de page ------------------------------------------------------- */
.foot { text-align: center; padding: 1.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom)); font-size: .8rem; color: var(--muted); }
.foot p { margin: 0; }

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 980px) {
    .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
    .watch__grid { grid-template-columns: 1fr; gap: 1.25rem; }
    .watch__download { order: -1; }
}

@media (max-width: 640px) {
    .page { padding: 1.75rem 1rem 2.5rem; }
    .gallery { grid-template-columns: 1fr; }
    .welcome { margin-bottom: 1.75rem; }
    .welcome__event { font-size: 1.75rem; }
    .welcome__facts div { flex: 1 1 140px; min-width: 0; }
    .card__actions { grid-template-columns: 1fr; }
    .card__actions .btn { min-height: 50px; }
    .access-card, .message-card { padding: 2rem 1.4rem; }
    .cover, .cover img { height: 180px; }
    .watch__title { font-size: 1.4rem; }
    .player { border-radius: 0; margin: 0 -1rem; box-shadow: none; }
    .watch__nav { flex-direction: column-reverse; }
    .watch__nav .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
