* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
}
:root {
    --bg:#1e1e2f;
    --form-bg:#2c2c3e;
    --alert-bg:#1e1e2f;
    --input-bg:#3d3d5c;
    --btn-bg:#ffd700;
    --ph-txt-color:#fff;
    --btn-txt-color:#000;
    --accent:#;
    --muted:#666;
    --radius:10px;
}
body {
    background: var(--bg);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}
.container {
    background: var(--form-bg);
    padding: 12px 30px 40px 30px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.6);
    width: 800px;
    text-align: center;
}
.container-small-aside {
    width: 355px;
    margin-left: 5px;
    padding: 15px 12px 12px 12px;
    border-radius: 0px 12px 12px 0px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.6);
}
.container-large {
    width: 1000px;
}
.container-cols {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: center;
    align-items: center;
}
h1 {
    color: #ffd700;
    margin-bottom: 20px;
}
h2 {
    margin-bottom: 5px;
    color: #fff;
    font-size: 18px;
    text-align: center;
}
.H2 {
    color: #fff;
    font-size: 18px;
    text-align: center;
}
.info-box {
    margin-top: 10px;
    border-radius: 5px;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease, padding 0.3s ease;
}
form {
    display: flex;
    flex-direction: column;
}
.field {
    display: grid;
    gap: 6px;
}
.form-row {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    align-items: start;
}
.form-row-small {
    display: flex;
    align-items: start;
    justify-content: space-evenly;
}
.form-row input,
.form-row select {
    width: 100%;
    box-sizing: border-box;
}
.form-row-small input,
.form-row-small select {
    width: 95%;
    box-sizing: border-box;
}
.form-row-small button {
    width: 100%;
    text-align: center;
}
.form-row > .field,
.form-row-small > .field {
    min-width: 0;
}
.form-columns {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(3, 1fr);
    align-items: start;
}
.form-columns-small {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
}
.form-columns-big {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(6, 1fr);
    justify-items: center;
    align-items: center;
}
.form-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    /*margin-block: 20px;*/
}
.stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.btn-columns-big {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}
label {
    text-align: left;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 0.9em;
}
input,
select,
textarea{
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 6px;
    border: none;
    outline: none;
    font-size: 0.9em;
    background: var(--input-bg);
    color: var(--ph-txt-color);
}
textarea {
    resize:vertical;
    min-height:75px;
}
button{
    padding: 12px;
    background-color: var(--btn-bg);
    color: var(--btn-txt-color);
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}
button:hover {
    background-color: #fff;
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.addBtn {
    margin-bottom: 5px;
}
.removeBtn {
    padding: 10px;
    background-color: #ff4d4d;
    margin-top: 30px;
    color: #fff;
}
.removeBtn2 {
    padding: 10px;
    background-color: #ff4d4d;
    margin-top: 0px;
    color: #fff;
}
.back-btn {
    font-size: 0.9em;
    font-weight: bold;
    text-decoration: none;
    padding: 12px;
    margin-top: 5px;
    background-color: #ffd700;
    color: #000;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.back-btn:hover {
    background-color: #fff;
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
#message {
    margin-top: 15px;
    font-size: 18px;
}
.hidden {
    display: none;
}
@media (max-width: 900px) {
    .form-columns {
        grid-template-columns: 1fr;
    }
}

.modal__close[hidden] { display: none !important; }
/* Empêche le scroll de fond quand le <dialog> est ouvert en modal() */
.body--noScroll { overflow: hidden; }
/* 1) Par défaut: invisible tant que [open] n’est pas présent */
#appModal:not([open]) {
    display: none !important;
}
/* Base (ne force pas le display) */
#appModal {
    border: none;
    padding: 0;
    background: transparent;
    border-radius: 12px;
}
/* 2) Centrage uniquement quand ouvert */
#appModal[open] {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}
#appModal::backdrop {
    background: rgba(0, 0, 0, 0.45);
}
.modal__panel {
    min-inline-size: min(520px, calc(100vw - 2rem));
    max-inline-size: min(640px, 100vw - 2rem);
    max-block-size: min(85vh, 100vh - 2rem);
    overflow: auto;
    margin: 0;
    border-radius: 12px;
    background: #fff;
    color: #111;
    box-shadow: 0 15px 40px rgba(0,0,0,0.25);
    display: grid;
    grid-template-rows: auto 1fr auto;
}
/* Sections internes (inchangées) */
.modal__header {
    padding: 1rem 1.25rem 0.25rem;
}
.modal__title  {
    margin: 0;
    font-size: 1.125rem;
    line-height: 1.3;
}
.modal__body   {
    padding: 0.75rem 1.25rem 1rem;
    color: #333;
}
.modal__footer {
    display: flex; gap: .5rem; justify-content: flex-end;
    padding: .75rem 1.25rem 1.25rem;
}
/* Boutons (inchangé) */
.btn {
    appearance: none; border: 0; border-radius: 8px; padding: .6rem .9rem;
    font: inherit; cursor: pointer;
}
.btn--primary {
    background: var(--alert-btn-bg); 
    color: #fff;
}
.btn--primary:focus-visible,
.btn--ghost:focus-visible {
    outline: 3px solid rgba(37,99,235,.35);
    outline-offset: 2px;
}
.btn--ghost   {
    background: #eef2ff;
    color: #111;
}
/* Thème sombre optionnel */
@media (prefers-color-scheme: dark) {
    .modal__panel { background: var(--alert-bg); color: #e5e7eb; }
    .modal__body  { color: #cbd5e1; }
    .btn--ghost   { background: var(--muted); color: #e5e7eb; }
}