/*
 * Custom Registration Fields — front-end
 * Compatible avec WoodMart (utilise des sélecteurs spécifiques
 * pour ne pas être écrasés par les styles WooCommerce/WoodMart).
 */

/* ── Conteneur général ──────────────────────────────────────────── */
.crf-field {
    margin-bottom: 20px;
    clear: both;
}

/* ── Labels ─────────────────────────────────────────────────────── */
.crf-field > label:first-child {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    margin-bottom: 6px;
    color: inherit;
}

/* ── Inputs text, email, tel, number, url, date ─────────────────── */
.crf-field input[type="text"],
.crf-field input[type="email"],
.crf-field input[type="tel"],
.crf-field input[type="number"],
.crf-field input[type="url"],
.crf-field input[type="date"],
.crf-field select,
.crf-field textarea {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e6ea;
    border-radius: 4px;
    font-size: .9rem;
    font-family: inherit;
    color: inherit;
    background-color: #fff;
    box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
    appearance: none;
}

.crf-field input[type="text"]:focus,
.crf-field input[type="email"]:focus,
.crf-field input[type="tel"]:focus,
.crf-field input[type="number"]:focus,
.crf-field input[type="url"]:focus,
.crf-field input[type="date"]:focus,
.crf-field select:focus,
.crf-field textarea:focus {
    outline: none;
    border-color: var(--woodmart-primary-color, #2271b1);
    box-shadow: 0 0 0 3px rgba(34, 113, 177, .12);
}

/* ── Textarea ────────────────────────────────────────────────────── */
.crf-field textarea {
    resize: vertical;
    min-height: 90px;
}

/* ── Select ──────────────────────────────────────────────────────── */
.crf-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ── Radio ───────────────────────────────────────────────────────── */
.crf-field .crf-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    margin-bottom: 6px;
    cursor: pointer;
}

.crf-field .crf-radio input[type="radio"] {
    width: auto;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--woodmart-primary-color, #2271b1);
}

/* ── Checkbox ────────────────────────────────────────────────────── */
.crf-field .crf-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    cursor: pointer;
}

.crf-field .crf-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--woodmart-primary-color, #2271b1);
}

/* ── File ────────────────────────────────────────────────────────── */
.crf-field input[type="file"] {
    display: block;
    width: 100%;
    font-size: .88rem;
    color: inherit;
    padding: 8px 0;
}

/* ── Badges obligatoire / facultatif ─────────────────────────────── */
.crf-required {
    color: #d63638;
    margin-left: 2px;
    font-style: normal;
}

.crf-optional {
    color: #888;
    font-size: .78rem;
    font-style: italic;
    margin-left: 5px;
    font-weight: 400;
}

/* ── WoodMart checkout wrapper ───────────────────────────────────── */
.crf-checkout-fields {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e6ea;
}

/* ── Compatibilité WoodMart dark mode ────────────────────────────── */
.woodmart-dark .crf-field input[type="text"],
.woodmart-dark .crf-field input[type="email"],
.woodmart-dark .crf-field input[type="tel"],
.woodmart-dark .crf-field input[type="number"],
.woodmart-dark .crf-field input[type="url"],
.woodmart-dark .crf-field input[type="date"],
.woodmart-dark .crf-field select,
.woodmart-dark .crf-field textarea {
    background-color: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.15);
    color: #fff;
}
