/**
 * Order Form Plugin — style.css
 *
 * Contient :
 *   1. Classes Bulma extraites — uniquement celles utilisées par le formulaire
 *      (.field, .label, .control, .input, .textarea, .button, .columns, .column,
 *       .radio, .checkbox, .help, .notification + modificateurs is-*)
 *   2. Styles propres au plugin (prefixés .ofp-)
 *
 * Aucune dépendance externe. Aucun import Bulma complet.
 */

.ofp-form {
    color: #FFF;
}

.ofp-form a {
    text-decoration: underline;
    margin-right: 0.5rem;
}
.ofp-form a:hover {
    color: #FF0000;
}

/* =============================================================================
   BULMA — RESET DE BASE (boîte de modèle)
   ============================================================================= */

.ofp-wrapper *,
.ofp-wrapper *::before,
.ofp-wrapper *::after {
    box-sizing: border-box;
}

/* =============================================================================
   BULMA — COLONNES
   ============================================================================= */

.ofp-wrapper .columns {
    display: flex;
    flex-wrap: wrap;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    margin-top: -0.75rem;
}

.ofp-wrapper .columns:last-child {
    margin-bottom: -0.75rem;
}

.ofp-wrapper .columns:not(:last-child) {
    margin-bottom: calc(1.5rem - 0.75rem);
}

.ofp-wrapper .column {
    display: block;
    flex: 1 1 0;
    padding: 0.75rem;
    min-width: 0; /* évite le débordement */
}

/* =============================================================================
   BULMA — FIELD / LABEL / CONTROL
   ============================================================================= */

.ofp-wrapper .field:not(:last-child) {
    margin-bottom: 1rem;
}

.ofp-wrapper .field:not(:last-child) {
    margin-bottom: 1rem;
}

.ofp-wrapper .label {
    color: #FFF;
    display: block;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5em;
}

.ofp-wrapper .control {
    box-sizing: border-box;
    clear: both;
    font-size: 1rem;
    position: relative;
    text-align: inherit;
}

/* =============================================================================
   BULMA — INPUT & TEXTAREA
   ============================================================================= */

.ofp-wrapper .input,
.ofp-wrapper .textarea {
    appearance: none;
    background-color: #fff;
    border: 1px solid #dbdbdb;
    border-radius: 4px;
    box-shadow: inset 0 0.0625em 0.125em rgba(10, 10, 10, 0.05);
    color: #363636;
    display: block;
    font-size: 1rem;
    height: 2.5em;
    line-height: 1.5;
    max-width: 100%;
    padding: calc(0.5em - 1px) calc(0.75em - 1px);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    width: 100%;
}

.ofp-wrapper .input:focus,
.ofp-wrapper .textarea:focus {
    border-color: #c74848;
    box-shadow: 0 0 0 0.125em rgba(72, 95, 199, 0.25);
    outline: none;
}

.ofp-wrapper .input::placeholder,
.ofp-wrapper .textarea::placeholder {
    color: rgba(54, 54, 54, 0.35);
}

.ofp-wrapper .textarea {
    display: block;
    height: auto;
    max-height: 600px;
    min-height: 120px;
    resize: vertical;
    padding: calc(0.75em - 1px);
}

/* État erreur */
.ofp-wrapper .input.is-danger,
.ofp-wrapper .textarea.is-danger {
    border-color: #f14668;
    box-shadow: inset 0 0.0625em 0.125em rgba(10, 10, 10, 0.05);
}

.ofp-wrapper .input.is-danger:focus,
.ofp-wrapper .textarea.is-danger:focus {
    box-shadow: 0 0 0 0.125em rgba(241, 70, 104, 0.25);
}

/* =============================================================================
   BULMA — BUTTON
   ============================================================================= */

.ofp-wrapper .button {
    font-family: "Roboto", Sans-serif;
    appearance: none;
    align-items: center;
    border: 1px solid transparent;
    border-radius: 33px 33px 33px 33px;
    box-shadow: 0px 0px 0px -7px rgba(0, 0, 0, 0);
    cursor: pointer;
    display: inline-flex;
    font-size: 15px;
    font-weight: 500;
    height: auto;
    justify-content: center;
    line-height: 15px;
    padding: 21px 62px 21px 62px;
    position: relative;
    text-align: center;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out,
                box-shadow 0.15s ease-in-out, color 0.15s ease-in-out;
    user-select: none;
    vertical-align: top;
    white-space: nowrap;
    /* Couleurs par défaut (neutre) */
    background-color: #fff;
    border-color: #dbdbdb;
    color: #363636;
    text-transform: uppercase;
}

.ofp-wrapper .button:hover {
    border-color: #b5b5b5;
    color: #363636;
}

.ofp-wrapper .button:focus {
    outline: none;
    box-shadow: 0 0 0 0.125em rgba(72, 95, 199, 0.25);
}

.ofp-wrapper .button:active {
    border-color: #4a4a4a;
    color: #363636;
}

