/* ============================================================
   PokéVault — Feuille de style principale
   ============================================================ */

/* --- Reset & base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:         #1a1a2e;
    --bg-card:    #16213e;
    --bg-hover:   #0f3460;
    --accent:     #e94560;
    --text:       #eaeaea;
    --text-muted: #888;
    --border:     #2a2a4a;
    --radius:     10px;
    --shadow:     0 4px 20px rgba(0,0,0,.4);

    /* Couleurs types */
    --col-fire:       #e8562a;
    --col-water:      #4592c4;
    --col-grass:      #5dbf62;
    --col-lightning:  #f8d030;
    --col-psychic:    #f85888;
    --col-fighting:   #c03028;
    --col-darkness:   #705898;
    --col-metal:      #b8b8d0;
    --col-dragon:     #7038f8;
    --col-fairy:      #ee99ac;
    --col-colorless:  #a8a878;
}

/* --- Thème clair ------------------------------------------ */
[data-theme="light"] {
    --bg:         #f0f2f5;
    --bg-card:    #ffffff;
    --bg-hover:   #e4e6eb;
    --accent:     #d63851;
    --text:       #1a1a2e;
    --text-muted: #65676b;
    --border:     #d1d5db;
    --shadow:     0 2px 12px rgba(0,0,0,.1);
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* --- Layout ------------------------------------------------ */
.container { max-width: 1400px; margin: 0 auto; padding: 0 1.5rem; }

/* --- Header ----------------------------------------------- */
.site-header {
    background: var(--bg-card);
    border-bottom: 2px solid var(--accent);
    padding: .75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}
.site-header .container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.logo {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}
.logo img { height: 36px; width: auto; }
.logo:hover { text-decoration: none; color: var(--accent); }

.main-nav { display: flex; gap: 1rem; }
.main-nav a { color: var(--text-muted); font-weight: 500; }
.main-nav a:hover { color: var(--text); text-decoration: none; }

/* --- Sélecteur de langue ---------------------------------- */
.lang-switcher {
    display: flex;
    gap: 4px;
    margin-left: auto;
}
.lang-btn {
    display: inline-block;
    padding: .3rem .6rem;
    border-radius: 4px;
    font-size: .8rem;
    font-weight: 700;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    transition: all .15s;
}
.lang-btn:hover {
    color: var(--text);
    border-color: var(--text);
    text-decoration: none;
}
.lang-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.lang-btn.active:hover { text-decoration: none; }

/* --- Theme toggle ----------------------------------------- */
.theme-toggle {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all .2s;
    padding: 0;
    flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-icon-light { display: none; }
[data-theme="light"] .theme-icon-dark { display: none; }
[data-theme="light"] .theme-icon-light { display: inline; }

.search-bar {
    display: flex;
    margin-left: .75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
}
.search-bar input {
    background: transparent;
    border: none;
    color: var(--text);
    padding: .4rem 1rem;
    min-width: 220px;
    font-size: .9rem;
    outline: none;
}
.search-bar button {
    background: var(--accent);
    border: none;
    color: #fff;
    padding: .4rem .9rem;
    cursor: pointer;
    font-size: .9rem;
}

/* --- Main -------------------------------------------------- */
main.container { padding-top: 2rem; padding-bottom: 3rem; }

/* --- Hero -------------------------------------------------- */
.hero {
    text-align: center;
    padding: 3rem 1rem;
    margin-bottom: 2rem;
}
.hero-logo {
    width: 320px;
    max-width: 80%;
    height: auto;
    margin: 0 auto 1rem;
}
.hero h1 {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: .5rem;
}
.hero p { color: var(--text-muted); font-size: 1.1rem; }

/* --- Grille des sets -------------------------------------- */
.series-list { display: flex; flex-direction: column; gap: 2.5rem; }

.serie-title {
    font-size: 1.3rem;
    color: var(--accent);
    border-bottom: 1px solid var(--border);
    padding-bottom: .5rem;
    margin-bottom: 1rem;
}

.sets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.set-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    transition: border-color .2s, transform .2s;
    color: var(--text);
}
.set-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    text-decoration: none;
    box-shadow: var(--shadow);
}
.set-card img { height: 60px; object-fit: contain; }
.set-name { font-size: .85rem; font-weight: 600; }
.set-name-sub { font-size: .7rem; color: var(--text-muted); font-weight: 400; }
.set-total { font-size: .75rem; color: var(--text-muted); }
.set-date  { font-size: .7rem; color: var(--text-muted); }

