/*
 * Fichier — socle commun (charte alignée sur Hôtellerie SJM v70).
 * ==========================================================================
 * Bleu historique : #5782bd · bleu profond : #39557a · or : #d1971b.
 * Titres et navigation : Oswald ; contenu : Roboto.
 *
 * La politique CSP du programme n'autorise que les ressources locales :
 * les polices sont donc appelées par leur nom, avec des équivalents système
 * (Bahnschrift / Segoe UI sous Windows) lorsqu'elles ne sont pas installées.
 *
 * Organisation des feuilles :
 *   fichier.css         variables, éléments HTML, boutons, formulaires,
 *                       tableaux, messages, pagination (ce fichier) ;
 *   fichier-layout.css  en-tête, menu, fil d'Ariane, contenu, pied de page,
 *                       écrans de connexion ;
 *   fichier-blocks.css  en-têtes de page, fiches en blocs, tableau de bord ;
 *   search.css, receipt.css, hotellerie-print.css : écrans particuliers.
 */

:root {
    --hot-blue: #5782bd;
    --hot-blue-rgb: 87, 130, 189;
    --hot-blue-deep: #39557a;
    --hot-blue-dark: #2c4260;
    --hot-blue-soft: #eef3fa;
    --hot-gold: #d1971b;
    --hot-gold-dark: #aa7610;
    --hot-gold-soft: #fffaf0;
    --hot-ink: #31465f;
    --hot-muted: #6d7b8d;
    --hot-line: #dbe3ee;
    --hot-paper: #fff;
    --hot-bg: #f4f6f9;
    --hot-danger: #a33a3a;
    --hot-danger-soft: #fcf0ed;
    --hot-success: #2c6940;
    --hot-success-soft: #e9f7ee;
    --hot-shadow: 0 28px 70px rgba(49, 70, 95, .14);
    --hot-shadow-soft: 0 12px 32px rgba(49, 70, 95, .09);
    --hot-shadow-card: 0 7px 20px rgba(49, 70, 95, .08);

    /* Champs obligatoires / facultatifs : même convention que l'Hôtellerie. */
    --hot-field-required-bg: #edf4fc;
    --hot-field-required-border: #527aa8;
    --hot-field-required-label: #244466;
    --hot-field-optional-bg: #f7f8fa;
    --hot-field-optional-border: #aab5c1;
    --hot-field-optional-label: #566574;

    /* Fichier actif : seule différence visuelle entre les fichiers. */
    --file-accent: #2f7d68;
    --file-accent-soft: #dceee5;
    --file-accent-ink: #174e45;

    --font-title:
        "Oswald", "Bahnschrift SemiCondensed", "Bahnschrift", "Arial Narrow", Arial, sans-serif;
    --font-text: "Roboto", "Segoe UI", Arial, sans-serif;
    --radius: .65rem;
    --radius-lg: .85rem;
    --gutter: clamp(1rem, 2.5vw, 2.5rem);

    color-scheme: light;
}

body.file-copper {
    --file-accent: #985324;
    --file-accent-soft: #f8e8d6;
    --file-accent-ink: #784018;
}

