/* Styles du portail PHP, sans framework ni ressource distante. */
:root {
    --ink: #24383f;
    --muted: #687b82;
    --line: #dce4e7;
    --paper: #ffffff;
    --background: #f2f5f6;
    /* Bleus de Gestion locative (tableau de bord et menus). */
    --accent: #1a638c;
    --accent-dark: #004164;
    --accent-soft: #eaf3f9;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--background);
    color: var(--ink);
    font: 14px/1.6 "Segoe UI", Arial, sans-serif;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
button, summary { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 25px; font-weight: 600; line-height: 1.3; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 15px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.muted { color: var(--muted); }
.icon { width: 19px; height: 19px; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link { position: fixed; top: -100px; left: 15px; z-index: 20; background: white; padding: 12px; }
.skip-link:focus { top: 10px; }
.demo-banner { background: #fff1d8; color: #745a29; padding: 5px 16px; text-align: center; font-size: 11px; }

/* En-tête du syndic, logo à sa taille de lecture et navigation compacte. */
.site-header { background: var(--paper); border-top: 4px solid var(--brand, var(--accent)); }
.header-inner { max-width: 1280px; margin: auto; min-height: 150px; padding: 10px 30px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.site-brand { display: flex; gap: 30px; align-items: center; text-decoration: none; }
.site-brand > strong { font-size: 25px; font-weight: 650; }
.site-brand > span { color: var(--muted); font-size: 13px; }
.site-brand .brand-caption { border-left: 1px solid var(--line); padding-left: 25px; font-size: 14px; line-height: 1.7; }
.brand-caption strong { font-size: 19px; font-weight: 600; color: var(--ink); }
.site-brand img { display: block; width: auto; height: auto; max-width: 225px; max-height: 132px; object-fit: contain; }
.session-actions { display: flex; gap: 24px; align-items: center; font-size: 14px; }
.session-name { display: flex; align-items: center; gap: 10px; }
.session-name .icon { color: var(--muted); width: 18px; }
.session-actions .logout-button { color: var(--muted); background: white; min-height: 36px; padding: 7px 12px; }
.logout-button .icon { width: 16px; }
.site-nav { display: flex; gap: 8px; max-width: 1280px; margin: auto; padding: 0 30px; border-bottom: 1px solid var(--line); }
.site-nav a { padding: 12px 20px; text-decoration: none; color: var(--muted); font-size: 14px; border-bottom: 3px solid transparent; }
.site-nav a[aria-current] { color: white; border-color: var(--accent-dark); background: var(--accent); font-weight: 600; }
.site-nav a:hover { color: var(--ink); background: #eaf0f2; }
.site-nav a[aria-current]:hover { color: white; background: var(--accent-dark); }
.main-content { max-width: 1280px; margin: auto; padding: 30px 30px 15px; min-height: 65vh; }
.page-footer { max-width: 1280px; margin: 20px auto; padding: 15px 30px; color: #7f9198; font-size: 12px; border-top: 1px solid var(--line); }
.page-heading { display: flex; gap: 28px; justify-content: space-between; align-items: center; margin-bottom: 26px; }
.page-heading p { color: var(--muted); font-size: 14px; margin-top: 5px; }
.residence-switch { display: flex; gap: 12px; align-items: center; margin-bottom: 25px; font-size: 13px; }
.residence-switch select { max-width: 280px; }

/* Formulaires et boutons. */
input, select, textarea { border: 1px solid #cfd8d1; background: white; border-radius: 4px; padding: 9px 11px; max-width: 100%; }
input::placeholder { color: #8b968f; }
label { display: block; font-weight: 600; font-size: 13px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 39px; border: 1px solid #cfd8d1; padding: 9px 17px; border-radius: 4px; text-decoration: none; font-size: 13px; background: white; }
.button.primary { background: var(--accent); border-color: var(--accent); color: white; }
.button.primary:hover { filter: brightness(.9); }
.button.subtle { background: #f2f5f1; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: 4px; background: transparent; color: #829087; flex-shrink: 0; }
.icon-button:hover { background: #eaf1f3; color: var(--accent); }
.text-link { color: var(--accent); font-size: 13px; text-underline-offset: 3px; }
.notice { margin: 20px 0; padding: 12px 15px; border-left: 3px solid #9ab2a2; background: #edf3ec; color: #52664f; font-size: 13px; }
.notice.error { background: #fff0eb; border-color: #b86c57; color: #8a3f2e; }
.notice.success { border-color: #60916b; }

/* Vue d'ensemble : profil à gauche, rubriques documentaires à droite. */
.search-field input { width: 290px; min-height: 43px; background: white; font-size: 14px; }
.portal-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 26px; align-items: start; }
.owner-summary { background: white; border: 1px solid var(--line); border-top: 3px solid var(--brand, var(--accent)); border-radius: 7px; padding: 22px; overflow-wrap: anywhere; }
.owner-summary h2 { display: flex; gap: 10px; align-items: center; font-size: 15px; color: white; font-weight: 500; background: var(--accent); margin: -22px -22px 0; padding: 16px 22px; }
.owner-summary h2 .icon { width: 17px; }
.owner-name { margin-top: 23px; font-size: 17px; font-weight: 600; line-height: 1.5; }
.owner-address { margin-top: 12px; font-size: 13px; color: var(--muted); }
.owner-contact { margin: 22px 0; padding-top: 18px; border-top: 1px solid var(--line); }
.owner-contact div + div { margin-top: 14px; }
.owner-contact dt { color: var(--muted); font-size: 12px; }
.owner-contact dd { margin: 3px 0 0; font-size: 13px; }
.owner-summary .text-link { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.owner-summary .text-link .icon { width: 15px; }
.document-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.document-section { background: var(--paper); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; box-shadow: 0 2px 5px #263f4a04; }
.section-heading { padding: 18px 20px; display: flex; gap: 12px; align-items: center; justify-content: space-between; border-bottom: 1px solid #d5e5ef; background: var(--accent-soft); }
.section-heading h2 { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.section-heading h2 .icon { color: var(--accent); flex-shrink: 0; width: 20px; }
.document-count { display: inline-flex; align-items: center; justify-content: center; min-width: 27px; height: 26px; border-radius: 5px; background: #d7e9f5; color: var(--accent-dark); font-size: 12px; font-weight: 600; }
.year-group { margin: 0 20px; }
.year-group + .year-group { border-top: 1px solid var(--line); }
.year-group summary { padding: 14px 0 9px; font-size: 13px; font-weight: 600; color: #617b86; }
.year-group summary::marker { color: #849da7; font-size: 10px; }
.document-list { padding: 0; margin: 0 0 10px; list-style: none; }
.document-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 0; }
.document-row + .document-row { border-top: 1px solid #edf1f3; }
.document-name { display: flex; gap: 10px; align-items: center; min-width: 0; text-decoration: none; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.document-name:hover { color: var(--accent); }
.document-name:hover > span:last-child { text-decoration: underline; text-underline-offset: 3px; }
.file-type { display: flex; align-items: center; justify-content: center; width: 31px; min-height: 37px; border: 1px solid #e2e8eb; border-radius: 4px; color: #7e929b; background: #f8fafb; font-size: 8px; font-weight: 650; flex-shrink: 0; }
.document-row .icon { width: 17px; height: 17px; }
.empty-message { color: #788b93; padding: 23px 20px; font-size: 13px; }

/* Connexion : un formulaire unique. */
.login-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; }
.login-card { width: calc(100% - 40px); max-width: 420px; margin: 12vh auto 0; padding: 35px; background: white; border: 1px solid var(--line); border-top: 4px solid var(--brand, var(--accent)); border-radius: 5px; }
.login-logo { max-width: 210px; max-height: 145px; display: block; object-fit: contain; margin-bottom: 30px; }
.brand-name { font-size: 22px; font-weight: 650; margin-bottom: 28px; }
.login-card h1 { font-size: 22px; margin-bottom: 10px; }
.login-card > .muted { font-size: 13px; }
.login-form { margin-top: 26px; }
.login-form label { margin: 17px 0 7px; }
.login-form input { width: 100%; height: 43px; }
.password-field { position: relative; }
.password-field input { padding-right: 45px; }
.password-field button { position: absolute; top: 3px; right: 4px; }
.login-submit { margin-top: 24px; width: 100%; }
.login-help { margin-top: 20px; color: var(--muted); font-size: 12px; }
.login-footer { color: #919c92; font-size: 11px; padding: 25px; }

/* Coordonnées et contenus publiés par le syndic. */
.profile-card, .information-card { background: white; border: 1px solid var(--line); border-radius: 5px; padding: 25px; }
.profile-card { max-width: 740px; }
.profile-details { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 24px 0; }
.profile-details dt { font-size: 12px; color: var(--muted); }
.profile-details dd { margin: 5px 0 0; overflow-wrap: anywhere; }
.information-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
.rich-content { overflow-wrap: anywhere; }
.rich-content p { margin: 12px 0; }
.rich-content h3 { margin-top: 20px; }
.rich-content table { max-width: 100%; border-collapse: collapse; }
.rich-content td, .rich-content th { border: 1px solid var(--line); padding: 7px; }
.rich-content a { color: var(--accent); }

/* Administration existante : formulaire classique. */
.admin-page { max-width: 1050px; margin: auto; padding: 35px 24px; }
.admin-header { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.admin-header h1 { font-size: 25px; }
.eyebrow { color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.admin-login { max-width: 430px; margin: 8vh auto; padding: 30px; background: white; border: 1px solid var(--line); }
.admin-login input { width: 100%; }
.admin-login label, .editor label { margin: 17px 0 7px; }
.admin-login .button { width: 100%; margin-top: 22px; }
.editor { padding: 25px; background: white; border: 1px solid var(--line); }
.editor textarea { width: 100%; min-height: 280px; font: 13px/1.7 Consolas, monospace; }
.editor-actions { display: flex; gap: 15px; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.editor-actions label { margin: 0; font-weight: 400; }
.editor-actions input[type="checkbox"] { width: auto; }
.admin-table { width: 100%; border-collapse: collapse; background: white; font-size: 13px; }
.admin-table td, .admin-table th { border-bottom: 1px solid var(--line); padding: 12px; text-align: left; }
.error-card { max-width: 500px; margin: 15vh auto; padding: 35px; background: white; border: 1px solid var(--line); }
.error-card p { margin: 18px 0; }

@media (max-width: 1050px) {
    .portal-layout { grid-template-columns: 205px minmax(0, 1fr); gap: 20px; }
    .document-groups { grid-template-columns: 1fr; gap: 20px; }
    .document-section[data-section] { min-width: 0; }
}
@media (max-width: 700px) {
    .header-inner { min-height: 118px; padding: 10px 20px; gap: 12px; }
    .site-brand { gap: 14px; }
    .site-brand > strong { font-size: 19px; }
    .site-brand .brand-caption { display: none; }
    .site-brand img { max-width: 160px; max-height: 100px; }
    .session-actions { flex-direction: column; align-items: flex-end; gap: 10px; font-size: 12px; text-align: right; }
    .session-name { gap: 6px; }
    .session-name .icon { display: none; }
    .session-actions .logout-button { font-size: 11px; min-height: 30px; padding: 5px 8px; }
    .site-nav { padding: 0 12px; gap: 0; }
    .site-nav a { font-size: 12px; padding: 12px 10px; }
    .main-content { padding: 24px 18px 10px; }
    .page-heading { display: block; margin-bottom: 22px; }
    h1 { font-size: 24px; }
    .search-field { margin-top: 18px; }
    .search-field input { width: 100%; }
    .portal-layout, .information-grid { grid-template-columns: 1fr; gap: 22px; }
    .owner-summary { padding: 18px 20px; }
    .owner-summary h2 { margin: -18px -20px 0; padding: 15px 20px; }
    .owner-summary .owner-name { margin-top: 12px; }
    .owner-summary .owner-address { margin-top: 7px; }
    .owner-contact { display: flex; gap: 22px; margin: 15px 0; padding-top: 13px; flex-wrap: wrap; }
    .owner-contact div + div { margin-top: 0; }
    .profile-details { grid-template-columns: 1fr; gap: 18px; }
    .residence-switch { flex-wrap: wrap; gap: 8px; }
    .login-card { margin-top: 7vh; padding: 27px; }
    .page-footer { padding: 15px 18px; }
    .admin-header { align-items: flex-start; }
    .admin-header h1 { font-size: 21px; }
    .admin-table td, .admin-table th { padding: 8px; font-size: 12px; }
}
