/* Rive Refund System — Frontend CSS */

/* ============================================================
   Fix doppio asterisco: sopprime il * testuale che alcuni
   temi WooCommerce aggiungono via CSS ::after sui label.
   Il solo <span class="required">*</span> resta visibile.
   ============================================================ */
.rrs-new-request label::after,
.rrs-request-detail label::after,
.rrs-requests-list label::after {
	display: none !important;
}

/* ============================================================
   Stile base campi — applicato a tutti i form del plugin
   (My Account: nuova richiesta, dettaglio, lista)
   ============================================================ */
.rrs-new-request .woocommerce-form-row,
.rrs-request-detail .woocommerce-form-row {
	margin-bottom: 1.1em;
}

.rrs-new-request label,
.rrs-request-detail label {
	font-weight: 600;
	display: block;
	margin-bottom: 5px;
}

.rrs-new-request input[type="text"],
.rrs-new-request input[type="number"],
.rrs-new-request input[type="email"],
.rrs-new-request select,
.rrs-new-request textarea,
.rrs-request-detail input[type="text"],
.rrs-request-detail select,
.rrs-request-detail textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid #d5d5d5;
	border-radius: 4px;
	font-size: 15px;
	line-height: 1.5;
	transition: border-color 0.15s;
}

.rrs-new-request input:focus,
.rrs-new-request select:focus,
.rrs-new-request textarea:focus,
.rrs-request-detail input:focus,
.rrs-request-detail select:focus,
.rrs-request-detail textarea:focus {
	border-color: #7f54b3;
	outline: none;
	box-shadow: 0 0 0 2px rgba(127, 84, 179, 0.15);
}

.rrs-new-request textarea,
.rrs-request-detail textarea {
	resize: vertical;
	min-height: 110px;
}

/* ============================================================
   Form nuova richiesta — full-width (rimosso max-width)
   ============================================================ */
.rrs-new-request {
	width: 100%;
}

/* Select motivo + campo condizionale "Altro" */
.rrs-reason-other-wrap {
	margin-top: -0.4em; /* riduce lo spazio tra select e textarea */
}

/* ============================================================
   Tabella prodotti
   ============================================================ */
.rrs-products-table {
	width: 100%;
	margin-bottom: 20px;
	border-collapse: collapse;
}

.rrs-products-table tr:nth-child(even) {
	background: #f9fafb;
}

.rrs-products-table td {
	padding: 8px 10px;
	border-bottom: 1px solid #e5e7eb;
	vertical-align: middle;
}

.rrs-non-refundable-note {
	color: #9ca3af;
	font-style: italic;
	font-size: 12px;
}

.rrs-qty-input {
	width: 60px !important;
	text-align: center;
}

.rrs-policy-note {
	color: #6b7280;
	font-size: 13px;
	font-style: italic;
	margin-top: 16px;
}

/* ============================================================
   Badge stato
   ============================================================ */
.rrs-status {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
}

.rrs-status--pending    { background: #dbeafe; color: #1d4ed8; }
.rrs-status--processing { background: #fef9c3; color: #854d0e; }
.rrs-status--on-hold    { background: #f3f4f6; color: #374151; }
.rrs-status--approved   { background: #dcfce7; color: #166534; }
.rrs-status--rejected   { background: #fee2e2; color: #991b1b; }
.rrs-status--refunded   { background: #e0f2fe; color: #075985; }
.rrs-status--completed  { background: #dcfce7; color: #166534; }
.rrs-status--cancelled  { background: #f3f4f6; color: #6b7280; }

/* ============================================================
   Barra stato dettaglio
   ============================================================ */
.rrs-request-status-bar {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 20px;
	padding: 12px 16px;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
}

.rrs-request-date {
	color: #6b7280;
	font-size: 13px;
	margin-left: auto;
}

/* ============================================================
   Messaggi / chat
   ============================================================ */
.rrs-messages-section {
	margin-top: 30px;
}

.rrs-messages-list {
	margin-bottom: 20px;
}

.rrs-message {
	padding: 14px 16px;
	margin-bottom: 12px;
	border-radius: 8px;
}

.rrs-message--user  { background: #f0fdf4; border: 1px solid #bbf7d0; }
.rrs-message--admin { background: #eff6ff; border: 1px solid #bfdbfe; }

.rrs-message-header {
	display: flex;
	justify-content: space-between;
	margin-bottom: 6px;
	font-size: 13px;
}

.rrs-message-header time { color: #6b7280; }

.rrs-message-body { line-height: 1.6; }

.rrs-message-attachment {
	margin-top: 8px;
	font-size: 13px;
}

.rrs-send-message-form {
	background: #f9fafb;
	padding: 16px;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
}

.rrs-send-message-form h5 { margin: 0 0 10px; }

.rrs-send-message-form textarea {
	width: 100%;
	box-sizing: border-box;
}

/* ============================================================
   Coupon notice
   ============================================================ */
.rrs-coupon-notice {
	background: #fefce8;
	border-color: #fde047;
	margin: 20px 0;
}

/* ============================================================
   Risultati AJAX
   ============================================================ */
.rrs-form-result {
	padding: 12px 16px;
	border-radius: 6px;
	margin: 10px 0;
}

.rrs-form-result--success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.rrs-form-result--error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* ============================================================
   Bottone reso nell'ordine (My Account → ordine singolo)
   ============================================================ */
.rrs-order-refund-wrap {
	margin-top: 20px;
}

/* ============================================================
   Bottoni azione generici
   ============================================================ */
.rrs-btn-new {
	margin-bottom: 20px;
}

/* ============================================================
   Spinner / loading stato
   ============================================================ */
.rrs-loading::after {
	content: ' ⏳';
}

#rrs-products-loading .rrs-loading-text {
	color: #6b7280;
	font-style: italic;
	padding: 10px 0;
}

#rrs-products-loading .rrs-loading-text::before {
	content: '⏳ ';
}

/* ============================================================
   Alert nessun ordine idoneo
   ============================================================ */
.rrs-no-eligible-notice {
	margin-bottom: 1.5em;
}