/* --------------------------------------------------------------------------
   ÉLÉMENTS DE BASE
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 100%;
}

body {
    min-width: 320px;
    margin: 0;
    background:
        radial-gradient(circle at 90% 0, rgba(var(--hot-blue-rgb), .10), transparent 30rem),
        linear-gradient(180deg, #fafbfd 0, var(--hot-bg) 34rem);
    background-attachment: fixed;
    color: var(--hot-ink);
    font-family: var(--font-text);
    font-size: .95rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--hot-blue-deep);
    text-underline-offset: .16em;
    text-decoration-thickness: 1px;
}

a:hover {
    color: var(--hot-gold-dark);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--hot-blue-dark);
    font-family: var(--font-title);
    font-weight: 400;
    line-height: 1.2;
}

h1 {
    margin: 0 0 1.1rem;
    font-size: clamp(1.7rem, 2.6vw, 2.35rem);
    letter-spacing: .01em;
}

h2 {
    margin: 1.8rem 0 .8rem;
    font-size: 1.35rem;
}

h3 {
    margin: 1.2rem 0 .6rem;
    font-size: 1.08rem;
    font-weight: 500;
}

p {
    margin: 0 0 1rem;
}

strong {
    font-weight: 700;
}

hr {
    margin: 1.2rem 0;
    border: 0;
    border-top: 1px solid var(--hot-line);
}

img {
    max-width: 100%;
}

button, input, select, textarea {
    font: inherit;
}

button, a, input, select, textarea, summary {
    touch-action: manipulation;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid rgba(var(--hot-blue-rgb), .45);
    outline-offset: 2px;
}

.hidden {
    display: none !important;
}

.eyebrow {
    display: block;
    margin-bottom: .2rem;
    color: var(--hot-gold-dark);
    font-family: var(--font-text);
    font-size: .73rem;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.text-center {
    text-align: center;
}

/* --------------------------------------------------------------------------
   BOUTONS
   Référence : .btn-primary / .btn-outline-* / .admin-btn-standard Hôtellerie.
   -------------------------------------------------------------------------- */

.button,
button,
input[type=submit] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    min-height: 2.35rem;
    padding: .5rem .95rem;
    border: 1px solid var(--hot-blue);
    border-radius: .45rem;
    background: var(--hot-blue);
    color: #fff;
    font-family: var(--font-text);
    font-size: .86rem;
    font-weight: 600;
    line-height: 1.1;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    transition:
        background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.button:hover,
button:hover,
input[type=submit]:hover {
    border-color: var(--hot-blue-deep);
    background: var(--hot-blue-deep);
    color: #fff;
}

.button:active,
button:active {
    border-color: var(--hot-blue-dark);
    background: var(--hot-blue-dark);
}

.button-secondary {
    border-color: var(--hot-blue);
    background: #fff;
    color: var(--hot-blue-deep);
}

.button-secondary:hover {
    border-color: var(--hot-blue);
    background: var(--hot-blue-soft);
    color: var(--hot-blue-deep);
}

.button-accent {
    border-color: var(--hot-gold);
    background: var(--hot-gold-soft);
    color: #74540d;
}

.button-accent:hover {
    border-color: var(--hot-gold);
    background: var(--hot-gold);
    color: #fff;
}

.button-danger {
    border-color: #b94a4a;
    background: #fff;
    color: #8b2929;
}

.button-danger:hover {
    border-color: #8b2929;
    background: #8b2929;
    color: #fff;
}

.button-small {
    min-height: 1.8rem;
    padding: .28rem .6rem;
    border-radius: .36rem;
    font-size: .76rem;
}

button:disabled,
.button[aria-disabled="true"] {
    opacity: .55;
    cursor: not-allowed;
    pointer-events: none;
}

/* Liens d'action simples dans le texte courant : alignés quand ils se suivent. */
p > .button + .button,
p > .button + a,
p > a + .button {
    margin-left: .35rem;
}

/* --------------------------------------------------------------------------
   FORMULAIRES
   -------------------------------------------------------------------------- */

form {
    margin: 0 0 1.2rem;
}

.input {
    min-width: 0;
    margin: 0 0 1rem;
}

label {
    display: block;
    margin: 0 0 .4rem;
    color: var(--hot-blue-deep);
    font-size: .86rem;
    font-weight: 600;
}

input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=submit]):not([type=button]):not([type=reset]),
select,
textarea {
    display: block;
    width: 100%;
    min-height: 2.75rem;
    padding: .55rem .8rem;
    border: 1px solid var(--hot-field-optional-border);
    border-radius: .55rem;
    background: #fff;
    color: var(--hot-ink);
    font-size: .95rem;
    line-height: 1.4;
    transition:
        border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

textarea {
    min-height: 8rem;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: #9aa6b4;
    opacity: 1;
}

input[required]:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=submit]):not([type=button]):not([type=reset]),
select[required],
textarea[required] {
    border-color: var(--hot-field-required-border);
    background-color: var(--hot-field-required-bg);
}

.required > label {
    color: var(--hot-field-required-label);
    font-weight: 700;
}

