/* =========================================================================
   ACCOUNT — profil, profil public, favoris, notifications, données
   ========================================================================= */

/* ---------- Profil (édition) ---------- */

.acc-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}

.acc-aside {
    position: sticky;
    top: calc(var(--nav-h) + 24px);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.acc-identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 28px 20px 22px;
}

.acc-identity .avatar { margin-bottom: 14px; box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px var(--line); }
.acc-identity h2 { font-size: 1.2rem; margin: 0 0 4px; }
.acc-specialty { margin: 0; color: var(--ink-2); font-weight: 500; }
.acc-email { margin: 2px 0 14px; color: var(--ink-3); font-size: .86rem; word-break: break-all; }

.acc-toc { display: flex; flex-direction: column; gap: 2px; }

.acc-toc a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 11px;
    color: var(--ink-2);
    font-weight: 550;
    font-size: .92rem;
}

.acc-toc a:hover { background: var(--paper); color: var(--ink); }
.acc-toc a .icon { width: 18px; height: 18px; color: var(--ink-3); }
.acc-toc a.is-danger, .acc-toc a.is-danger .icon { color: var(--danger); }

.acc-main { min-width: 0; }
.acc-main .form-section { scroll-margin-top: calc(var(--nav-h) + 20px); }
.acc-main > .form-section, .acc-form + .form-section { margin-top: 20px; }

.acc-section-icon {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--canvas);
    border: 1px solid var(--line);
    color: var(--ink-2);
}

.acc-section-icon .icon { width: 19px; height: 19px; }

.acc-avatar-field {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px;
    margin-bottom: 18px;
    border-radius: var(--r-md);
    background: var(--canvas);
}

.acc-avatar-input { flex: 1; min-width: 0; }
.acc-avatar-input > div { margin-bottom: 0 !important; }

.acc-public-toggle { margin-bottom: 18px; font-weight: 400; }

.acc-data-rows { border-top: 1px solid var(--line-soft); padding-top: 4px; }
.acc-data-rows .list-item { border-top: 1px solid var(--line-soft); padding: 14px 0; }
.acc-data-rows .list-item:first-child { border-top: 0; padding-top: 14px; }
.acc-data-rows p, .acc-google p { margin: 2px 0 0; font-size: .9rem; }

.acc-savebar {
    position: sticky;
    bottom: 16px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding: 14px 14px 14px 22px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-3);
}

.acc-savebar p { margin: 0; font-size: .9rem; }

.acc-google { padding: 0; border-top: 0; }

.acc-danger { border-color: #F3C9C5; }
.acc-danger .acc-section-icon { background: var(--danger-50); border-color: #F3C9C5; color: var(--danger); }

/* ---------- Suppression du compte ---------- */

.acc-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 18px;
    font-size: .9rem;
    font-weight: 600;
    color: var(--ink-2);
}

.acc-back:hover { color: var(--ink); }
.acc-back .icon { width: 16px; height: 16px; }

.acc-delete-grid { margin-bottom: 20px; }
.acc-delete-grid .panel { margin: 0; }
.acc-delete-grid .panel-title { display: flex; align-items: center; gap: 10px; font-size: 1rem; }
.acc-delete-grid .panel-title .icon { color: var(--ink-3); }

.acc-checklist { list-style: none; margin: 0; padding: 0; }

.acc-checklist li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-top: 1px solid var(--line-soft);
    font-size: .94rem;
}

.acc-checklist li:first-child { border-top: 0; }

.acc-checklist li::before {
    content: "";
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border-radius: 50%;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px;
}

.acc-checklist.is-removed li::before {
    background-color: var(--danger-50);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C2372D' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E");
}

.acc-checklist.is-kept li::before {
    background-color: var(--line-soft);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234B5070' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E");
}

.acc-confirm { margin-bottom: 4px; }
.acc-confirm:has(input:checked) { border-color: var(--danger); background: var(--danger-50); }
.acc-confirm > div { margin: 0 !important; }

/* ---------- Profil public (page auteur) ---------- */

.author-hero {
    padding: 48px 0 40px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.author-hero-grid {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 28px;
    align-items: center;
}

.author-avatar { width: 128px; height: 128px; font-size: 2.4rem; box-shadow: 0 0 0 5px var(--paper), 0 0 0 6px var(--line), var(--shadow-2); }

.author-id h1 {
    margin: 0 0 6px;
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: clamp(2.1rem, 1.5rem + 2vw, 3.1rem);
    letter-spacing: -.025em;
}

.author-role { margin: 0 0 16px; font-size: 1.05rem; color: var(--ink); font-weight: 550; }
.author-role span { color: var(--ink-3); font-weight: 400; }

.author-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .92rem; color: var(--ink-2); }
.author-stats span { display: inline-flex; align-items: center; gap: 7px; }
.author-stats strong { color: var(--ink); font-size: 1.05rem; }
.author-stats .icon { width: 17px; height: 17px; color: var(--ink-3); }

