@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

/* ===================================================== */
/* VARIABLES & RESET */
/* ===================================================== */

:root {
    --papaya:       #E9954A;
    --papaya-dark:  #c9742f;
    --papaya-light: #fdf0e4;
    --papaya-soft:  #fdf7f2;

    --text-main:    #1a1a2e;
    --text-muted:   #6b7280;
    --text-light:   #9ca3af;

    --border:       #e5e7eb;

    --bg-page:      #F7F3EE;
    --bg-form:      #ffffff;

    --radius-sm:    8px;
    --radius-md:    14px;
    --radius-lg:    20px;

    --shadow-card:  0 2px 20px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.04);
    --shadow-hover: 0 8px 30px rgba(233,149,74,0.18);

    --transition:   0.22s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    color: var(--text-main);
    margin: 0;
    padding: 0;
    background: var(--bg-page);
    font-family: 'DM Sans', 'Open Sans', Verdana, sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--papaya);
    transition: color var(--transition);
}
a:hover { color: var(--papaya-dark); }

/* ===================================================== */
/* FORMULAIRE */
/* ===================================================== */

form {
    background: var(--bg-form);
    box-shadow: var(--shadow-card);
    border-radius: var(--radius-lg);
    padding: 2rem 2.5rem 2.5rem;
    margin: 2rem auto;

    width: 50%;
    min-width: 680px;
    max-width: 740px;

    display: flex;
    flex-direction: column;
}

/* ===================================================== */
/* TITRES */
/* ===================================================== */

h1 {
    font-family: 'Sora', sans-serif;
    font-size: 1.45em;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
    margin: 0 0 1.6rem;
    padding-bottom: 1rem;
    border-bottom: 1.5px solid var(--border);
    order: 0;
}

h1 i {
    color: var(--papaya);
    font-style: normal;
}

/* ===================================================== */
/* PARAGRAPHES / GROUPES */
/* ===================================================== */

form p {
    margin-bottom: 1.4rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 0;
    order: 1;
}

form p:last-child { margin-bottom: 0; }

/* ===================================================== */
/* LABELS */
/* ===================================================== */

label {
    cursor: pointer;
    display: inline-block;
    vertical-align: middle;
    width: 32%;
    font-weight: 600;
    font-size: 0.88em;
    color: var(--text-main);
    letter-spacing: 0.01em;
}

.label_options   { width: 32%; vertical-align: middle; }
#label_visibility { width: 32%; }

.label_options_select {
    width: 60%;
    vertical-align: top;
    font-size: 0.88em;
}

/* ===================================================== */
/* INPUTS & SELECT */
/* ===================================================== */

input[type=text],
input[type=password],
input[type=date],
input[type=file],
input[type=email],
select {
    width: 65%;
    padding: 10px 14px;
    font-size: 0.9em;
    font-family: inherit;
    display: inline-block;
    vertical-align: middle;
    background: #fafafa;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    outline: none;
    appearance: none;
}

input[type=text]:focus,
input[type=password]:focus,
input[type=date]:focus,
input[type=email]:focus,
select:focus {
    border-color: var(--papaya);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(233,149,74,0.13);
}

input[type=text]:hover,
input[type=email]:hover,
select:hover {
    border-color: #d1d5db;
}

textarea {
    width: 65%;
    padding: 10px 14px;
    font-size: 0.9em;
    font-family: inherit;
    display: inline-block;
    vertical-align: middle;
    background: #fafafa;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    outline: none;
    resize: vertical;
    min-height: 90px;
    line-height: 1.55;
}

textarea:focus {
    border-color: var(--papaya);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(233,149,74,0.13);
}

textarea:hover { border-color: #d1d5db; }

#thanks { width: 65%; }

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%239ca3af'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
    padding-right: 36px;
    cursor: pointer;
}

/* ===================================================== */
/* SELECT BOX */
/* ===================================================== */

.select-box { align-items: center; }
.select-box label { width: 32%; }

.select-box .select {
    width: auto;
    min-width: 200px;
    flex: 1 1 auto;
    max-width: 350px;
}