.required > label::after {
    content: " *";
    color: var(--hot-danger);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--hot-blue) !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 .22rem rgba(var(--hot-blue-rgb), .13);
    outline: 0;
}

input[type=hidden] {
    display: none;
}

input[type=checkbox],
input[type=radio] {
    width: 1.1rem;
    height: 1.1rem;
    margin: 0 .55rem 0 0;
    accent-color: var(--hot-blue);
    vertical-align: middle;
}

.checkbox label,
.radio label {
    display: flex;
    align-items: center;
    gap: .45rem;
    min-height: 2.4rem;
    color: #5b6878;
    font-size: .9rem;
    font-weight: 500;
}

.checkbox input,
.radio input {
    flex-shrink: 0;
}

fieldset {
    min-width: 0;
    margin: 1.2rem 0;
    padding: 1.1rem 1.2rem .4rem;
    border: 1px solid var(--hot-blue);
    border-radius: .72rem;
    background: #fff;
    box-shadow: var(--hot-shadow-card);
}

legend {
    padding: .15rem .65rem;
    border: 1px solid var(--hot-blue);
    border-radius: 999px;
    background: var(--hot-blue-soft);
    color: var(--hot-blue-deep);
    font-family: var(--font-title);
    font-size: .98rem;
    font-weight: 500;
}

.form-grid,
.field-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .2rem 1.2rem;
}

.form-grid > .input,
.field-grid > .input {
    margin-bottom: .9rem;
}

.field-grid .span-all,
.form-grid .span-all {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--hot-line);
}

.form-actions a {
    font-size: .88rem;
}

.error-message,
[role=alert] {
    color: var(--hot-danger);
    font-size: .82rem;
}

.error-message {
    margin-top: .35rem;
}

.input.error input,
.input.error select,
.input.error textarea {
    border-color: var(--hot-danger) !important;
    background-color: var(--hot-danger-soft) !important;
}

/* Statut du contrôle anti-robot des formulaires publics. */
.antibot-status {
    margin: 0 0 .6rem;
    color: var(--hot-muted);
    font-size: .8rem;
}

.antibot-status:empty {
    display: none;
}

/* --------------------------------------------------------------------------
   MESSAGES (flash et notes)
   -------------------------------------------------------------------------- */

.message {
    margin: 0 0 1.2rem;
    padding: .85rem 1.1rem;
    border: 0;
    border-left: 4px solid var(--hot-blue);
    border-radius: .55rem;
    background: var(--hot-blue-soft);
    box-shadow: 0 6px 18px rgba(49, 70, 95, .06);
    color: var(--hot-blue-dark);
    cursor: pointer;
}

.message.success {
    border-color: #318665;
    background: var(--hot-success-soft);
    color: #225d48;
}

.message.warning {
    border-color: var(--hot-gold);
    background: #fff6e2;
    color: #6f4f0b;
}

.message.error {
    border-color: #bb4d42;
    background: var(--hot-danger-soft);
    color: #8a3432;
}

/* Note d'information intégrée à une page. */
.dashboard-note,
.note {
    margin: 1.2rem 0;
    padding: .85rem 1.1rem;
    border-left: 4px solid var(--hot-gold);
    border-radius: .55rem;
    background: var(--hot-gold-soft);
    color: #5d4610;
    font-size: .9rem;
}

.dashboard-note p,
.note p {
    margin: 0;
}

/* --------------------------------------------------------------------------
   TABLEAUX
   Référence : .events-display-table (listes) Hôtellerie.
   -------------------------------------------------------------------------- */

.table-scroll {
    width: 100%;
    margin: 1.2rem 0;
    overflow-x: auto;
    border: 1px solid var(--hot-line);
    border-radius: .6rem;
    background: #fff;
    box-shadow: 0 1px 5px rgba(35, 58, 84, .045);
    overscroll-behavior-x: contain;
}