/* --- Set header ------------------------------------------- */
.set-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.set-logo { max-height: 80px; width: auto; }
.set-info h1 { font-size: 2rem; margin-bottom: .5rem; }
.set-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-muted);
    margin-top: .3rem;
    flex-wrap: wrap;
}
.set-meta-table {
    border-collapse: collapse;
    font-size: .9rem;
}
.set-meta-table th,
.set-meta-table td {
    padding: .25rem .75rem .25rem 0;
    text-align: left;
}
.set-meta-table th { color: var(--text-muted); font-weight: 500; padding-right: 1.5rem; }
.set-meta-table code {
    background: var(--bg-hover);
    padding: .15rem .5rem;
    border-radius: 4px;
    font-size: .85rem;
}

/* --- Filtres ---------------------------------------------- */
.filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
    font-size: .9rem;
    color: var(--text-muted);
}
.filter-tag {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: .25rem .75rem;
    font-size: .8rem;
    color: var(--text);
    transition: background .15s;
}
.filter-tag:hover, .filter-tag.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    text-decoration: none;
}

/* --- Grille cartes ---------------------------------------- */
.result-count { color: var(--text-muted); margin-bottom: 1rem; font-size: .9rem; }

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

/* Wrapper pour les actions rapides sur la grille */
.card-thumb-wrap {
    position: relative;
}
.card-thumb-wrap .card-thumb {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Bouton "Ajouter" dans le card-info */
.card-add-btn {
    display: inline-block;
    padding: .2rem .6rem;
    margin-top: .2rem;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
    font-size: .7rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    border-radius: 12px;
    position: relative;
    z-index: 2;
}
.card-add-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.card-add-btn:disabled {
    opacity: .6;
    cursor: wait;
}

/* Badge quantité (toujours visible, pas que au hover) */
.card-qty-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    z-index: 3;
    min-width: 24px;
    height: 24px;
    border-radius: 12px;
    background: #e94560;
    color: #ffffff !important;
    font-size: .8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,.4);
    border: 2px solid #fff;
    line-height: 1;
    text-decoration: none;
}

.card-thumb-wrap.in-collection:hover .card-thumb {
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(233, 69, 96, .3);
}

/* Stats collection sur la page set */
.set-collection-stats {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: .6rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: .85rem;
    flex-wrap: wrap;
}
.set-collection-stats .scs-item {
    display: flex;
    align-items: center;
    gap: .35rem;
    color: var(--text-muted);
}
.set-collection-stats .scs-value {
    font-weight: 700;
    color: var(--text);
    font-size: .95rem;
}
.set-collection-stats .scs-value.scs-accent {
    color: var(--accent);
}
.set-collection-stats .scs-bar {
    flex: 1;
    min-width: 80px;
    max-width: 200px;
    height: 6px;
    background: var(--bg-hover);
    border-radius: 3px;
    overflow: hidden;
}
.set-collection-stats .scs-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width .3s;
}
.set-collection-filter {
    margin-left: auto;
    display: flex;
    gap: .3rem;
}
.set-collection-filter .scf-btn {
    padding: .3rem .7rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg);
    color: var(--text-muted);
    font-size: .8rem;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
}
.set-collection-filter .scf-btn:hover,
.set-collection-filter .scf-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Masquer les cartes par filtre JS */
.card-thumb-wrap.hide-filtered {
    display: none;
}

.card-thumb {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s, border-color .15s;
    display: flex;
    flex-direction: column;
    color: var(--text);
}
.card-thumb:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow);
    border-color: var(--accent);
    text-decoration: none;
}
.card-thumb img {
    width: 100%;
    aspect-ratio: 2.5/3.5;
    object-fit: cover;
}
.card-no-img {
    aspect-ratio: 2.5/3.5;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    text-align: center;
    padding: .5rem;
    color: var(--text-muted);
}
.card-info {
    padding: .4rem .5rem;
    display: flex;
    flex-direction: column;
    gap: .15rem;
}
.card-number { font-size: .7rem; color: var(--text-muted); }
.card-name   { font-size: .8rem; font-weight: 600; }
.card-name-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .3rem;
}
.card-number-total {
    font-size: .65rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}
.card-set    { font-size: .7rem; color: var(--text-muted); }
.set-code-inline {
    background: var(--bg-hover);
    padding: .1rem .3rem;
    border-radius: 3px;
    font-size: .65rem;
    font-family: monospace;
}