/* ===================================================== */
/* TINYMCE — pleine largeur */
/* ===================================================== */

.tox-tinymce {
    width: 100% !important;
    margin-left: 0 !important;
    border-radius: var(--radius-sm) !important;
    border-color: var(--border) !important;
}

form p:has(.tox-tinymce) {
    flex-direction: column;
    align-items: flex-start;
}

form p:has(.tox-tinymce) > label {
    width: 100%;
    margin-bottom: 6px;
}

/* ===================================================== */
/* HOVER / FOCUS LABEL */
/* ===================================================== */

form p:hover > label { color: var(--papaya); }
form p:focus-within > label { color: var(--papaya); }

/* ===================================================== */
/* BOUTONS */
/* ===================================================== */

input[type=submit],
input[type=button],
button {
    cursor: pointer;
    font-family: 'Sora', sans-serif;
    font-weight: 600;
    font-size: 0.9em;
    letter-spacing: 0.02em;
    border-radius: 50px;
    border: none;
    padding: 11px 28px;
    transition: all var(--transition);
    outline: none;
}

#envoyer {
    background: linear-gradient(135deg, var(--papaya) 0%, #f5a85a 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(233,149,74,0.35);
}

#envoyer:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(233,149,74,0.45);
    background: linear-gradient(135deg, var(--papaya-dark) 0%, var(--papaya) 100%);
}

#envoyer:active { transform: translateY(0); }

/* ===================================================== */
/* ZONE BOUTONS #push */
/* ===================================================== */

#push {
    order: 4;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 1.8rem;
    padding-top: 1.4rem;
    border-top: 1px solid var(--border);
}

/* ===================================================== */
/* ORDRE FLEX FORM */
/* ===================================================== */

form > h1            { order: 0; }
form > #cadre_drop   { order: 1; }
form > p             { order: 1; }
form > span          { order: 1; }
form > #msg          { order: 1; }
form > #more         { order: 2; }
form > #more_options { order: 3; }
form > #push         { order: 4; }

/* ===================================================== */
/* ERREURS */
/* ===================================================== */

.error {
    color: #e53e3e;
    margin-top: 4px;
    display: block;
    width: 100%;
    margin-left: 32%;
    font-size: 0.8em;
    font-weight: 500;
}

.error_options {
    color: #e53e3e;
    margin-top: 4px;
    display: block;
    width: 100%;
    margin-left: 32%;
    font-size: 0.8em;
    font-weight: 500;
}

#msg {
    color: #e53e3e;
    font-size: 1em;
    font-weight: 600;
    margin-left: 32%;
}

/* ===================================================== */
/* DROPZONE / PREVIEW */
/* ===================================================== */

#cadre_drop {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 0;
    margin-bottom: 1.2rem;
    order: 1;
}

#cadre_drop label {
    width: 32%;
}

#dropfile {
    width: 65%;
    height: 100px;
    border: 2px dashed #d1d5db;
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    background: #fafafa;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    position: relative;
    overflow: hidden;
    padding: 0;
}

#dropfile:hover {
    border-color: var(--papaya);
    background-color: var(--papaya-light);
}

#depot {
    padding: 6px 12px;
    color: var(--text-light);
    font-size: 0.88em;
    pointer-events: none;
    text-align: center;
    width: 100%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#preview {
    border: 0 !important;
    outline: none;
    box-shadow: none !important;
    display: block;
    max-width: 100%;
    max-height: 96px;
    width: auto;
    height: auto;
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 0;
}

/* Input file caché */
#fichier { display: none; }

/* ===================================================== */
/* OPTIONS AVANCÉES */
/* ===================================================== */

#more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 2px;
    margin-bottom: 1.2rem;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition);
    text-decoration: none;
}

#more:hover { color: var(--papaya); }
#more img { vertical-align: middle; opacity: 0.55; }
#more span { vertical-align: middle; }

#more_options {
    overflow: hidden;
    background: #fff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 0 1.2rem;
    margin-bottom: 1.2rem;
}

#more_options p {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

#more_options p:last-child { border-bottom: none; }

/* ===================================================== */
/* CHECKBOX CUSTOM */
/* ===================================================== */

