@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@400;600&family=DM+Sans:wght@400;500&display=swap');

/* ===============================
   Variables globales
   =============================== */
:root {
    --background-color: rgb(244, 244, 246);
    --background-text-color: #17171e;
    --surface-color: #fff;
    --surface-text-color: #17171e;
    --primary-color: #23d63e;
    --primary-color-hover: #159c29;
    --secondary-color: #003e45;
    --separator-color: rgb(244, 244, 246);
    --border-color: rgba(23, 23, 30, 0.1);
    --hover-color: rgba(23, 23, 30, 0.1);
    --disabled-color: #868690;
    --error-color: #ff0000;

    /* Fonts */
    --font-primary: 'DM Sans', system-ui, -apple-system, sans-serif;
    --font-heading: 'Kanit', system-ui, -apple-system, sans-serif;
}

/* ===============================
   Dark mode — préférence système
   =============================== */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #010413;
        --background-text-color: #fff;
        --surface-color: #1b1e2b;
        --surface-text-color: #fff;
        --separator-color: #010413;
        --border-color: rgba(255, 255, 255, 0.1);
        --hover-color: rgba(255, 255, 255, 0.1);
    }
}

/* ===============================
   Dark / Light override manuel
   =============================== */
[data-theme="dark"] {
    --background-color: #010413;
    --background-text-color: #fff;
    --surface-color: #1b1e2b;
    --surface-text-color: #fff;
    --separator-color: #010413;
    --border-color: rgba(255, 255, 255, 0.1);
    --hover-color: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] {
    --background-color: rgb(244, 244, 246);
    --background-text-color: #17171e;
    --surface-color: #fff;
    --surface-text-color: #17171e;
    --separator-color: rgb(244, 244, 246);
    --border-color: rgba(23, 23, 30, 0.1);
    --hover-color: rgba(23, 23, 30, 0.1);
}

/* ===============================
   Base global
   =============================== */
body {
    background-color: var(--background-color) !important;
    color: var(--background-text-color) !important;
    font-family: var(--font-primary) !important;
    font-weight: 400 !important;
    height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* ===============================
   Typography (charte respectée)
   =============================== */
h1, h2, h3 {
    font-family: var(--font-heading) !important;
    font-weight: 600 !important;
}

h4 {
    font-family: var(--font-heading) !important;
    font-weight: 400 !important;
}

h5, h6 {
    font-family: var(--font-primary) !important;
    font-weight: 500 !important;
}

/* ===============================
   Links
   =============================== */
a {
    text-decoration: none !important;
}

/* ===============================
   Layout elements
   =============================== */
nav,
.card {
    background-color: var(--surface-color) !important;
    color: var(--surface-text-color) !important;
}

main {
    flex: 1;
    overflow-y: auto;
}

/* ===============================
   Forms (important pour cohérence)
   =============================== */
input,
textarea,
select {
    font-family: var(--font-primary) !important;
    font-weight: 400 !important;
}

/* ===============================
   Modal
   =============================== */
.modal-content {
    background-color: var(--surface-color) !important;
    color: var(--surface-text-color) !important;
    text-align: center !important;
}

.modal-header,
.modal-body,
.modal-footer {
    justify-content: center !important;
}

/* Bouton fermeture theme-aware */
[data-theme="light"] .modal .btn-close { filter: invert(0) !important; }
[data-theme="dark"]  .modal .btn-close { filter: invert(1) !important; }

/* ===============================
   Buttons
   =============================== */
button,
.btn {
    font-family: var(--font-heading);
    font-weight: 400;
}

.btn {
    --bs-btn-padding-y: 0.625rem;
    --bs-btn-font-size: 0.9rem;
}

.btn.btn-validate {
    --bs-btn-bg: var(--primary-color);
    --bs-btn-border-color: var(--primary-color);
    --bs-btn-color: #fff;

    --bs-btn-hover-bg: var(--primary-color-hover);
    --bs-btn-hover-border-color: var(--primary-color-hover);

    --bs-btn-active-bg: var(--primary-color-hover);
    --bs-btn-active-border-color: var(--primary-color-hover);

    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: var(--primary-color-hover);
    --bs-btn-disabled-border-color: var(--primary-color-hover);
    --bs-btn-disabled-opacity: 0.65;
}

/* ===============================
   UI Elements
   =============================== */
.nav-icon {
    border: 0.09em solid var(--primary-color) !important;
    border-radius: 50% !important;
    height: clamp(1.5rem, 4vw, 2rem) !important;
    width: clamp(1.5rem, 4vw, 2rem) !important;
    padding: clamp(0.3em, 1vw, 0.4em) !important;
    object-fit: contain !important;
}

.select-coyote {
    border: 0.05em solid var(--primary-color) !important;
    border-radius: 5px !important;
    background-color: var(--surface-color) !important;
    color: var(--surface-text-color) !important;
}

[data-theme="dark"] .select-coyote {
    --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}