/* =============================================
   COMPONENTS — Boutons, Formulaires, Badges, Listes
   ============================================= */

/* --- Boutons --- */
.btn {
    width: 100%;
    padding: 12px;
    background-color: var(--color-primary);
    color: var(--color-white);
    border: 2px solid var(--color-primary);
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: 600;
    text-decoration: none;
}

.btn:hover {
    background-color: var(--color-black);
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    text-decoration: none;
}

.btn-w {
    width: 100%;
    padding: 12px;
    background-color: var(--color-white);
    color: var(--color-primary);
    border: 2px solid var(--color-white);
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: 600;
    text-decoration: none;
}

.btn-w:hover {
    background-color: var(--color-black);
    color: var(--color-white);
    border: 2px solid var(--color-white);
    text-decoration: none;
}

.btn-alert {
    width: 100%;
    padding: 12px;
    background-color: var(--color-red);
    color: var(--color-white);
    border: 2px solid var(--color-red);
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: 600;
    text-decoration: none;
}

.btn-alert:hover {
    background-color: var(--color-black);
    color: var(--color-red);
    border: 2px solid var(--color-red);
    text-decoration: none;
}

.btn-sm {
    padding: 6px 12px;
    background-color: var(--color-primary);
    color: var(--color-white);
    border: 1px solid var(--color-primary);
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.btn-sm:hover {
    background-color: var(--color-black);
    color: var(--color-primary);
}

.btn-sm-alert {
    padding: 6px 10px;
    background-color: var(--color-red);
    color: var(--color-white);
    border: 1px solid var(--color-red);
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sm-alert:hover {
    background-color: var(--color-black);
    color: var(--color-red);
}

.btn-sm-success {
    padding: 6px 12px;
    background-color: #4caf50;
    color: var(--color-white);
    border: 1px solid #4caf50;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.btn-sm-success:hover {
    background-color: var(--color-black);
    color: #4caf50;
}

/* --- Formulaires --- */
form {
    color: var(--color-black);
}

input {
    line-height: normal;
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 6px;
    border: 1px solid var(--color-border-grey);
    box-sizing: border-box;
}

input[type="checkbox"],
input[type="radio"] {
    box-sizing: border-box;
    padding: 0;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    height: auto;
}

input[type="search"] {
    -webkit-appearance: textfield;
    box-sizing: border-box;
}

input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
}

input::placeholder       { color: var(--color-black); opacity: 1; }
input:-ms-input-placeholder  { color: var(--color-black); opacity: 1; }
input::-ms-input-placeholder { color: var(--color-black); opacity: 1; }

textarea {
    overflow: auto;
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--color-border-grey);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

button {
    overflow: visible;
}

button, select {
    text-transform: none;
}

button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
    -webkit-appearance: button;
    cursor: pointer;
}

button[disabled],
html input[disabled] {
    cursor: default;
}

button::-moz-focus-inner,
input::-moz-focus-inner {
    border: 0;
    padding: 0;
}

fieldset {
    border: 1px solid var(--color-grey);
    margin: 0 2px;
    padding: 0.35em 0.625em 0.75em;
}

legend { border: 0; padding: 0; }

/* --- Listes --- */
ul {
    text-align: left;
    padding: 30px 0 30px 15px;
    margin: 0;
}

li {
    padding: 5px 0;
}

ul.list {
    text-align: left;
    padding: 10px;
    margin: 0;
    list-style: none;
    overflow-y: scroll;
    max-height: 1000px;
}

ul.list li {
    background: var(--color-black);
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 5px;
    border: 1px solid rgba(255,255,255,.2);
}

/* --- Tables --- */
table {
    border-collapse: collapse;
    border-spacing: 0;
    margin: 30px 0;
    width: 100%;
}

table td, table th {
    padding: 15px 5px;
    text-align: left;
    vertical-align: middle;
    border-radius: 2px;
    border: 1px solid var(--color-primary);
}

table th { text-align: center; }
table, th, td { border: none; }
td, th { padding: 0; }

table thead {
    border-bottom: 1px solid var(--color-primary);
    background-color: var(--color-black);
    font-weight: bold;
    color: var(--color-primary);
}

table tfoot {
    border-top: 1px solid var(--color-primary);
    background-color: var(--color-black);
}

table tbody, table thead, table tfoot { width: 100%; }

table tbody tr:first-child td,
table tbody tr:first-child th,
table thead tr:first-child td,
table thead tr:first-child th,
table tfoot tr:first-child td,
table tfoot tr:first-child th { border-top: 0; }

table tbody tr:last-child td,
table tbody tr:last-child th,
table thead tr:last-child td,
table thead tr:last-child th,
table tfoot tr:last-child td,
table tfoot tr:last-child th { border-bottom: 0; }

table tbody tr td:first-child,
table tbody tr th:first-child,
table thead tr td:first-child,
table thead tr th:first-child,
table tfoot tr td:first-child,
table tfoot tr th:first-child { border-left: 0; }

table tbody tr td:last-child,
table tbody tr th:last-child,
table thead tr td:last-child,
table thead tr th:last-child,
table tfoot tr td:last-child,
table tfoot tr th:last-child { border-right: 0; }

/* --- Divers --- */
.action { width: 100%; }
.action form { padding: 10px; }
figure { margin: 1em 40px; }

/* --- Checkbox opt-in --- */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    padding: 10px 0;
    margin-bottom: 15px;
    cursor: pointer;
    color: var(--color-white);
    font-size: 0.9em;
    line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 3px 0 0 0;
    accent-color: var(--color-primary);
    transform: scale(1.2);
    cursor: pointer;
}

.checkbox-label span {
    flex: 1;
}

/* --- Badges --- */
.badge-redeemed {
    display: inline-block;
    background: #4caf50;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 8px;
    font-weight: 600;
}

.badge-optin {
    display: inline-block;
    background: var(--color-primary);
    color: var(--color-black);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 8px;
    font-weight: 600;
}

/* --- Form error --- */
.form-error {
    background: rgba(255, 50, 50, 0.15);
    border: 1px solid rgba(255, 50, 50, 0.4);
    color: #ff6b6b;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.9em;
    margin-bottom: 15px;
    text-align: center;
    margin-bottom: 15px!important;
}

/* --- Form notice RGPD --- */
.form-notice {
    font-size: 0.75em;
    padding: 10px 0 0 0 !important;
    margin: 0;
    color: var(--color-white);
}

/* --- Text management form --- */
.text-field {
    margin-bottom: 15px;
}

.text-field label {
    display: block;
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 13px;
}
