@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root{
    --accent:#e46f2d;
    --accent2:#f07a2c;
    --danger:#c94b4b;
    --radius:18px;
}

html.theme-dark,
html[data-theme="dark"]{
    --bg:#080909;
    --surface:#151617;
    --surface2:#1d1e20;
    --text:#f5f1e8;
    --soft:#c5c0b7;
    --muted:#8d877e;
    --line:rgba(255,255,255,.13);
    --input:#101112;
    --shadow:0 24px 70px rgba(0,0,0,.38);
}

html.theme-light,
html[data-theme="light"]{
    --bg:#f7f5f1;
    --surface:#ffffff;
    --surface2:#f0ede8;
    --text:#151515;
    --soft:#46413d;
    --muted:#77706a;
    --line:rgba(20,20,20,.14);
    --input:#ffffff;
    --shadow:0 24px 70px rgba(20,20,20,.09);
}

*{box-sizing:border-box}

body{
    margin:0;
    font-family:Inter,system-ui,sans-serif;
    background:
        radial-gradient(circle at 50% 0,rgba(228,111,45,.12),transparent 36rem),
        var(--bg);
    color:var(--text);
    line-height:1.6;
    transition:background-color .2s ease,color .2s ease;
}

body::before{
    content:"";
    position:fixed;
    inset:0;
    pointer-events:none;
    background-image:
        linear-gradient(rgba(255,255,255,.03) 1px,transparent 1px),
        linear-gradient(90deg,rgba(255,255,255,.03) 1px,transparent 1px);
    background-size:58px 58px;
    mask-image:linear-gradient(to bottom,rgba(0,0,0,.42),transparent 60%);
}

html.theme-light body::before,
html[data-theme="light"] body::before{
    background-image:
        linear-gradient(rgba(0,0,0,.025) 1px,transparent 1px),
        linear-gradient(90deg,rgba(0,0,0,.025) 1px,transparent 1px);
}

a{color:inherit}

.shell{
    position:relative;
    width:min(1080px,calc(100% - 30px));
    margin:0 auto;
    padding:28px 0 48px;
}

.top{
    display:flex;
    justify-content:space-between;
    gap:18px;
    align-items:center;
    margin-bottom:28px;
}

.brand{
    font-weight:900;
    font-size:1.45rem;
    text-decoration:none;
    letter-spacing:-.05em;
}

nav{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    align-items:center;
}

nav a,
.theme-toggle{
    color:var(--soft);
    text-decoration:none;
    font-weight:700;
    border:1px solid var(--line);
    border-radius:999px;
    padding:8px 12px;
    background:var(--surface);
    cursor:pointer;
    min-height:38px;
}

nav a:hover,
.theme-toggle:hover{
    border-color:var(--accent);
    color:var(--text);
}

.client-main-nav{gap:6px}
.client-main-nav>a,
.client-main-nav>.theme-toggle,
.client-nav-menu>summary{
    min-height:38px;
    display:flex;
    align-items:center;
    border:1px solid var(--line);
    border-radius:6px;
    padding:8px 10px;
    background:var(--surface);
    color:var(--soft);
    font-size:.82rem;
    font-weight:700;
    text-decoration:none;
    cursor:pointer;
    white-space:nowrap;
}
.client-nav-menu{position:relative}
.client-nav-menu>summary{list-style:none}
.client-nav-menu>summary::-webkit-details-marker{display:none}
.client-nav-menu>summary::after{content:"▾";margin-left:7px;color:var(--muted)}
.client-nav-menu[open]>summary{border-color:var(--accent);color:var(--text)}
.client-nav-menu>div{
    position:absolute;
    z-index:30;
    top:calc(100% + 6px);
    left:0;
    min-width:210px;
    display:grid;
    gap:2px;
    padding:6px;
    border:1px solid var(--line);
    border-radius:6px;
    background:var(--surface);
    box-shadow:var(--shadow);
}
.client-nav-menu>div a{padding:9px 10px;border-radius:4px;text-decoration:none;color:var(--soft);font-weight:700;font-size:.84rem}
.client-nav-menu>div a:hover{background:var(--surface2);color:var(--text)}
@media(max-width:820px){
    .top{align-items:flex-start;flex-direction:column}
    .client-main-nav{width:100%}
    .client-nav-menu>div{position:fixed;left:15px;right:15px;top:auto;min-width:0}
}

