/**
 * PLM Reso — Stili frontend
 * Compatibile con il tema Aenyo di palmea.it
 * Prefisso: .plm-reso-
 */

/* ─── Wrapper ──────────────────────────────────────────────────────────────── */

.plm-reso-wrap {
    max-width: 680px;
    margin: 40px auto;
    padding: 0 16px;
    font-family: inherit;
}

/* ─── Header ───────────────────────────────────────────────────────────────── */

.plm-reso-header {
    margin-bottom: 32px;
}

.plm-reso-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px;
}

.plm-reso-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* ─── Step indicator ───────────────────────────────────────────────────────── */

.plm-reso-steps {
    display: flex;
    align-items: center;
    margin-bottom: 32px;
    gap: 0;
}

.plm-reso-step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.plm-reso-step__num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #888;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.plm-reso-step__label {
    font-size: 13px;
    color: #888;
    font-weight: 500;
}

.plm-reso-step--active .plm-reso-step__num {
    background: #2e7d32;
    color: #fff;
}

.plm-reso-step--active .plm-reso-step__label {
    color: #2e7d32;
    font-weight: 700;
}

.plm-reso-step--done .plm-reso-step__num {
    background: #c8e6c9;
    color: #2e7d32;
}

.plm-reso-step--done .plm-reso-step__label {
    color: #2e7d32;
}

.plm-reso-step-divider {
    flex: 1;
    height: 2px;
    background: #e0e0e0;
    margin: 0 12px;
}

.plm-reso-step-divider--done {
    background: #c8e6c9;
}

/* ─── Messaggi errore ─────────────────────────────────────────────────────── */

.plm-reso-errori {
    background: #fdecea;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #d32f2f;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 24px;
}

.plm-reso-errori ul {
    margin: 0;
    padding: 0 0 0 18px;
}

.plm-reso-errori li {
    font-size: 13px;
    color: #c62828;
    margin-bottom: 4px;
}

/* ─── Form ─────────────────────────────────────────────────────────────────── */

.plm-reso-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.plm-reso-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.plm-reso-field label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.plm-reso-field input[type="text"],
.plm-reso-field input[type="email"],
.plm-reso-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    background: #fff;
    box-sizing: border-box;
    transition: border-color .2s;
}

.plm-reso-field input:focus,
.plm-reso-field textarea:focus {
    border-color: #2e7d32;
    outline: none;
    box-shadow: 0 0 0 3px rgba(46,125,50,.12);
}

.plm-reso-field textarea {
    resize: vertical;
    min-height: 100px;
}

.plm-reso-field-desc {
    font-size: 12px;
    color: #888;
    margin: 0;
}

/* ─── Lista prodotti ──────────────────────────────────────────────────────── */

.plm-reso-prodotti-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 12px 16px;
    background: #fafafa;
}

.plm-reso-prodotto-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.plm-reso-prodotto-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: #2e7d32;
}

/* ─── Checkbox dichiarazione ──────────────────────────────────────────────── */

.plm-reso-field--checkbox {
    background: #f9fbe7;
    border: 1px solid #dce775;
    border-radius: 4px;
    padding: 14px 16px;
}

.plm-reso-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    font-weight: 600 !important;
}

.plm-reso-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: #2e7d32;
}

.plm-reso-nota-legale {
    color: #777 !important;
    margin-top: 8px !important;
    padding-left: 28px;
}

/* ─── Campo obbligatorio ──────────────────────────────────────────────────── */

.plm-reso-required {
    color: #d32f2f;
    margin-left: 2px;
}

.plm-reso-required-note {
    font-size: 12px;
    color: #888;
    margin: 0;
}

/* ─── Azioni (bottoni) ────────────────────────────────────────────────────── */

.plm-reso-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.plm-reso-btn-primary,
.plm-reso-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, opacity .2s;
    border: none;
    line-height: 1.2;
}

.plm-reso-btn-primary {
    background: #2e7d32;
    color: #fff;
}

.plm-reso-btn-primary:hover {
    background: #1b5e20;
    color: #fff;
}

.plm-reso-btn-primary:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.plm-reso-btn-secondary {
    background: transparent;
    color: #555;
    border: 1px solid #ccc;
}

.plm-reso-btn-secondary:hover {
    background: #f5f5f5;
    color: #333;
}

/* Pulsante conferma: colore più deciso */
.plm-reso-btn-confirm {
    background: #c62828;
}

.plm-reso-btn-confirm:hover {
    background: #b71c1c;
    color: #fff;
}