/* --- Page carte ------------------------------------------- */
.card-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: .5rem;
}
.card-prev-next { display: flex; gap: 1rem; }

.card-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2.5rem;
    align-items: start;
}
@media (max-width: 768px) {
    .card-layout { grid-template-columns: 1fr; }
}

.card-large-img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-lang-tabs {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: .75rem;
}
.card-lang-tab {
    padding: .35rem .8rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
}
.card-lang-tab:hover {
    border-color: var(--text);
    color: var(--text);
}
.card-lang-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.card-no-img-large {
    aspect-ratio: 2.5/3.5;
    background: var(--bg-hover);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-muted);
}

.card-title {
    font-size: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: .75rem;
}
.card-number-inline {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
}
.card-hp {
    font-size: 1rem;
    background: var(--accent);
    color: #fff;
    padding: .2rem .6rem;
    border-radius: 20px;
}

.card-types { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }

.card-meta-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: .9rem;
}
.card-meta-table th,
.card-meta-table td {
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.card-meta-table th { color: var(--text-muted); width: 35%; font-weight: 500; }
.regulation-mark {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    padding: .15rem .5rem;
    border-radius: 4px;
    font-size: .85rem;
}
.jp-translation {
    color: var(--text-muted);
    font-weight: 400;
    font-size: .7em;
}
.cross-lang-link {
    display: inline-block;
    font-size: .85rem;
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    padding: .2rem .6rem;
    border: 1px solid var(--accent);
    border-radius: 4px;
    transition: background .2s, color .2s;
}
.cross-lang-link:hover {
    background: var(--accent);
    color: #fff;
}

.card-section { margin-bottom: 1.5rem; }
.card-section h2 {
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: .75rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: .3rem;
}
.card-section h3 { font-size: .9rem; color: var(--text-muted); margin-bottom: .5rem; }

.ability, .attack {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .75rem 1rem;
    margin-bottom: .5rem;
}
.ability-header, .attack-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .3rem;
    flex-wrap: wrap;
}
.ability-type {
    font-size: .7rem;
    background: var(--accent);
    color: #fff;
    padding: .1rem .4rem;
    border-radius: 4px;
    text-transform: uppercase;
}
.ability-name, .attack-name { font-weight: 700; }
.attack-damage {
    margin-left: auto;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
}
.attack-text, .ability p { font-size: .85rem; color: var(--text-muted); }

.attack-cost { display: flex; gap: 3px; }
.energy {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-block;
    background: var(--text-muted);
}
.energy-fire       { background: var(--col-fire); }
.energy-water      { background: var(--col-water); }
.energy-grass      { background: var(--col-grass); }
.energy-lightning  { background: var(--col-lightning); }
.energy-psychic    { background: var(--col-psychic); }
.energy-fighting   { background: var(--col-fighting); }
.energy-darkness   { background: var(--col-darkness); }
.energy-metal      { background: var(--col-metal); }
.energy-dragon     { background: var(--col-dragon); }
.energy-fairy      { background: var(--col-fairy); }
.energy-colorless  { background: var(--col-colorless); }

.wr-section {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.flavor-text {
    font-style: italic;
    color: var(--text-muted);
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
    margin-top: 1rem;
    font-size: .9rem;
}

/* --- Type badges ------------------------------------------ */
.type-badge {
    display: inline-block;
    padding: .2rem .7rem;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 600;
    color: #fff;
    background: var(--text-muted);
}
.type-fire       { background: var(--col-fire); }
.type-water      { background: var(--col-water); }
.type-grass      { background: var(--col-grass); }
.type-lightning  { background: var(--col-lightning); color: #333; }
.type-psychic    { background: var(--col-psychic); }
.type-fighting   { background: var(--col-fighting); }
.type-darkness   { background: var(--col-darkness); }
.type-metal      { background: var(--col-metal); color: #333; }
.type-dragon     { background: var(--col-dragon); }
.type-fairy      { background: var(--col-fairy); }
.type-colorless  { background: var(--col-colorless); color: #333; }

/* --- Formulaire recherche --------------------------------- */
.search-form { margin-bottom: 2rem; }
.search-fields {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    align-items: center;
}
.search-fields input,
.search-fields select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: .5rem 1rem;
    border-radius: var(--radius);
    font-size: .9rem;
    min-width: 180px;
    outline: none;
}
.search-fields input:focus,
.search-fields select:focus { border-color: var(--accent); }
.search-fields button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: .5rem 1.5rem;
    border-radius: var(--radius);
    font-size: .9rem;
    cursor: pointer;
    font-weight: 600;
}
.search-fields button:hover { opacity: .85; }
.btn-reset {
    color: var(--text-muted);
    font-size: .85rem;
}

/* --- Pagination ------------------------------------------- */
.pagination {
    display: flex;
    justify-content: center;
    gap: .4rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}
.pagination a {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: .4rem .8rem;
    border-radius: var(--radius);
    font-size: .9rem;
    transition: background .15s;
}
.pagination a:hover,
.pagination a.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    text-decoration: none;
}

/* --- Footer ----------------------------------------------- */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: .85rem;
    margin-top: 3rem;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }

/* --- Lightbox (zoom carte plein écran) -------------------- */
.card-image-col { cursor: zoom-in; }

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, .92);
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}
.lightbox.active { display: flex; }

.lightbox img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 0 60px rgba(0, 0, 0, .6);
    animation: lightbox-in .2s ease;
}

@keyframes lightbox-in {
    from { transform: scale(.85); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

/* --- User menu (header) ----------------------------------- */
.user-menu {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
}
.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}
.user-name {
    color: var(--text);
    font-weight: 600;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.btn-login, .btn-logout {
    padding: .3rem .8rem;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 600;
    transition: all .15s;
}
.btn-login {
    background: var(--accent);
    color: #fff;
}
.btn-login:hover { opacity: .85; text-decoration: none; }
.btn-logout {
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-logout:hover { color: var(--text); border-color: var(--text); text-decoration: none; }

/* --- Auth pages (login/register) -------------------------- */
.auth-page {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 2.5rem;
    width: 100%;
    max-width: 420px;
}
.auth-card h1 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}
.auth-errors {
    background: rgba(233, 69, 96, .15);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: .75rem 1rem;
    margin-bottom: 1rem;
    font-size: .85rem;
    color: var(--accent);
}
.auth-errors p { margin-bottom: .25rem; }
.auth-errors p:last-child { margin-bottom: 0; }

.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: .3rem;
}
.form-group input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: .6rem .9rem;
    border-radius: var(--radius);
    font-size: .9rem;
    outline: none;
}
.form-group input:focus { border-color: var(--accent); }
.form-check { display: flex; align-items: center; gap: .5rem; }
.form-check label { display: flex; align-items: center; gap: .4rem; cursor: pointer; }
.form-check input[type="checkbox"] { width: auto; margin: 0; cursor: pointer; }

.btn-primary {
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: .65rem;
    border-radius: var(--radius);
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: .5rem;
}
.btn-primary:hover { opacity: .85; }

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    width: 100%;
    padding: .6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-weight: 600;
    font-size: .9rem;
    transition: background .15s;
}
.btn-google:hover { background: var(--bg-hover); text-decoration: none; }

.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.2rem 0;
    color: var(--text-muted);
    font-size: .8rem;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}
.auth-divider span { padding: 0 .75rem; }

.auth-switch {
    text-align: center;
    margin-top: 1.2rem;
    font-size: .85rem;
    color: var(--text-muted);
}

/* --- Collection widget (card page) ------------------------ */
.collection-widget {
    margin-top: 1.5rem;
}
.cw-lang-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: .4rem;
    background: var(--bg);
    transition: border-color .15s;
}
.cw-lang-row.owned {
    border-color: var(--accent);
    background: rgba(233, 69, 96, .08);
}
.cw-lang-label {
    font-weight: 700;
    font-size: .85rem;
    min-width: 28px;
    color: var(--text-muted);
}
.cw-lang-row.owned .cw-lang-label { color: var(--accent); }

.cw-add-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: .3rem .9rem;
    border-radius: 20px;
    font-size: .8rem;
    cursor: pointer;
    transition: all .15s;
}
.cw-add-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.cw-controls {
    display: flex;
    align-items: center;
    gap: .4rem;
}
.cw-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    line-height: 1;
}
.cw-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.cw-btn-remove { font-size: 1.1rem; color: var(--text-muted); }
.cw-btn-remove:hover { background: #c0392b; border-color: #c0392b; color: #fff; }

.cw-qty-value {
    font-weight: 700;
    font-size: 1rem;
    min-width: 24px;
    text-align: center;
}

.cw-total-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .5rem;
    padding: .4rem .75rem;
    font-size: .9rem;
    color: var(--text-muted);
}
.cw-total { color: var(--accent); font-size: 1.1rem; }

