:root {
    --bg-color: #111827;
    --bg-secondary: #172238;

    --card-bg: #ffffff;

    --primary: #6875e8;
    --primary-dark: #4f5fd5;
    --primary-soft: #eef0ff;

    --text: #29313d;
    --text-muted: #697586;

    --border: #d9dee7;
    --border-focus: #6875e8;

    --section-bg: #f7f8fb;
    --section-border: #e1e5ec;

    --info-bg: #f5f8fc;
    --info-border: #c9d5e5;
}


/* =========================
   BASE
   ========================= */

* {
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;

    background:
        radial-gradient(
            circle at 50% 0%,
            #263653 0%,
            #172238 38%,
            #111827 75%
        );

    color: var(--text);

    margin: 0;
    padding: 30px 20px;

    display: flex;
    justify-content: center;
    align-items: center;

    min-height: 100vh;
}

/* =========================
   PAGE
   ========================= */

.page-wrapper {
    width: 100%;
    max-width: 540px;
}


/* =========================
   TITRE DE PAGE
   ========================= */

.page-title {
    text-align: center;

    color: #34cc34;
    font-weight: 700;
    margin-bottom: 25px;
    letter-spacing: -0.02em;
    font-size: clamp(1.4rem, 3vw, 2.1rem);
    line-height: 1.15;
}


/* =========================
   CONTENEUR
   ========================= */

.container {
    background: var(--card-bg);

    padding: 34px;
    border-radius: 16px;

    width: 100%;

    border: 1px solid rgba(255, 255, 255, 0.08);

    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.35),
        0 8px 20px rgba(0, 0, 0, 0.18);
}


/* =========================
   TITRE
   ========================= */

h1 {
    text-align: center;

    font-size: 1.5rem;
    font-weight: 700;

    margin: 0 0 25px;

    color: #26364a;

    letter-spacing: -0.02em;
}


/* =========================
   APERÇU
   ========================= */

.preview-box {
    width: 100%;
    height: 105px;

    border-radius: 10px;

    margin-bottom: 25px;

    border: 1px solid #d5dbe4;

    transition:
        background-color 0.3s ease,
        box-shadow 0.3s ease;

    box-shadow:
        inset 0 2px 5px rgba(0, 0, 0, 0.08),
        0 2px 5px rgba(0, 0, 0, 0.04);
}


/* =========================
   SECTIONS
   ========================= */

.section {
    border: 1px solid var(--section-border);

    padding: 17px;

    border-radius: 10px;

    margin-bottom: 20px;

    background: var(--section-bg);
}

.section-title {
    font-weight: 700;

    margin: 0 0 16px;

    font-size: 1rem;

    color: var(--primary-dark);
}


/* =========================
   CHAMPS COMMUNS
   ========================= */

input[type="number"],
select {
    min-width: 0;

    padding: 9px 10px;

    background: #ffffff;

    border: 1px solid #cbd5e1;

    border-radius: 7px;

    color: var(--text);

    font-family: inherit;
    font-size: 0.94rem;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

input[type="number"]:hover,
select:hover {
    border-color: #aeb8c7;
}

input[type="number"]:focus,
select:focus {
    border-color: var(--border-focus);

    box-shadow:
        0 0 0 3px rgba(104, 117, 232, 0.12);
}


/* =========================
   LABELS
   ========================= */

.rgb-values label,
.munsell-hue label,
.munsell-values label {
    font-size: 0.82rem;
    font-weight: 600;

    color: #526071;

    white-space: nowrap;
}


/* =========================
   VALEURS RVB
   ========================= */

.rgb-values {
    display: grid;

    grid-template-columns:
        auto minmax(0, 1fr)
        auto minmax(0, 1fr)
        auto minmax(0, 1fr);

    gap: 9px;

    align-items: center;

    margin-bottom: 11px;
}


/* =========================
   MUNSELL — TEINTE
   ========================= */

.munsell-hue {
    display: grid;

    grid-template-columns:
        70px minmax(0, 1fr) minmax(0, 1.8fr);

    gap: 9px;

    align-items: center;

    margin-bottom: 11px;
}


/* =========================
   MUNSELL — VALEURS
   ========================= */

.munsell-values {
    display: grid;

    grid-template-columns:
        70px minmax(0, 1fr)
        62px minmax(0, 1fr);

    gap: 9px;

    align-items: center;

    margin-bottom: 13px;
}


/* =========================
   BOUTONS
   ========================= */

.btn {
    width: 100%;

    padding: 11px 13px;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--primary-dark)
        );

    color: #ffffff;

    border: none;
    border-radius: 7px;

    font-family: inherit;

    font-size: 0.92rem;
    font-weight: 700;

    cursor: pointer;

    box-shadow:
        0 5px 12px rgba(79, 95, 213, 0.20);

    transition:
        transform 0.15s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

.btn:hover {
    filter: brightness(1.04);

    transform: translateY(-1px);

    box-shadow:
        0 7px 16px rgba(79, 95, 213, 0.26);
}

.btn:active {
    transform: translateY(0);

    box-shadow:
        0 3px 8px rgba(79, 95, 213, 0.18);
}


/* =========================
   NOTE
   ========================= */

.info-note {
    font-size: 0.8rem;

    color: var(--text-muted);

    text-align: center;

    margin-top: 16px;

    line-height: 1.5;
}


/* =========================
   MOBILE — < 500px
   ========================= */

@media (max-width: 500px) {

    body {
        padding: 16px 10px;

        align-items: flex-start;
    }

    .container {
        padding: 23px 17px;

        border-radius: 13px;

        margin-top: 8px;
    }

    h1 {
        font-size: 1.3rem;

        margin-bottom: 20px;
    }

    .preview-box {
        height: 85px;

        margin-bottom: 20px;
    }

    .section {
        padding: 14px;

        margin-bottom: 16px;
    }

    .section-title {
        font-size: 0.95rem;

        margin-bottom: 14px;
    }


    /* -------------------------
       RVB
       ------------------------- */

    .rgb-values {
        grid-template-columns:
            auto minmax(0, 1fr)
            auto minmax(0, 1fr)
            auto minmax(0, 1fr);

        gap: 6px;
    }

    .rgb-values label {
        font-size: 0.76rem;
    }


    /* -------------------------
       Teinte Munsell
       ------------------------- */

    .munsell-hue {
        grid-template-columns:
            60px minmax(0, 0.7fr) minmax(0, 1.3fr);

        gap: 7px;
    }


    /* -------------------------
       Clarté + saturation
       ------------------------- */

    .munsell-values {
        grid-template-columns:
            60px minmax(0, 1fr)
            55px minmax(0, 1fr);

        gap: 7px;
    }


    /* -------------------------
       Champs
       ------------------------- */

    input[type="number"],
    select {
        padding: 9px 7px;

        font-size: 0.88rem;
    }

    .btn {
        padding: 11px 9px;

        font-size: 0.87rem;
    }

    .info-note {
        font-size: 0.77rem;
    }
}