.author-links { display: flex; flex-direction: column; gap: 8px; }

.author-split { grid-template-columns: minmax(0, 1fr) 320px; }
.author-shelf { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.author-bio { margin: 0; color: var(--ink-2); line-height: 1.65; }

/* ---------- Favoris ---------- */

.fav-shelf { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 36px 24px; }
.fav-card { gap: 12px; }
.fav-card .mcard-title { font-size: 1.05rem; }
.fav-author { margin: 0; font-size: .88rem; font-weight: 550; }

.fav-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--line);
    font-size: .8rem;
}

.fav-foot .btn-sm { min-height: 30px; padding: 4px 8px; font-size: .82rem; }
.fav-foot .btn-sm:hover { color: var(--danger); background: var(--danger-50); }

/* ---------- Notifications ---------- */

.notif-list { list-style: none; margin: 0; padding: 0; }

.notif {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 16px;
    align-items: start;
    padding: 18px 22px;
    border-top: 1px solid var(--line-soft);
}

.notif:first-child { border-top: 0; }
.notif.is-unread { background: linear-gradient(90deg, var(--marker-50), rgba(255, 255, 255, 0) 70%); }

.notif.is-unread::before {
    content: "";
    position: absolute;
    left: 0;
    top: 18px;
    bottom: 18px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--marker);
}

.notif-icon {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--line-soft);
    color: var(--ink-2);
}

.notif-icon .icon { width: 18px; height: 18px; }
.notif-icon.is-green { background: var(--green-50); color: var(--green); }
.notif-icon.is-indigo { background: var(--indigo-50); color: var(--indigo); }
.notif-icon.is-marker { background: var(--marker-50); color: #7A5C00; }
.notif-icon.is-danger { background: var(--danger-50); color: var(--danger); }

.notif-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 3px; }
.notif-head strong { font-size: .95rem; }
.notif-head time { font-size: .82rem; color: var(--ink-3); }
.notif-body p { margin: 0; color: var(--ink-2); font-size: .94rem; }
.notif:not(.is-unread) .notif-head strong { font-weight: 550; color: var(--ink-2); }
.notif-side { align-self: center; }
.notif-read { font-size: .84rem; }

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
    .acc-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .acc-aside, .acc-main { min-width: 0; }
    .acc-aside { position: static; }
    .acc-identity { flex-direction: row; text-align: left; gap: 16px; padding: 18px; flex-wrap: wrap; }
    .acc-identity .avatar { width: 72px; height: 72px; font-size: 1.4rem; margin: 0; }
    .acc-identity > h2, .acc-identity > p { width: auto; }
    .acc-toc { flex-direction: row; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
    .acc-toc a { white-space: nowrap; }
    .author-split { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .acc-identity { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; row-gap: 2px; align-items: center; }
    .acc-identity .avatar { grid-row: 1 / span 4; }
    .acc-identity h2, .acc-identity p { margin: 0; }
    .acc-identity .badge { justify-self: start; margin-top: 4px; }
    .acc-email { font-size: .8rem; }
    .acc-main .form-section { overflow: hidden; }
    .acc-main input[type="file"] { max-width: 100%; }
    .acc-avatar-field { flex-direction: column; align-items: flex-start; }
    .acc-savebar { padding: 12px; bottom: 10px; }
    .acc-savebar p { display: none; }
    .acc-savebar .btn { width: 100%; }
    .acc-data-rows .list-item, .acc-google { flex-direction: column; align-items: flex-start; }

    .author-hero { padding: 32px 0 28px; }
    .author-hero-grid { grid-template-columns: 1fr; gap: 16px; text-align: left; }
    .author-avatar { width: 96px; height: 96px; font-size: 1.8rem; }
    .author-links { flex-direction: row; flex-wrap: wrap; }
    .author-shelf, .fav-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }

    .notif { grid-template-columns: auto minmax(0, 1fr); padding: 16px; }
    .notif-side { grid-column: 2; }
}

/* Espacement des form_row Symfony imbriqués dans les sections */
.acc-form .form-section > div:has(> label),
.acc-form .field-row > div > div,
.acc-delete-form form > div:has(> label),
.profile-form > div:has(> label) { margin-bottom: 18px; }
.acc-form .field-row > div > div:has(> label) { margin-bottom: 18px; }
.fav-foot .faint { white-space: nowrap; }
@media (max-width: 720px) { .fav-foot { flex-wrap: wrap; } }