.table-scroll table {
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

table {
    width: 100%;
    margin: 1.2rem 0;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    color: var(--hot-ink);
    font-size: .84rem;
    text-align: left;
}

/* Tableau isolé (sans .table-scroll) : même cadre que la version enveloppée. */
:not(.table-scroll) > table {
    border: 1px solid var(--hot-line);
    border-radius: .6rem;
    overflow: hidden;
}

th,
td {
    padding: .5rem .65rem;
    border-bottom: 1px solid #e1e7ef;
    vertical-align: middle;
    line-height: 1.3;
}

thead th {
    border-bottom: 2px solid #8ea8c5;
    background: #e8f0f8;
    color: #2c435e;
    font-size: .76rem;
    font-weight: 700;
    white-space: nowrap;
}

th a {
    color: inherit;
    text-decoration: none;
}

th a:hover {
    color: var(--hot-blue-deep);
    text-decoration: underline;
}

td {
    overflow-wrap: anywhere;
}

tbody tr:nth-child(even) {
    background: #fafbfd;
}

tbody tr:hover {
    background: #f0f5fb;
}

tbody tr:last-child td {
    border-bottom: 0;
}

td:last-child {
    white-space: nowrap;
}

td a {
    font-weight: 600;
    text-decoration: none;
}

td a:hover {
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   LISTES DE DÉFINITIONS (hors blocs de fiche)
   -------------------------------------------------------------------------- */

dl {
    display: grid;
    grid-template-columns: minmax(10rem, 24%) minmax(0, 1fr);
    margin: 1.2rem 0;
    overflow: hidden;
    border: 1px solid var(--hot-line);
    border-radius: .6rem;
    background: #fff;
}

dt,
dd {
    margin: 0;
    padding: .55rem .85rem;
    border-bottom: 1px solid var(--hot-line);
    overflow-wrap: anywhere;
}

dt {
    background: var(--hot-blue-soft);
    color: var(--hot-blue-deep);
    font-size: .84rem;
    font-weight: 700;
}

dd {
    white-space: pre-wrap;
}

dl > dt:last-of-type,
dl > dd:last-of-type {
    border-bottom: 0;
}

/* --------------------------------------------------------------------------
   PAGINATION
   -------------------------------------------------------------------------- */

.pagination,
.paging-controls {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    align-items: center;
    margin: 1rem 0 0;
    padding: 0;
    font-size: .84rem;
}

.pagination li {
    display: inline-flex;
    list-style: none;
}

.pagination a,
.pagination span,
.paging-controls a,
.paging-controls span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    min-height: 2.1rem;
    padding: .3rem .65rem;
    border: 1px solid var(--hot-line);
    border-radius: .4rem;
    background: #fff;
    color: var(--hot-blue-deep);
    font-weight: 600;
    text-decoration: none;
}

.pagination a:hover,
.paging-controls a:hover {
    border-color: var(--hot-blue);
    background: var(--hot-blue-soft);
}

.pagination .active a,
.paging-controls .current {
    border-color: var(--hot-blue);
    background: var(--hot-blue);
    color: #fff;
}

.pagination .disabled,
.paging-controls .disabled {
    opacity: .55;
}

/* --------------------------------------------------------------------------
   RESPONSIVE / IMPRESSION
   -------------------------------------------------------------------------- */

@media (min-width: 1600px) {
    .field-grid,
    .form-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .form-grid,
    .field-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    dl {
        grid-template-columns: minmax(7rem, 36%) minmax(0, 1fr);
    }

    th,
    td {
        padding: .45rem .5rem;
    }

    fieldset {
        padding: 1rem .85rem .3rem;
    }
}

@media (max-width: 575.98px) {
    body {
        font-size: .92rem;
    }

    .form-grid,
    .field-grid {
        grid-template-columns: 1fr;
    }

    .form-actions .button,
    .form-actions button {
        width: 100%;
    }

    .table-scroll table {
        min-width: 650px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

@media print {
    body {
        background: #fff;
        color: #000;
        font-size: 11pt;
    }

    .button,
    button,
    .pagination,
    .paging-controls,
    .form-actions {
        display: none !important;
    }

    .table-scroll {
        overflow: visible;
        border: 0;
        box-shadow: none;
    }

    table {
        font-size: 10pt;
    }

    th,
    td {
        padding: 4px 6px;
    }

    a {
        color: #000;
        text-decoration: none;
    }

    fieldset,
    article {
        break-inside: avoid;
    }
}
