/**
 * AIFORYA Smart Forms — styles publics du formulaire.
 * Neutre et moderne, s'intègre à la plupart des thèmes WordPress.
 */

.aiforya-rfq-form {
	--aiforya-rfq-radius: 10px;
	--aiforya-rfq-border: #d8dce3;
	--aiforya-rfq-border-focus: #2bd4d9;
	--aiforya-rfq-text: #1f2430;
	--aiforya-rfq-muted: #6b7280;
	--aiforya-rfq-error: #d9364c;
	--aiforya-rfq-bg: #ffffff;
	max-width: 640px;
	margin: 0 auto;
	color: var(--aiforya-rfq-text);
	font-size: 16px;
	line-height: 1.5;
	box-sizing: border-box;
}

.aiforya-rfq-form *,
.aiforya-rfq-form *::before,
.aiforya-rfq-form *::after {
	box-sizing: border-box;
}

.aiforya-rfq-fields {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

/* Champ */
.aiforya-rfq-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.aiforya-rfq-field.is-hidden,
.aiforya-rfq-field[hidden] {
	display: none;
}

.aiforya-rfq-label {
	font-weight: 600;
	font-size: 0.95em;
	color: var(--aiforya-rfq-text);
}

.aiforya-rfq-req {
	color: var(--aiforya-rfq-error);
	font-weight: 700;
}

/* Contrôles de saisie */
.aiforya-rfq-field input[type="text"],
.aiforya-rfq-field input[type="email"],
.aiforya-rfq-field input[type="tel"],
.aiforya-rfq-field input[type="number"],
.aiforya-rfq-field input[type="date"],
.aiforya-rfq-field input[type="file"],
.aiforya-rfq-field textarea,
.aiforya-rfq-field select {
	width: 100%;
	padding: 11px 13px;
	font: inherit;
	color: var(--aiforya-rfq-text);
	background: var(--aiforya-rfq-bg);
	border: 1px solid var(--aiforya-rfq-border);
	border-radius: var(--aiforya-rfq-radius);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.aiforya-rfq-field input[type="file"] {
	padding: 9px 12px;
	background: #f7f8fa;
}

.aiforya-rfq-field textarea {
	min-height: 110px;
	resize: vertical;
}

.aiforya-rfq-field input:focus,
.aiforya-rfq-field textarea:focus,
.aiforya-rfq-field select:focus {
	outline: none;
	border-color: var(--aiforya-rfq-border-focus);
	box-shadow: 0 0 0 3px rgba( 43, 212, 217, 0.18 );
}

.aiforya-rfq-field input::placeholder,
.aiforya-rfq-field textarea::placeholder {
	color: var(--aiforya-rfq-muted);
	opacity: 1;
}

/* Cases / boutons radio */
.aiforya-rfq-choices {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.aiforya-rfq-choice {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 400;
	cursor: pointer;
}

.aiforya-rfq-choice input {
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--aiforya-rfq-border-focus);
	cursor: pointer;
}

/* Étoiles (rating) */
.aiforya-rfq-rating {
	display: inline-flex;
	gap: 4px;
	align-items: center;
}

.aiforya-rfq-star {
	background: none;
	border: none;
	padding: 2px;
	margin: 0;
	font-size: 1.7em;
	line-height: 1;
	color: #d0d5dd;
	cursor: pointer;
	transition: color 0.12s ease, transform 0.12s ease;
}

.aiforya-rfq-star:hover {
	transform: scale( 1.12 );
}

.aiforya-rfq-star.is-active {
	color: #f5b301;
}

.aiforya-rfq-star:focus-visible {
	outline: 2px solid var(--aiforya-rfq-border-focus);
	outline-offset: 2px;
	border-radius: 4px;
}

/* Message de validation par champ */
.aiforya-rfq-field-msg {
	font-size: 0.85em;
	color: var(--aiforya-rfq-muted);
	min-height: 0;
}

.aiforya-rfq-field-msg.is-error {
	color: var(--aiforya-rfq-error);
}

.aiforya-rfq-field-msg.is-error::before {
	content: "\26A0";
	margin-right: 5px;
}

/* Bouton d'extraction de document */
.aiforya-rfq-extract {
	align-self: flex-start;
	margin-top: 6px;
	padding: 8px 14px;
	font: inherit;
	font-size: 0.9em;
	font-weight: 600;
	color: var(--aiforya-rfq-text);
	background: #f0f2f5;
	border: 1px solid var(--aiforya-rfq-border);
	border-radius: var(--aiforya-rfq-radius);
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.aiforya-rfq-extract:hover {
	background: #e6e9ee;
	border-color: #c2c8d2;
}

.aiforya-rfq-extract:disabled {
	opacity: 0.6;
	cursor: default;
}

/* Actions */
.aiforya-rfq-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	margin-top: 22px;
}

.aiforya-rfq-submit {
	appearance: none;
	-webkit-appearance: none;
	padding: 12px 26px;
	font: inherit;
	font-weight: 700;
	color: #ffffff;
	background: linear-gradient( 135deg, #2bd4d9, #b14dff );
	border: none;
	border-radius: var(--aiforya-rfq-radius);
	cursor: pointer;
	box-shadow: 0 4px 14px rgba( 100, 80, 220, 0.22 );
	transition: transform 0.12s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.aiforya-rfq-submit:hover {
	transform: translateY( -1px );
	box-shadow: 0 6px 18px rgba( 100, 80, 220, 0.30 );
}

.aiforya-rfq-submit:active {
	transform: translateY( 0 );
}

.aiforya-rfq-submit:disabled {
	opacity: 0.65;
	cursor: default;
	transform: none;
	box-shadow: none;
}

.aiforya-rfq-submit[hidden] {
	display: none;
}

/* Statut global */
.aiforya-rfq-status {
	font-size: 0.9em;
	color: var(--aiforya-rfq-error);
}

/* Honeypot anti-spam : masqué hors écran */
.aiforya-rfq-hp {
	position: absolute;
	left: -9999px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Message de succès */
.aiforya-rfq-success {
	max-width: 640px;
	margin: 0 auto;
	padding: 20px 22px;
	font-size: 1.05em;
	font-weight: 600;
	color: #0f5132;
	background: #e7f6ec;
	border: 1px solid #b7e0c4;
	border-radius: var(--aiforya-rfq-radius);
	text-align: center;
}

/* Responsive */
@media ( max-width: 520px ) {
	.aiforya-rfq-form {
		font-size: 15px;
	}

	.aiforya-rfq-actions {
		gap: 10px;
	}

	.aiforya-rfq-submit {
		width: 100%;
		text-align: center;
	}
}

/* Layout à colonnes (compositeur de formulaire). */
.aiforya-rfq-cols { display: grid; gap: 16px; }
.aiforya-rfq-cols-2 { grid-template-columns: 1fr 1fr; }
.aiforya-rfq-cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.aiforya-rfq-col { min-width: 0; }
@media (max-width: 560px) {
	.aiforya-rfq-cols-2, .aiforya-rfq-cols-3 { grid-template-columns: 1fr; }
}

/* Blocs de contenu (titre, html) + colonne unique. */
.aiforya-rfq-cols-1 { grid-template-columns: 1fr; }
.aiforya-rfq-heading { margin: 8px 0 4px; line-height: 1.3; }
.aiforya-rfq-html { margin: 4px 0 12px; line-height: 1.6; }
.aiforya-rfq-html p { margin: 0 0 8px; }
.aiforya-rfq-submit.is-full { width: 100%; }

/* ---- Style pilotable (variables CSS depuis schema.style, fallbacks = valeurs par défaut) ---- */
.aiforya-rfq-form input:not([type=checkbox]):not([type=radio]),
.aiforya-rfq-form textarea,
.aiforya-rfq-form select {
	font-size: var(--smf-field-size, 1rem);
	color: var(--smf-field-text, inherit);
	background: var(--smf-field-bg, #fff);
	border-color: var(--smf-field-border, rgba(0, 0, 0, .16));
	border-radius: var(--smf-radius, 10px);
}
.aiforya-rfq-form input:focus,
.aiforya-rfq-form textarea:focus,
.aiforya-rfq-form select:focus {
	border-color: var(--smf-accent, #2bd4d9);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--smf-accent, #2bd4d9) 22%, transparent);
}
.aiforya-rfq-label { font-size: var(--smf-label-size, .95rem); color: var(--smf-label, inherit); }
.aiforya-rfq-heading { font-size: var(--smf-heading-size, 1.3rem); color: var(--smf-heading, inherit); }
.aiforya-rfq-html { font-size: var(--smf-text-size, 1rem); color: var(--smf-text, inherit); }
.aiforya-rfq-submit {
	background: var(--smf-btn-bg, linear-gradient(135deg, #2bd4d9, #b14dff));
	color: var(--smf-btn-text, #fff);
	border-radius: var(--smf-radius, 999px);
}