.panel{
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:var(--radius);
    padding:clamp(20px,3vw,30px);
    margin-bottom:18px;
    box-shadow:var(--shadow);
}

.panel2{background:var(--surface2)}

h1{
    font-size:clamp(2rem,5vw,3.6rem);
    line-height:1.04;
    letter-spacing:-.055em;
    margin:0 0 12px;
}

h2{
    font-size:clamp(1.35rem,3vw,2rem);
    letter-spacing:-.04em;
    margin:0 0 10px;
}

h3{margin:0 0 8px}

p{color:var(--soft)}

.small{
    color:var(--muted);
    font-size:.92rem;
}

.grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:16px;
}

.grid3{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:16px;
}

label{
    display:block;
    font-weight:800;
    margin:14px 0 7px;
}

input,
textarea,
select{
    width:100%;
    min-height:48px;
    border:1px solid var(--line);
    border-radius:12px;
    background:var(--input);
    color:var(--text);
    padding:12px 14px;
    outline:none;
}

textarea{
    min-height:130px;
    resize:vertical;
}

input:focus,
textarea:focus,
select:focus{
    border-color:var(--accent);
}

button,
.button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:44px;
    border-radius:12px;
    border:1px solid transparent;
    background:linear-gradient(135deg,var(--accent),var(--accent2));
    color:#fff;
    text-decoration:none;
    font-weight:800;
    cursor:pointer;
    padding:0 16px;
}

.button.secondary,
button.secondary{
    background:transparent;
    border-color:var(--line);
    color:var(--text);
}

.button.danger,
button.danger{
    background:transparent;
    border-color:rgba(201,75,75,.55);
    color:#ffb4b4;
}

.actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    align-items:center;
    margin-top:16px;
}

.msg{
    padding:14px 16px;
    border-radius:14px;
    margin-bottom:18px;
    background:rgba(46,125,50,.14);
    border:1px solid rgba(76,175,80,.45);
}

.err{
    padding:14px 16px;
    border-radius:14px;
    margin-bottom:18px;
    background:rgba(201,75,75,.14);
    border:1px solid rgba(201,75,75,.5);
}

.card{
    background:var(--surface2);
    border:1px solid var(--line);
    border-radius:var(--radius);
    padding:20px;
}

.list{
    display:grid;
    gap:14px;
}

.badge{
    display:inline-flex;
    border:1px solid var(--line);
    border-radius:999px;
    padding:4px 10px;
    color:var(--soft);
    font-size:.85rem;
    font-weight:800;
}

.private{border-color:rgba(228,111,45,.45)}

.footer{
    color:var(--muted);
    border-top:1px solid var(--line);
    margin-top:38px;
    padding-top:22px;
    text-align:center;
}

/* Reimpressions photobooth */
.reprint-intro h1{max-width:760px}

.reprint-summary{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:24px;
}

.reprint-counter{
    flex:0 0 150px;
    min-height:126px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    border:1px solid var(--line);
    border-radius:8px;
    background:var(--surface2);
    text-align:center;
}

.reprint-counter strong{font-size:2.3rem;line-height:1}
.reprint-counter span{font-weight:800}
.reprint-counter small{color:var(--muted)}

.reprint-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:14px;
}

.reprint-photo{
    min-width:0;
    overflow:hidden;
    border:1px solid var(--line);
    border-radius:8px;
    background:var(--surface);
}

.reprint-photo.is-selected{border-color:var(--accent)}
.reprint-photo-image{display:block;aspect-ratio:3/2;background:#050505}
.reprint-photo-image img{width:100%;height:100%;display:block;object-fit:contain}

.reprint-photo-actions{
    display:grid;
    gap:8px;
    padding:12px;
}

.reprint-photo-actions button{width:100%}
.reprint-photo-actions button:disabled{cursor:default;opacity:.72}
.reprint-photo-status{min-height:22px;color:var(--muted);text-align:center}
.reprint-message{margin:0 0 18px}

.reprint-event-link{
    display:flex;
    justify-content:space-between;
    gap:16px;
    align-items:center;
    text-decoration:none;
}

.reprint-event-link:hover{border-color:var(--accent)}

/* Fichiers */
.file-list{
    display:grid;
    gap:8px;
    margin-top:10px;
}

.file-list a,
.file-link{
    color:var(--text);
    font-weight:800;
    text-decoration:none;
}

.file-list a:hover,
.file-link:hover{
    color:var(--accent);
    text-decoration:underline;
}

.file-row{
    display:flex;
    justify-content:space-between;
    gap:16px;
    align-items:flex-start;
    padding:12px 0;
    border-bottom:1px solid var(--line);
}

.file-row:last-child{border-bottom:0}

.inline-delete-form,
.icon-delete-form{
    margin:0;
    flex:0 0 auto;
}

/* Liens */
.link-add-form{margin-top:14px}

.link-list{
    display:grid;
    gap:10px;
    margin-top:16px;
}

.link-list.compact{margin-top:6px}

.link-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:14px;
    padding:10px 0;
    border-bottom:1px solid var(--line);
}

