/* ===================================================
   Diritto di Recesso per WooCommerce — Frontend CSS
   =================================================== */

/* --- Pulsante nella lista ordini --- */
a.wdr-recesso-btn {
    background-color: #c62828 !important;
    color: #fff !important;
    border-color: #b71c1c !important;
    font-size: 12px !important;
    padding: 5px 11px !important;
    border-radius: 3px !important;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none !important;
    display: inline-block;
}
a.wdr-recesso-btn:hover,
a.wdr-recesso-btn:focus {
    background-color: #b71c1c !important;
    border-color: #a31515 !important;
    color: #fff !important;
}
a.wdr-recesso-sent {
    color: #2e7d32 !important;
    font-weight: 600;
    font-size: 12px !important;
    pointer-events: none;
    text-decoration: none !important;
}

/* --- Overlay modale --- */
.wdr-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

/* --- Contenitore modale --- */
.wdr-modal {
    background: #fff;
    border-radius: 8px;
    padding: 36px 40px;
    max-width: 580px;
    width: 100%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
    box-sizing: border-box;
}

.wdr-modal h2 {
    margin: 0 0 8px;
    font-size: 22px;
    color: #1a1a1a;
    padding-right: 32px;
}

.wdr-modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
    color: #888;
    line-height: 1;
    padding: 0;
    transition: color 0.15s;
}
.wdr-modal-close:hover { color: #333; }

/* --- Nota legale intro --- */
.wdr-subtitle {
    font-size: 13px;
    color: #555;
    border-left: 3px solid #2271b1;
    padding: 8px 12px;
    margin: 0 0 22px;
    background: #f0f4ff;
    border-radius: 0 4px 4px 0;
    line-height: 1.5;
}

/* --- Info ordine --- */
.wdr-order-info {
    background: #f5f5f5;
    padding: 9px 14px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* --- Fieldset motivi --- */
.wdr-modal fieldset {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 14px 16px 10px;
    margin: 0 0 18px;
}
.wdr-modal fieldset legend {
    font-weight: 600;
    font-size: 13px;
    color: #444;
    padding: 0 6px;
}
.wdr-modal fieldset label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    cursor: pointer;
    color: #333;
}
.wdr-modal fieldset label:last-child { margin-bottom: 0; }
.wdr-modal fieldset input[type="radio"] { flex-shrink: 0; }

/* --- Campo note --- */
.wdr-field {
    margin-bottom: 18px;
}
.wdr-field label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #444;
    margin-bottom: 6px;
}
.wdr-field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    color: #333;
    transition: border-color 0.15s;
}
.wdr-field textarea:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
}

/* --- Checkbox conferma --- */
.wdr-checkbox-field label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: normal !important;
    font-size: 14px;
    cursor: pointer;
    color: #333;
}
.wdr-checkbox-field input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

/* --- Messaggi errore/successo inline --- */
.wdr-msg {
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 4px;
}
.wdr-msg.wdr-error {
    background: #fde8e8;
    color: #b71c1c;
    border: 1px solid #f5c6c6;
}
.wdr-msg.wdr-info {
    background: #e3f2fd;
    color: #0d47a1;
    border: 1px solid #bbdefb;
}

/* --- Pulsanti azioni --- */
.wdr-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 22px;
    flex-wrap: wrap;
}
.wdr-submit-btn {
    background: #c62828 !important;
    border-color: #b71c1c !important;
    color: #fff !important;
}
.wdr-submit-btn:hover,
.wdr-submit-btn:focus {
    background: #b71c1c !important;
    border-color: #a31515 !important;
}
.wdr-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- Nota legale footer form --- */
.wdr-legal-note {
    font-size: 11px;
    color: #aaa;
    margin-top: 18px;
    text-align: center;
    line-height: 1.5;
}

/* --- Schermata successo --- */
.wdr-success-msg {
    text-align: center;
    padding: 24px 16px;
}
.wdr-success-icon {
    font-size: 64px;
    color: #2e7d32;
    line-height: 1;
    margin-bottom: 16px;
}
.wdr-success-msg h3 {
    font-size: 22px;
    color: #1a1a1a;
    margin: 0 0 12px;
}
.wdr-success-msg p {
    color: #555;
    font-size: 15px;
    line-height: 1.6;
    max-width: 400px;
    margin: 0 auto 24px;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .wdr-modal {
        padding: 24px 20px;
    }
    .wdr-actions {
        flex-direction: column;
    }
    .wdr-actions .button {
        width: 100%;
        text-align: center;
    }
}