/* ─── Pulsante in lista ordini (area account) ─────────────────────────────── */

.woocommerce-orders-table .plm-reso-btn,
.woocommerce .plm-reso-btn {
    display: inline-block;
    padding: 6px 14px;
    background: #2e7d32;
    color: #fff !important;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s;
}

.woocommerce-orders-table .plm-reso-btn:hover,
.woocommerce .plm-reso-btn:hover {
    background: #1b5e20;
}

/* ─── Riepilogo step 2 ────────────────────────────────────────────────────── */

.plm-reso-riepilogo {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 24px;
    margin-bottom: 24px;
}

.plm-reso-riepilogo h3 {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin: 0 0 16px;
}

.plm-reso-riepilogo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.plm-reso-riepilogo-table th,
.plm-reso-riepilogo-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.plm-reso-riepilogo-table th {
    font-weight: 600;
    color: #555;
    width: 130px;
}

.plm-reso-riepilogo-table td {
    color: #333;
}

.plm-reso-prodotti-riepilogo {
    margin: 0;
    padding-left: 18px;
}

.plm-reso-prodotti-riepilogo li {
    margin-bottom: 4px;
}

/* ─── Dichiarazione ufficiale ─────────────────────────────────────────────── */

.plm-reso-dichiarazione-testo {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.plm-reso-dichiarazione-label {
    font-size: 12px;
    color: #888;
    margin: 0 0 8px;
    font-style: italic;
}

.plm-reso-dichiarazione-quote {
    background: #fff;
    border-left: 4px solid #2e7d32;
    margin: 0 0 8px;
    padding: 14px 18px;
    font-size: 13px;
    color: #444;
    line-height: 1.6;
    border-radius: 0 4px 4px 0;
    text-align: left;
}

.plm-reso-timestamp-nota {
    font-size: 11px;
    color: #aaa;
    font-style: italic;
    margin: 0;
}

/* ─── Avviso ───────────────────────────────────────────────────────────────── */

.plm-reso-avviso {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-left: 4px solid #f9a825;
    border-radius: 4px;
    padding: 12px 16px;
    font-size: 13px;
    color: #5d4037;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* ─── Lookup ───────────────────────────────────────────────────────────────── */

.plm-reso-wrap--lookup {
    max-width: 520px;
}

.plm-reso-separator {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 28px 0;
    color: #aaa;
    font-size: 13px;
}

.plm-reso-separator::before,
.plm-reso-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.plm-reso-login-prompt {
    text-align: center;
    margin-bottom: 28px;
}

.plm-reso-login-prompt p {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.plm-reso-info-legale {
    background: #f5f5f5;
    border-radius: 4px;
    padding: 16px 20px;
    margin-top: 32px;
}

.plm-reso-info-legale h3 {
    font-size: 13px;
    font-weight: 700;
    color: #555;
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.plm-reso-info-legale ul {
    margin: 0;
    padding-left: 18px;
}

.plm-reso-info-legale li {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

/* ─── Successo ─────────────────────────────────────────────────────────────── */

.plm-reso-successo {
    text-align: center;
    padding: 48px 24px;
}

.plm-reso-icon-ok {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 32px;
    margin: 0 auto 24px;
}

.plm-reso-successo h2 {
    font-size: 24px;
    font-weight: 700;
    color: #2e7d32;
    margin: 0 0 16px;
}

.plm-reso-successo p {
    font-size: 15px;
    color: #555;
    margin: 0 0 12px;
    line-height: 1.6;
}

/* ─── Errore ───────────────────────────────────────────────────────────────── */

.plm-reso-errore {
    text-align: center;
    padding: 48px 24px;
}

.plm-reso-errore h2 {
    font-size: 22px;
    font-weight: 700;
    color: #c62828;
    margin: 0 0 16px;
}

.plm-reso-errore p {
    font-size: 14px;
    color: #555;
    margin: 0 0 12px;
}

/* ─── Email block (inline in lista ordini) ────────────────────────────────── */

.plm-reso-email-block {
    margin: 24px 0;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #f9f9f9;
}

/* ─── Info CGV ─────────────────────────────────────────────────────────────── */

.plm-reso-cgv-info {
    font-size: 14px;
    color: #555;
    margin: 8px 0;
}

/* ─── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .plm-reso-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .plm-reso-btn-primary,
    .plm-reso-btn-secondary {
        width: 100%;
        text-align: center;
    }

    .plm-reso-riepilogo-table th {
        width: 100px;
    }
}