.link-row:last-child{border-bottom:0}

.link-row a{
    color:var(--text);
    font-weight:800;
    text-decoration:none;
    overflow-wrap:anywhere;
}

.link-row a:hover{
    color:var(--accent);
    text-decoration:underline;
}

/* Boutons suppression */
.trash-button{
    min-height:36px;
    width:38px;
    padding:0;
    border-radius:10px;
    background:transparent;
    border:1px solid rgba(201,75,75,.55);
    color:#ffb4b4;
    font-size:16px;
}

.trash-button:hover{background:rgba(201,75,75,.12)}

/* Zone dangereuse admin */
.danger-zone{
    margin-top:18px;
    padding:18px;
    border:1px solid rgba(201,75,75,.55);
    border-radius:var(--radius);
    background:rgba(201,75,75,.08);
}

/* Titres souhaités / titres bannis */
.inline-grid{
    display:grid;
    grid-template-columns:1fr auto;
    gap:10px;
    align-items:center;
}

.song-list,
.admin-song-list{
    display:flex;
    flex-direction:column;
    gap:8px;
    margin:8px 0 16px;
}

.song-row,
.admin-song-row{
    display:flex;
    align-items:center;
    gap:10px;
    width:100%;
    line-height:1.3;
}

.song-row{
    padding:10px 0;
    border-bottom:1px solid var(--line);
}

.song-row:last-child{border-bottom:0}

.song-row.banned span,
.admin-song-list.banned span{
    color:#ffb4b4;
}

.admin-song-row{
    flex-direction:row;
    padding-left:4px;
}

.admin-song-row span{
    display:block;
    flex:1;
    margin:0;
    line-height:1.3;
}

.admin-song-row br{display:none}

.ack-check,
.admin-song-row .ack-check{
    flex:0 0 22px;
    width:22px;
    height:22px;
    min-height:22px;
    padding:0;
    margin:0;
    border-radius:6px;
    border:1px solid var(--line);
    background:transparent;
    cursor:pointer;
}

.ack-check.is-checked{
    background:var(--accent);
    border-color:var(--accent);
    position:relative;
}

.ack-check.is-checked::after{
    content:"✓";
    color:#fff;
    font-weight:900;
    position:absolute;
    left:4px;
    top:-2px;
    font-size:18px;
}

/* Structure des fiches */
.member-content h4,
.profile-block h3,
.panel.private h3{
    color:var(--accent);
    margin:26px 0 10px;
}

.member-content h4:first-child{
    margin-top:0;
}

.panel > h2{
    color:var(--accent);
}

.member-content p,
.member-content .link-list,
.member-content .admin-song-list,
.profile-block p,
.profile-block .link-list,
.profile-block .file-list,
.profile-block .admin-song-list,
.card h3 + p,
.card .link-list,
.card .file-list,
.panel.private > p,
.panel.private > .link-list{
    margin-left:22px;
}

.profile-block .link-row,
.profile-block .admin-song-row,
.card .link-row,
.panel.private .link-row{
    padding-left:4px;
}

.card h3{
    margin-bottom:10px;
}

/* Liens en blanc dans les fiches, y compris admin_family.php */
.card .link-list a,
.card .file-list a,
.card .file-link,
.member-content .link-list a,
.member-content .file-list a,
.member-content .file-link,
.profile-block .link-list a,
.profile-block .file-list a,
.profile-block .file-link,
.panel.private .link-list a,
.panel.private .file-list a,
.panel.private .file-link{
    color:var(--text)!important;
}