.cw-login-msg {
    font-size: .9rem;
    color: var(--text-muted);
    padding: .75rem 0;
}

/* --- Card prices ----------------------------------------- */
.card-prices { margin-top: 1.5rem; }

.price-source {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .75rem 1rem;
    margin-bottom: .5rem;
    background: var(--bg);
}
.price-source-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .5rem;
    font-size: .9rem;
}
.price-currency {
    font-size: .75rem;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: .1rem .5rem;
    border-radius: 4px;
}
.price-grid {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.price-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}
.price-label {
    font-size: .7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .03em;
}
.price-value {
    font-weight: 700;
    font-size: .95rem;
}
.price-item-main .price-value {
    color: var(--accent);
    font-size: 1.1rem;
}
.price-credit {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-top: .6rem;
    font-size: .75rem;
    color: var(--text-muted);
}
.price-credit a { color: var(--text-muted); text-decoration: underline; }
.price-credit a:hover { color: var(--accent); }
.tcgdex-logo {
    width: 18px;
    height: 18px;
    border-radius: 3px;
}

/* --- Collection page -------------------------------------- */
.collection-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.stat-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    text-align: center;
    min-width: 140px;
}
.stat-box strong {
    display: block;
    font-size: 1.5rem;
    color: var(--accent);
}
.stat-box span {
    font-size: .8rem;
    color: var(--text-muted);
}

.collection-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.collection-empty p:first-child {
    font-size: 1.2rem;
    margin-bottom: .5rem;
}

.card-collection-meta {
    display: flex;
    gap: .4rem;
    margin-top: .2rem;
}
.card-lang-badge {
    background: var(--bg-hover);
    color: var(--text);
    padding: .1rem .4rem;
    border-radius: 4px;
    font-size: .7rem;
    font-weight: 700;
}
.card-qty-inline {
    color: var(--accent);
    font-weight: 700;
    font-size: .75rem;
}
.card-price-badge {
    font-size: .7rem;
    font-weight: 600;
    color: #27ae60;
}
.stat-box-value strong {
    color: #27ae60;
}

/* Toggle vue collection */
.collection-view-toggle {
    display: flex;
    gap: .25rem;
    margin-bottom: 1rem;
}
.view-btn {
    padding: .4rem 1rem;
    border-radius: 20px;
    font-size: .85rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    text-decoration: none;
    transition: all .15s;
}
.view-btn:hover { color: var(--text); border-color: var(--text-muted); }
.view-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.sort-separator {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 .25rem;
    align-self: center;
}
.sort-btn { font-size: .8rem; padding: .35rem .75rem; }

/* Collection par set */
.collection-set-block {
    margin-bottom: 2rem;
}
.collection-set-header {
    margin-bottom: .75rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
}
.collection-set-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
    color: var(--text);
    transition: color .15s;
}
.collection-set-link:hover { color: var(--accent); }
.collection-set-logo {
    max-height: 40px;
    max-width: 180px;
    object-fit: contain;
}
.collection-set-info strong {
    font-size: 1.1rem;
    display: block;
}
.collection-set-count {
    font-size: .8rem;
    color: var(--text-muted);
}

/* --- Admin nav link --------------------------------------- */
.nav-admin {
    color: #f39c12 !important;
    font-weight: 700;
}

/* --- Admin pages ------------------------------------------ */
.admin-page { max-width: 1200px; }
.admin-page h1 { font-size: 1.8rem; margin-bottom: 1.5rem; }

.admin-breadcrumb {
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.admin-breadcrumb a { color: var(--text-muted); }
.admin-breadcrumb a:hover { color: var(--accent); }

.admin-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.admin-stats .stat-box { flex: 1; min-width: 120px; }

.admin-sections {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.admin-section-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: border-color .2s, transform .2s;
    color: var(--text);
}
.admin-section-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    text-decoration: none;
    box-shadow: var(--shadow);
}
.admin-section-card h2 {
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: .5rem;
}
.admin-section-card p { font-size: .9rem; color: var(--text-muted); }

.admin-meta { font-size: .75rem; color: var(--text-muted); display: block; }

