/* ============================================================================
 * Styles du site « hors mat » : landing, auth, compte, nav commune.
 * S'appuie sur les tokens thème sombre de mtg.css. Les pages /play & /options
 * restent gérées par mtg.css.
 * ============================================================================ */

html:has(.site), body:has(.site) {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: #0f1419;
    color: #e8eef7;
    margin: 0;
}

.site {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: system-ui, "Segoe UI", Roboto, Ubuntu, sans-serif;
    background:
        radial-gradient(ellipse at top, rgba(201, 162, 39, 0.08), transparent 60%),
        radial-gradient(ellipse at bottom left, rgba(165, 99, 232, 0.08), transparent 60%),
        #0f1419;
}

/* ---------------- Nav --------------------------------------------------- */
.site__nav {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(15, 20, 25, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #2d3a4d;
}

.site__nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.site__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #e8eef7;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
}

.site__brand-logo {
    display: block;
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.site__nav-links, .site__nav-auth {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.site__nav-links {
    flex: 1;
    justify-content: center;
}

.site__nav-auth {
    margin-left: auto;
}

.site__nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    color: #8b9cb3;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.site__nav-link:hover, .site__nav-link:focus-visible {
    color: #e8eef7;
    background: rgba(201, 162, 39, 0.08);
}
.site__nav-link.is-active {
    color: #e8eef7;
    background: rgba(201, 162, 39, 0.12);
    border-color: rgba(201, 162, 39, 0.35);
}
.site__nav-link--cta {
    color: #0f1419;
    background: #c9a227;
    font-weight: 600;
}
.site__nav-link--cta:hover, .site__nav-link--cta:focus-visible {
    background: #d9b237;
    color: #0f1419;
}
.site__nav-link--account {
    border-color: #2d3a4d;
}
.site__nav-logout { display: inline; margin: 0; padding: 0; }
.site__nav-link--logout { color: #8b9cb3; }

/* ---------------- Flashes ----------------------------------------------- */
.site__flashes {
    max-width: 1200px;
    margin: 1rem auto 0;
    padding: 0 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.site__flash {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #2d3a4d;
    background: #1a2332;
    font-size: 0.95rem;
}
.site__flash--success { border-color: #2f7a4f; background: rgba(47, 122, 79, 0.18); }
.site__flash--error   { border-color: #a33131; background: rgba(163, 49, 49, 0.18); }
.site__flash--warning { border-color: #b48a2a; background: rgba(180, 138, 42, 0.18); }
.site__flash--info    { border-color: #3b6ba3; background: rgba(59, 107, 163, 0.18); }

/* ---------------- Main / footer ----------------------------------------- */
.site__main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
    box-sizing: border-box;
}

.site__footer {
    border-top: 1px solid #2d3a4d;
    background: #0b1117;
}
.site__footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #8b9cb3;
    font-size: 0.85rem;
    flex-wrap: wrap;
}
.site__footer-name { color: #e8eef7; font-weight: 600; }
.site__footer-sep { opacity: 0.5; }

/* ============================================================================
 * Landing
 * ============================================================================ */
.landing { display: flex; flex-direction: column; gap: 3rem; }

.landing__hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
    padding: 2rem 0 1rem;
}
@media (min-width: 900px) {
    .landing__hero { grid-template-columns: 1.2fr 1fr; gap: 3rem; }
}

.landing__eyebrow {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #c9a227;
    font-weight: 600;
}
.landing__title {
    margin: 0 0 1rem;
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    line-height: 1.1;
    color: #e8eef7;
    font-weight: 800;
    letter-spacing: -0.01em;
}
.landing__lead {
    margin: 0 0 1.75rem;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #b0bccd;
    max-width: 60ch;
}
.landing__cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Emplacement réservé à la vidéo de démo du playmat. Ratio 16:9, fond sobre. */
.landing__hero-media {
    position: relative;
    width: 100%;
}
.landing__video-slot {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
    background:
        radial-gradient(circle at 30% 30%, rgba(201, 162, 39, 0.12), transparent 55%),
        radial-gradient(circle at 70% 70%, rgba(165, 99, 232, 0.12), transparent 55%),
        linear-gradient(145deg, #121a24 0%, #1a2332 100%);
    border: 1px dashed #2d3a4d;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
}
.landing__video-slot::before {
    content: "";
    position: absolute; inset: 14px;
    border-radius: 10px;
    border: 1px solid rgba(139, 156, 179, 0.12);
    pointer-events: none;
}
.landing__video-placeholder {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.15rem;
    background: rgba(15, 26, 39, 0.75);
    border-radius: 999px;
    color: #8b9cb3;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    border: 1px solid rgba(139, 156, 179, 0.18);
}
.landing__video-placeholder i { color: #c9a227; }

/* Deux usecases côte-à-côte : streaming Spelltable/Convoke puis playtest. */
.landing__usecases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}
.landing__usecase {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 1.75rem;
    background: #1a2332;
    border: 1px solid #2d3a4d;
    border-radius: 16px;
    color: inherit;
}
.landing__usecase-icon {
    display: inline-flex;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    background: rgba(201, 162, 39, 0.12);
    color: #c9a227;
    font-size: 1.35rem;
}
.landing__usecase-icon--accent {
    background: rgba(165, 99, 232, 0.15);
    color: #cda8f0;
}
.landing__usecase-title { margin: 0; font-size: 1.25rem; color: #e8eef7; }
.landing__usecase-desc  { margin: 0; color: #b0bccd; line-height: 1.55; font-size: 0.97rem; }
.landing__usecase-points {
    list-style: none;
    padding: 0;
    margin: 0.35rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.landing__usecase-points li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: #cbd5e0;
    font-size: 0.93rem;
}
.landing__usecase-points i { color: #c9a227; font-size: 0.85rem; }

.landing__cta--inline { margin-top: 1.25rem; }

.landing__about-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.75rem 2.25rem;
    align-items: start;
    padding: 1rem 0;
}
@media (min-width: 1000px) {
    .landing__about-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
    }
}

.landing__about {
    max-width: 70ch;
    padding: 0;
    width: 100%;
}

/* Bloc Discord : styles dans assets/styles/landing.css (chargé par la landing uniquement). */

.landing__section-title {
    margin: 0 0 0.75rem;
    font-size: 1.6rem;
    color: #e8eef7;
}
.landing__paragraph { color: #b0bccd; line-height: 1.65; margin: 0 0 1rem; }
.landing__points {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.landing__points li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #cbd5e0;
}
.landing__points i { color: #c9a227; }

/* ============================================================================
 * Auth (login, register, password reset, account forms)
 * ============================================================================ */
.auth-card {
    max-width: 480px;
    margin: 2rem auto;
    padding: 2rem;
    background: #1a2332;
    border: 1px solid #2d3a4d;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}
.auth-card--info { text-align: center; }
.auth-card__header { margin-bottom: 1.25rem; }
.auth-card__title {
    margin: 0 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    color: #e8eef7;
}
.auth-card__lead { margin: 0; color: #8b9cb3; font-size: 0.95rem; }
.auth-card__text { color: #cbd5e0; line-height: 1.6; }
.auth-card__error {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid #a33131;
    background: rgba(163, 49, 49, 0.18);
    border-radius: 8px;
    color: #f3d3d3;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.auth-card__aside {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #2d3a4d;
    color: #8b9cb3;
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.auth-card__aside a { color: #c9a227; text-decoration: none; }
.auth-card__aside a:hover { text-decoration: underline; }
.auth-card__aside-sep { opacity: 0.5; }

.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-form__field { display: flex; flex-direction: column; gap: 0.35rem; }
.auth-form__label { color: #cbd5e0; font-size: 0.9rem; font-weight: 600; }
.auth-form__input,
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: #0f1a27;
    color: #e8eef7;
    border: 1px solid #2d3a4d;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-form__input:focus,
.auth-form input:focus {
    outline: none;
    border-color: #c9a227;
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.2);
}
.auth-form__hint { color: #8b9cb3; font-size: 0.8rem; }
.auth-form__checkbox { display: flex; align-items: center; gap: 0.5rem; color: #cbd5e0; font-size: 0.9rem; }
.auth-form__submit { align-self: stretch; margin-top: 0.5rem; }
.auth-form ul {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0;
    color: #f3d3d3;
    font-size: 0.85rem;
}
.auth-form ul li { padding: 0.15rem 0; }

/* ============================================================================
 * Account
 * ============================================================================ */
.account { display: flex; flex-direction: column; gap: 1.5rem; }

.account__header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #2d3a4d;
}
.account__title {
    margin: 0 0 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.75rem;
    color: #e8eef7;
}

.account__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    background: #121a27;
    padding: 0.35rem;
    border-radius: 999px;
    border: 1px solid #2d3a4d;
}
.account__tab {
    padding: 0.45rem 0.95rem;
    color: #8b9cb3;
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 999px;
    transition: color 0.15s, background 0.15s;
}
.account__tab:hover { color: #e8eef7; }
.account__tab.is-active { color: #0f1419; background: #c9a227; font-weight: 600; }
.account__tab--danger.is-active { background: #a33131; color: #fff; }

.account__banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid;
}
.account__banner--warning { background: rgba(180, 138, 42, 0.15); border-color: #b48a2a; }
.account__banner p { margin: 0.25rem 0 0; color: #cbd5e0; font-size: 0.9rem; }
.account__banner > :last-child { margin-left: auto; }

.account__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}
.account__panel {
    background: #1a2332;
    border: 1px solid #2d3a4d;
    border-radius: 14px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.account__panel--wide {
    grid-column: 1 / -1;
}
.account__panel--form { max-width: 520px; }
.account__panel--danger { border-color: rgba(163, 49, 49, 0.6); }
.account__panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.account__panel-header h2 {
    margin: 0;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #e8eef7;
}
.account__count {
    background: #0f1a27;
    color: #c9a227;
    padding: 0.1rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid #2d3a4d;
}
.account__panel-intro { margin: 0; color: #8b9cb3; font-size: 0.9rem; }
.account__panel-manage { margin: 0; }
.account__empty { margin: 0; color: #6d7a8c; font-style: italic; font-size: 0.9rem; }

.account__list { list-style: none; padding: 0; margin: 0.5rem 0 0; display: flex; flex-direction: column; gap: 0.4rem; }
.account__list-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: #121a27;
    border: 1px solid #23304a;
    border-radius: 8px;
}
.account__deck-card {
    background:
        linear-gradient(90deg, rgba(18, 26, 39, 0.08) 0%, rgba(18, 26, 39, 0.65) 17%, rgba(18, 26, 39, 1) 30%),
        var(--account-card-art) left center / 30% cover no-repeat,
        #121a27;
    min-height: 4.2rem;
}
.account__list-main { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; flex: 1; }
.account__list-name { color: #e8eef7; font-weight: 500; overflow: hidden; text-overflow: ellipsis;}
.account__list-name--button {
    width: fit-content;
    max-width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.account__list-name--button:hover,
.account__list-name--button:focus-visible {
    color: #c9a227;
    text-decoration: underline;
    outline: none;
}
.account__list-meta { color: #8b9cb3; font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis;}
.account__list-date { color: #8b9cb3; font-size: 0.8rem; }
.account__list-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: flex-end; }
.account__list-action { padding: 0.35rem 0.6rem; font-size: 0.85rem;}
.account__list-action:disabled { opacity: 0.6; cursor: progress; }
.account__deck-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; margin-top: 0.15rem; }
.account__deck-ci { display: inline-flex; align-items: center; gap: 0.12rem; color: #8b9cb3; font-size: 0.78rem; }
.account__deck-ci img { width: 1rem; height: 1rem; display: block; }
.account__deck-ci-empty { font-style: italic; }
.account__badge--button {
    font: inherit;
    cursor: pointer;
}
.account__badge--button:hover,
.account__badge--button:focus-visible {
    border-color: #c9a227;
    color: #e8eef7;
}
.account__deck-language {
    min-width: 2.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.12rem 0.28rem;
}
.account__deck-language .account__lang-flag {
    width: 1.35rem;
    height: auto;
    display: block;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.account__this-device {
    display: inline-flex;
    margin-left: 0.35rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    border: 1px solid #2f7a4f;
    background: rgba(47, 122, 79, 0.2);
    color: #9cdcb4;
    font-size: 0.72rem;
    font-weight: 600;
}
.account__this-device[hidden] { display: none; }
.account-dialog {
    border: none;
    padding: 0;
    background: transparent;
    color: #e8eef7;
    font-family: system-ui, "Segoe UI", Roboto, Ubuntu, sans-serif;
}
.account-dialog::backdrop {
    background: rgba(0, 0, 0, 0.55);
}
.account-dialog__panel {
    width: min(24rem, calc(100vw - 2rem));
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid #2d3a4d;
    background: #1a2332;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}
.account-dialog__message {
    margin: 0;
    color: #e8eef7;
    line-height: 1.45;
}
.account-dialog__input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #2d3a4d;
    border-radius: 8px;
    background: #0f1419;
    color: #e8eef7;
    font: inherit;
    padding: 0.55rem 0.65rem;
}
.account-dialog__input:focus {
    outline: none;
    border-color: #c9a227;
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.2);
}
.account-dialog__actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.45rem;
}
@media (max-width: 520px) {
    .account__list-action-label { display: none; }
    .account__list-item { align-items: flex-start; flex-direction: column; }
    .account__list-date, .account__list-actions { align-self: stretch; }
    .account__list-actions { justify-content: flex-start; }
}

.account__info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin: 0;
}
.account__info div { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; padding: 0.4rem 0; border-bottom: 1px dashed #23304a; }
.account__info div:last-child { border-bottom: none; }
.account__info dt { color: #8b9cb3; font-size: 0.9rem; margin: 0; }
.account__info dd { color: #e8eef7; margin: 0; font-size: 0.9rem; }

.account__badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid;
    border-color: #2d3a4d;
    background: rgba(15, 26, 39, 0.72);
    color: #cbd5e0;
}
.account__badge--ok { background: rgba(47, 122, 79, 0.2); border-color: #2f7a4f; color: #9cdcb4; }
.account__badge--warn { background: rgba(180, 138, 42, 0.2); border-color: #b48a2a; color: #f2d79a; }

/* ---------------- Button danger (used on delete form) ------------------- */
.mtg-btn--danger {
    background: #a33131;
    color: #fff;
    border-color: #a33131;
}
.mtg-btn--danger:hover, .mtg-btn--danger:focus-visible {
    background: #b63a3a;
    border-color: #b63a3a;
    color: #fff;
}

/* ---------------- Nav link — admin variant ------------------------------ */
.site__nav-link--admin {
    color: #c9a227;
    border-color: rgba(201, 162, 39, 0.4);
    background: rgba(201, 162, 39, 0.08);
}
.site__nav-link--admin:hover,
.site__nav-link--admin.is-active {
    color: #0f1419;
    background: #c9a227;
    border-color: #c9a227;
}

/* ---------------- Utility ---------------------------------------------- */
.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