.card .link-list a:hover,
.card .file-list a:hover,
.card .file-link:hover,
.member-content .link-list a:hover,
.member-content .file-list a:hover,
.member-content .file-link:hover,
.profile-block .link-list a:hover,
.profile-block .file-list a:hover,
.profile-block .file-link:hover,
.panel.private .link-list a:hover,
.panel.private .file-list a:hover,
.panel.private .file-link:hover{
    color:var(--accent)!important;
    text-decoration:underline;
}

/* Table admin */
.admin-table th{
    color:var(--muted);
}

/* Mode clair */
html.theme-light body,
html[data-theme="light"] body{
    background:
        radial-gradient(circle at 50% 0,rgba(228,111,45,.12),transparent 36rem),
        var(--bg);
    color:var(--text);
}

html.theme-light .brand,
html[data-theme="light"] .brand,
html.theme-light h1,
html.theme-light h2,
html.theme-light h3,
html.theme-light h4,
html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4{
    color:var(--text);
}

html.theme-light p,
html[data-theme="light"] p{
    color:var(--soft);
}

html.theme-light .small,
html[data-theme="light"] .small,
html.theme-light .admin-table th,
html[data-theme="light"] .admin-table th{
    color:var(--muted);
}

html.theme-light .admin-table td,
html.theme-light .admin-table th,
html[data-theme="light"] .admin-table td,
html[data-theme="light"] .admin-table th{
    border-bottom-color:var(--line);
}

@media(max-width:760px){
    .top{display:block}
    .top nav{margin-top:14px}
    .grid,.grid3{grid-template-columns:1fr}
    .file-row{display:block}
    .inline-delete-form{margin-top:10px}
    .inline-grid{grid-template-columns:1fr}
    .reprint-summary{display:block}
    .reprint-counter{width:100%;min-height:104px;margin-top:18px}
    .reprint-grid{grid-template-columns:repeat(2,minmax(0,1fr))}

    .member-content p,
    .member-content .link-list,
    .member-content .admin-song-list,
    .profile-block p,
    .profile-block .link-list,
    .profile-block .file-list,
    .profile-block .admin-song-list,
    .card h3 + p,
    .card .link-list,
    .card .file-list,
    .panel.private > p,
    .panel.private > .link-list{
        margin-left:14px;
    }
}

@media(max-width:480px){
    .reprint-grid{grid-template-columns:1fr}
}

.guest-stats-inline{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    margin-top:8px;
}

.guest-stat{
    min-width:90px;
    padding:10px 14px;
    border:1px solid var(--line);
    border-radius:14px;
    background:var(--surface2);
    text-align:center;
}

.guest-stat strong{
    display:block;
    font-size:1.35rem;
    line-height:1;
    color:var(--accent);
    margin-bottom:4px;
}

.guest-stat span{
    font-size:.82rem;
    color:var(--soft);
}

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

.review-editor-grid{
    display:grid;
    grid-template-columns:minmax(0,1.25fr) minmax(280px,.75fr);
    gap:18px;
    align-items:start;
}

.review-rating-fieldset{
    margin:0 0 18px;
    padding:0;
    border:0;
}

.review-rating-fieldset legend{
    margin-bottom:8px;
    font-weight:800;
}

.review-rating-input{
    display:grid;
    grid-template-columns:repeat(5,48px);
    gap:8px;
}

.review-rating-input label{
    width:48px;
    height:48px;
    margin:0;
    display:grid;
    place-items:center;
    border:1px solid var(--line);
    border-radius:8px;
    background:var(--surface2);
    color:var(--muted);
    cursor:pointer;
    font-size:1.5rem;
}

.review-rating-input label:has(input:checked){
    border-color:var(--accent);
    color:var(--accent);
}

.review-rating-input input{
    position:absolute;
    opacity:0;
    pointer-events:none;
}

.review-rating-input label:focus-within{
    outline:2px solid var(--accent);
    outline-offset:2px;
}

.review-name-toggle,
.review-admin-toggle{
    display:flex;
    align-items:center;
    gap:10px;
}

.review-name-toggle input,
.review-admin-toggle input{
    width:22px;
    min-height:22px;
    margin:0;
}

.review-preview{
    position:sticky;
    top:18px;
}

.review-preview-stars,
.review-admin-rating{
    display:block;
    margin:18px 0 8px;
    color:var(--accent);
    font-size:1.4rem;
    font-weight:800;
}