[type="checkbox"]:not(:checked),
[type="checkbox"]:checked {
    position: absolute;
    left: -9999px;
}

[type="checkbox"]:not(:checked) + label,
[type="checkbox"]:checked + label {
    position: relative;
    padding-left: 32px;
    cursor: pointer;
    width: auto;
}

[type="checkbox"]:not(:checked) + label:before,
[type="checkbox"]:checked + label:before {
    content: '';
    position: absolute;
    left: 0; top: 1px;
    width: 18px; height: 18px;
    border: 1.5px solid #d1d5db;
    background: #fff;
    border-radius: 5px;
    transition: all var(--transition);
}

[type="checkbox"]:checked + label:before {
    background: var(--papaya);
    border-color: var(--papaya);
}

[type="checkbox"]:not(:checked) + label:after,
[type="checkbox"]:checked + label:after {
    content: '✔';
    position: absolute;
    top: 1px; left: 3px;
    font-size: 12px;
    color: #fff;
    transition: all 0.18s;
}

[type="checkbox"]:not(:checked) + label:after {
    opacity: 0;
    transform: scale(0);
}

[type="checkbox"]:checked + label:after {
    opacity: 1;
    transform: scale(1);
}

/* ===================================================== */
/* DATEPICKER */
/* ===================================================== */

.ui-datepicker { z-index: 999999 !important; border-radius: var(--radius-md) !important; }

.ui-datepicker-header {
    background: var(--papaya) !important;
    border: none !important;
    color: #fff !important;
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
}

.ui-datepicker td span,
.ui-datepicker td a { border-radius: 6px !important; }

/* ===================================================== */
/* TOOLTIP */
/* ===================================================== */

.ui-tooltip-content {
    font-size: 13px;
    font-family: 'DM Sans', Verdana;
    text-align: justify;
}

.ui-widget {
    font-size: 1em;
    font-family: 'DM Sans', Verdana;
}

.tutotip a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
    margin-left: 6px;
    transition: background var(--transition);
}

.tutotip a::after { content: "?"; }
.tutotip a:hover { background: var(--papaya); color: #fff; }

.help { display: none; }

/* ===================================================== */
/* BLOC PÉDAGOGIQUE */
/* ===================================================== */

#bloc2 {
    margin: 2rem auto;
    max-width: 740px;
    text-align: justify;
    letter-spacing: 0.3px;
    background: #fff;
    padding: 2rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    line-height: 1.7;
    box-shadow: var(--shadow-card);
}

#bloc2 a { font-weight: 700; color: var(--papaya); }
#bloc2 a:hover { color: var(--papaya-dark); }

/* ===================================================== */
/* MOBILE */
/* ===================================================== */

@media screen and (max-width: 767px) {
    form {
        width: 96%;
        min-width: 0;
        border-radius: var(--radius-md);
        padding: 1.2rem 1.1rem 1.6rem;
        margin: 1rem auto;
    }

    h1 { font-size: 1.2em; }

    label,
    .label_options,
    .label_options_select,
    form > label {
        display: block;
        width: 100%;
        margin-bottom: 5px;
    }

    input[type=text],
    input[type=password],
    input[type=date],
    input[type=file],
    input[type=email],
    select,
    textarea,
    #thanks {
        width: 100%;
        font-size: 1em;
    }

    #dropfile { width: 100%; margin-left: 0; }

    #cadre_drop label { width: 100%; }

    .select-box .select { max-width: 100%; width: 100%; }

    .error, .error_options { margin-left: 0; }

    .tox-tinymce {
        margin-left: 0 !important;
        width: 100% !important;
    }

    #push {
        flex-direction: column;
        align-items: stretch;
    }

    #push input[type=submit],
    #push input[type=button],
    #push button {
        width: 100%;
    }

    #bloc2 {
        padding: 1.2rem 1rem;
    }
}

/* ===================================================== */
/* TABLETTE */
/* ===================================================== */

@media screen and (min-width: 768px) and (max-width: 980px) {
    form {
        width: 90%;
        min-width: 0;
    }
}