/* Admin messages */
.admin-message {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: .9rem;
}
.admin-message-success {
    background: rgba(39, 174, 96, .15);
    border: 1px solid #27ae60;
    color: #27ae60;
}
.admin-message-error {
    background: rgba(233, 69, 96, .15);
    border: 1px solid var(--accent);
    color: var(--accent);
}

/* Admin filters */
.admin-filters {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1.5rem;
}
.admin-filters input,
.admin-filters select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: .5rem 1rem;
    border-radius: var(--radius);
    font-size: .85rem;
    outline: none;
}
.admin-filters input:focus,
.admin-filters select:focus { border-color: var(--accent); }
.admin-filters button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: .5rem 1.2rem;
    border-radius: var(--radius);
    font-size: .85rem;
    cursor: pointer;
    font-weight: 600;
}

/* Admin table */
.admin-table-wrap { overflow-x: auto; margin-bottom: 1.5rem; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}
.admin-table th,
.admin-table td {
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}
.admin-table th {
    background: var(--bg-card);
    color: var(--text-muted);
    font-weight: 600;
    position: sticky;
    top: 0;
}
.admin-table tbody tr:hover { background: var(--bg-hover); }
.admin-table a { font-weight: 600; }

.price-suspect { color: #e74c3c; font-weight: 700; }

/* Admin badges */
.admin-badge {
    display: inline-block;
    padding: .15rem .5rem;
    border-radius: 4px;
    font-size: .75rem;
    font-weight: 600;
}
.admin-badge-cardmarket { background: rgba(52, 152, 219, .2); color: #3498db; }
.admin-badge-tcgplayer { background: rgba(155, 89, 182, .2); color: #9b59b6; }
.admin-badge-local { background: rgba(149, 165, 166, .2); color: #95a5a6; }
.admin-badge-google { background: rgba(231, 76, 60, .2); color: #e74c3c; }
.admin-badge-you { background: rgba(241, 196, 15, .2); color: #f1c40f; }

/* Admin buttons */
.admin-btn {
    padding: .3rem .7rem;
    border-radius: 4px;
    font-size: .75rem;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    transition: all .15s;
}
.admin-btn:hover { border-color: var(--text-muted); }
.admin-btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.admin-btn-primary:hover { opacity: .85; }
.admin-btn-edit { border-color: #3498db; color: #3498db; }
.admin-btn-edit:hover { background: #3498db; color: #fff; }
.admin-btn-danger { border-color: #e74c3c; color: #e74c3c; }
.admin-btn-danger:hover { background: #e74c3c; color: #fff; }
.admin-btn-refresh { border-color: #27ae60; color: #27ae60; }
.admin-btn-refresh:hover { background: #27ae60; color: #fff; }
.admin-btn-success { border-color: #27ae60; background: #27ae60; color: #fff; }

.admin-actions { white-space: nowrap; }
.admin-actions form { display: inline; }

/* Admin role select */
.admin-role-select {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: .2rem .4rem;
    border-radius: 4px;
    font-size: .8rem;
    cursor: pointer;
}
.admin-role-select.role-admin {
    border-color: #f39c12;
    color: #f39c12;
}

/* Admin user avatar in table */
.admin-user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: .3rem;
    display: inline-block;
}

/* Admin modal */
.admin-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, .7);
    display: flex;
    justify-content: center;
    align-items: center;
}
.admin-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}
.admin-modal-content h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--accent);
}
.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}
.admin-modal-actions {
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* --- Profile page ----------------------------------------- */
.profile-page { max-width: 600px; }
.profile-page h1 { font-size: 1.8rem; margin-bottom: 1.5rem; }

.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}
.profile-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
}
.profile-info h2 { font-size: 1.3rem; margin-bottom: .2rem; }
.profile-meta { font-size: .85rem; color: var(--text-muted); }

.profile-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.profile-section h2 {
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
}
.profile-form .form-group { margin-bottom: .75rem; }

.user-name:hover { text-decoration: none; color: var(--accent); }

/* --- JP badge --------------------------------------------- */
.jp-badge {
    display: inline-block;
    background: #e74c3c;
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    padding: .1rem .35rem;
    border-radius: 3px;
    vertical-align: middle;
    letter-spacing: .03em;
}

/* --- Responsive ------------------------------------------- */
@media (max-width: 600px) {
    .cards-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    .sets-grid  { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .hero h1 { font-size: 1.7rem; }
    .search-bar { display: none; } /* remplacé par nav search */
}