.review-preview blockquote{
    margin:14px 0 18px;
    color:var(--soft);
    white-space:pre-wrap;
}

.review-preview strong,
.review-preview .small{
    display:block;
}

.review-admin-event-head,
.review-admin-card-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:16px;
}

.review-admin-event-form{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto auto;
    gap:12px;
    align-items:end;
    margin:20px 0;
    padding:16px 0;
    border-top:1px solid var(--line);
    border-bottom:1px solid var(--line);
}

.review-admin-event-form label{margin-top:0}

.review-admin-list{
    display:grid;
    gap:0;
}

.review-admin-card{
    padding:18px 0;
    border-bottom:1px solid var(--line);
}

.review-admin-card:last-child{border-bottom:0}
.review-admin-card.is-hidden{opacity:.62}
.review-admin-card.is-pending{
    margin:0 -14px;
    padding:18px 14px;
    border-left:3px solid var(--accent);
    background:var(--surface2);
}
.review-admin-source{
    display:inline-flex;
    margin-left:7px;
    vertical-align:middle;
}
.review-admin-card .actions form{margin:0}
.review-admin-rating{margin:0;white-space:nowrap}

.review-response-form{
    display:grid;
    gap:16px;
}

.review-response-global-editor textarea,
.review-response-editor textarea{
    width:100%;
    resize:vertical;
}

.review-response-editor-list{
    display:grid;
    gap:0;
    margin-top:18px;
}

.review-response-editor{
    padding:20px 0;
    border-top:1px solid var(--line);
}

.review-response-editor.is-guest{
    padding-left:14px;
    border-left:3px solid var(--accent);
}

.review-response-editor-head strong,
.review-response-editor-head .small{
    display:block;
}

.review-response-editor-head .badge{
    display:inline-flex;
    margin-top:6px;
}

.review-response-editor blockquote{
    margin:12px 0 16px;
    color:var(--soft);
}

.review-response-editor label{
    margin-top:0;
}

.review-response-save{
    margin-top:18px;
}

.review-media-form textarea{
    min-height:160px;
    resize:vertical;
}

.review-media-mode{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin:22px 0 0;
    padding:0;
    border:0;
}

.review-media-mode legend{
    width:100%;
    margin-bottom:2px;
    font-weight:800;
}

.review-media-mode label{
    display:flex;
    align-items:center;
    gap:8px;
    min-height:42px;
    margin:0;
    padding:8px 12px;
    border:1px solid var(--line);
    border-radius:6px;
    background:var(--surface2);
    cursor:pointer;
}

.review-media-mode label:has(input:checked){
    border-color:var(--accent);
    color:var(--accent);
}

.review-media-mode input{
    width:18px;
    min-height:18px;
    margin:0;
}

.review-media-panel{
    margin-top:24px;
    padding-top:22px;
    border-top:1px solid var(--line);
}

.review-media-panel[hidden]{display:none}

.review-media-admin-grid{
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:10px;
    margin-top:18px;
}

.review-media-admin-photo{
    min-width:0;
    margin:0;
    overflow:hidden;
    border:1px solid var(--line);
    border-radius:6px;
    background:var(--surface2);
}

.review-media-admin-photo img{
    display:block;
    width:100%;
    aspect-ratio:1;
    object-fit:cover;
}

.review-media-remove{
    display:flex;
    align-items:center;
    gap:7px;
    margin:0;
    padding:8px;
    font-size:.85rem;
}

.review-media-admin-photo input[type="checkbox"]{
    width:18px;
    min-height:18px;
    margin:0;
}

.review-media-caption{
    display:block;
    margin:0;
    padding:9px 9px 2px;
    font-size:.8rem;
    color:var(--muted);
}

.review-media-caption input[type="text"]{
    width:100%;
    min-height:40px;
    margin-top:5px;
    padding:8px;
    font-size:.86rem;
}

@media(max-width:760px){
    .review-editor-grid{grid-template-columns:1fr}
    .review-preview{position:static}
    .review-admin-event-form{grid-template-columns:1fr}
    .review-admin-event-head,.review-admin-card-head{display:block}
    .review-admin-rating{margin-top:8px}
    .review-media-admin-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}

@media(max-width:420px){
    .review-rating-input{grid-template-columns:repeat(5,minmax(0,1fr))}
    .review-rating-input label{width:100%}
    .review-media-admin-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