/* is-primary */
.ofp-wrapper .button.is-primary {
    border-color: #FF0000;
    background-color: transparent;
    color: #fff;
    border-radius: 9999px;
}

.ofp-wrapper .button.is-primary:hover {
    background-color: #eb0000;
    color: #fff;
}

.ofp-wrapper .button.is-primary:active {
    background-color: #e00000;
}

/* État chargement */
.ofp-wrapper .button.is-loading {
    color: transparent !important;
    pointer-events: none;
}

.ofp-wrapper .button.is-loading::after {
    animation: ofp-spin 500ms infinite linear;
    border: 2px solid #dbdbdb;
    border-radius: 50%;
    border-right-color: transparent;
    border-top-color: transparent;
    content: "";
    display: block;
    height: 1em;
    width: 1em;
    position: absolute;
    left: calc(50% - 0.5em);
    top: calc(50% - 0.5em);
}

.ofp-wrapper .button.is-primary.is-loading::after {
    border-color: transparent transparent rgba(255, 255, 255, 0.7) rgba(255, 255, 255, 0.7);
}

@keyframes ofp-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(359deg); }
}

/* =============================================================================
   BULMA — RADIO & CHECKBOX
   ============================================================================= */

.ofp-wrapper .radio,
.ofp-wrapper .checkbox {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    font-size: 1rem;
    line-height: 1.5;
    position: relative;
}

.ofp-wrapper .checkbox {
    display: inline-block !important;
}

.ofp-wrapper .radio + .radio {
    margin-left: 0.5em;
}

.ofp-wrapper .radio input[type="radio"],
.ofp-wrapper .checkbox input[type="checkbox"] {
    cursor: pointer;
    flex-shrink: 0;
}

.ofp-wrapper .checkbox {
    align-items: flex-start;
}

.ofp-wrapper .checkbox input[type="checkbox"] {
    margin-top: 0.25em;
}

/* =============================================================================
   BULMA — HELP (messages d'aide / erreur sous les champs)
   ============================================================================= */

.ofp-wrapper .help {
    display: block;
    font-size: 0.75rem;
    margin: 0.25rem 0 0 0;
}

.ofp-wrapper .help.is-danger {
    color: #f14668;
}

.ofp-wrapper .help.is-success {
    color: #48c78e;
}

/* =============================================================================
   BULMA — NOTIFICATION
   ============================================================================= */

.ofp-wrapper .notification {
    background-color: #f5f5f5;
    border-radius: 4px;
    padding: 1.25rem 1.5rem;
    position: relative;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Variantes de couleur */
.ofp-wrapper .notification.is-success        { background-color: #48c78e; color: #fff; }
.ofp-wrapper .notification.is-success.is-light { background-color: #effaf5; color: #257953; }

.ofp-wrapper .notification.is-danger         { background-color: #f14668; color: #fff; }
.ofp-wrapper .notification.is-danger.is-light  { background-color: #feecf0; color: #cc0f35; }

.ofp-wrapper .notification.is-info           { background-color: #878787; color: #fff; }
.ofp-wrapper .notification.is-info.is-light    { background-color: #eff5fb; color: #696969; }

/* =============================================================================
   PLUGIN — STYLES PROPRES (préfixe .ofp-)
   ============================================================================= */

/* Wrapper */
.ofp-wrapper {
    max-width: 680px;
    margin: 0 auto;
}

/* Honeypot */
.ofp-honeypot {
    display: none !important;
    visibility: hidden;
    position: absolute;
    left: -9999px;
}

/* Séparateurs de section */
.ofp-section-title {
    display: flex;
    align-items: center;
    margin: 2rem 0 1.25rem;
    gap: 0.75rem;
}

.ofp-section-title::before,
.ofp-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: #dbdbdb;
}

.ofp-section-title span {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
    white-space: nowrap;
}

/* Premier séparateur — pas de marge haute */
.ofp-form .ofp-section-title:first-of-type {
    margin-top: 0;
}

/* Notification globale */
#ofp-notification.is-hidden {
    display: none;
}

#ofp-notification {
    margin-bottom: 1.5rem;
}

/* Réserve de hauteur pour les erreurs (évite les sauts de layout) */
.ofp-error {
    min-height: 1em;
}

/* Bouton submit */
#ofp-submit {
    min-width: 200px;
}

/* Widget Altcha */
altcha-widget {
    display: block;
    max-width: 340px;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media screen and (max-width: 768px) {

    /* Colonnes empilées sur mobile */
    .ofp-wrapper .columns {
        display: block;
        margin: 0;
    }

    .ofp-wrapper .column {
        padding: 0;
        margin-bottom: 0;
    }

    /* Champs pleine largeur */
    .ofp-wrapper .input,
    .ofp-wrapper .textarea {
        width: 100%;
    }

    /* Bouton pleine largeur */
    #ofp-submit {
        width: 100%;
        min-width: unset;
    }

    /* Widget Altcha */

    .ofp-wrapper {
        padding: 0 0.5rem;
    }
}
