/**
 * Frontend - EWD Super-Purchasing Power Simulator
 */

.ewd-spp-calculator {
	max-width: 1200px;
	margin: 0 auto;
	padding: 30px 20px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Mode switch */
.ewd-spp-mode-switch {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 15px;
	margin-bottom: 30px;
	padding: 15px;
}

.ewd-spp-switch {
	position: relative;
	display: inline-block;
	width: 60px;
	height: 34px;
}

.ewd-spp-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.ewd-spp-slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #ccc;
	transition: 0.4s;
	border-radius: 34px;
}

.ewd-spp-slider:before {
	position: absolute;
	content: "";
	height: 26px;
	width: 26px;
	left: 4px;
	bottom: 4px;
	background-color: white;
	transition: 0.4s;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.ewd-spp-switch input:checked + .ewd-spp-slider {
	background-color: #2196F3;
}

.ewd-spp-switch input:checked + .ewd-spp-slider:before {
	transform: translateX(26px);
}

.ewd-spp-mode-label {
	font-weight: 600;
	font-size: 16px;
	color: #333;
}

/* Categories */
.ewd-spp-categories-list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 30px;
	justify-content: center;
}

.ewd-spp-category-btn {
	padding: 12px 24px;
	background: #fff;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	font-size: 16px;
	font-weight: 500;
	color: #555;
	cursor: pointer;
	transition: all 0.2s ease;
}

.ewd-spp-category-btn:hover {
	border-color: #2196F3;
	color: #2196F3;
}

.ewd-spp-category-btn.active {
	background: #2196F3;
	border-color: #2196F3;
	color: #fff;
}

/* Category content - carte blanche */
.ewd-spp-category-content {
	background: #fff;
	border-radius: 12px;
	padding: 30px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
	margin-bottom: 30px;
}

.ewd-spp-category-info-container {
	margin-bottom: 30px;
}

.ewd-spp-category-info {
	margin-bottom: 30px;
}

.ewd-spp-category-description {
	font-size: 16px;
	line-height: 1.6;
	color: #555;
	margin-bottom: 20px;
}

.ewd-spp-category-description p {
	margin-bottom: 10px;
}

.ewd-spp-category-images {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 15px;
	margin-top: 20px;
}

.ewd-spp-image-wrapper {
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ewd-spp-image-wrapper img {
	width: 100%;
	height: auto;
	display: block;
}

/* Budget inputs */
.ewd-spp-budget-inputs {
	display: flex;
	flex-direction: column;
	gap: 25px;
}

.ewd-spp-budget-item {
	display: none;
}

.ewd-spp-budget-item.active {
	display: block;
}

.ewd-spp-budget-item label {
	display: block;
	font-weight: 600;
	font-size: 16px;
	color: #333;
	margin-bottom: 10px;
}

.ewd-spp-input-wrapper {
	position: relative;
	margin-bottom: 15px;
}

.ewd-spp-budget-input {
	width: 100%;
	padding: 12px 50px 12px 15px;
	font-size: 18px;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	box-sizing: border-box;
	transition: border-color 0.2s ease;
}

.ewd-spp-budget-input:focus {
	outline: none;
	border-color: #2196F3;
	box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.15);
}

.ewd-spp-currency {
	position: absolute;
	right: 15px;
	top: 50%;
	transform: translateY(-50%);
	font-weight: 600;
	color: #666;
}

/* Slider */
.ewd-spp-slider-wrapper {
	margin-top: 10px;
}

.ewd-spp-budget-slider {
	width: 100%;
	height: 8px;
	border-radius: 5px;
	background: #e0e0e0;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}

.ewd-spp-budget-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #2196F3;
	cursor: pointer;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ewd-spp-budget-slider::-moz-range-thumb {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #2196F3;
	cursor: pointer;
	border: none;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ewd-spp-slider-labels {
	display: flex;
	justify-content: space-between;
	margin-top: 5px;
	font-size: 12px;
	color: #666;
}

.ewd-spp-slider-current-value {
	font-weight: 600;
	font-size: 14px;
	color: #2196F3;
}

/* Results - bloc gradient violet / bleu */
.ewd-spp-results {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border-radius: 12px;
	padding: 30px;
	color: #fff;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.ewd-spp-results-default .ewd-spp-result-item {
	margin-bottom: 20px;
}

.ewd-spp-results-default .ewd-spp-result-item:last-of-type {
	margin-bottom: 30px;
}

.ewd-spp-result-item label {
	display: block;
	font-size: 14px;
	opacity: 0.95;
	margin-bottom: 8px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.ewd-spp-result-value {
	font-size: 32px;
	font-weight: 700;
	line-height: 1.2;
}

.ewd-spp-calculate-btn {
	width: 100%;
	padding: 16px 32px;
	background: #fff;
	color: #667eea;
	border: none;
	border-radius: 8px;
	font-size: 18px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	text-transform: uppercase;
	letter-spacing: 1px;
	box-sizing: border-box;
}

.ewd-spp-calculate-btn:hover {
	background: #f5f5f5;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Message inscription (même bloc results) */
.ewd-spp-login-message {
	padding: 20px;
	text-align: center;
}

.ewd-spp-login-content {
	max-width: 600px;
	margin: 0 auto;
}

.ewd-spp-login-content p {
	font-size: 18px;
	margin-bottom: 20px;
	opacity: 0.95;
	color: #fff;
}

.ewd-spp-login-btn {
	width: 100%;
	padding: 16px 32px;
	background: #fff;
	color: #667eea;
	border: none;
	border-radius: 8px;
	font-size: 18px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	box-sizing: border-box;
}

.ewd-spp-login-btn:hover {
	background: #f5f5f5;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Popup */
.ewd-spp-popup {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 99999;
    width: 100%;
    max-width: 100% !important;
    margin: 0;
}

.ewd-spp-popup-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.6);
}

.ewd-spp-popup-container {
	position: relative;
	max-width: 800px;
	margin: 50px auto;
	padding: 40px;
	overflow-y: auto;
	max-height: calc(100vh - 100px);
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.ewd-spp-popup-close {
	position: absolute;
	top: 20px;
	right: 30px;
	width: 44px;
	height: 44px;
	padding: 0;
	border: none;
	background: none;
	cursor: pointer;
	font-size: 44px;
	line-height: 1;
	color: #333;
}

.ewd-spp-popup-close:hover {
	color: #000;
}

.ewd-spp-popup-content {
	text-align: center;
}

.ewd-spp-popup-title {
	margin-bottom: 15px;
	line-height: 1.5;
	font-size: 24px;
	color: #333;
}

.ewd-spp-bonus-amount {
	color: #e65100;
	font-weight: 700;
}

.ewd-spp-popup-subtitle {
	margin-bottom: 30px;
	line-height: 1.5;
	font-size: 16px;
	color: #555;
}

/* Formulaire popup */
.ewd-spp-register-form {
	max-width: 600px;
	margin: 0 auto;
}

.ewd-spp-form-row {
	display: flex;
	gap: 10px;
	margin-bottom: 10px;
}

.ewd-spp-form-field {
	margin-bottom: 10px;
}

.ewd-spp-field-phone {
	flex: 0 0 66.6666%;
}

.ewd-spp-field-sponsor {
	flex: 0 0 calc(33.3333% - 10px);
}

.ewd-spp-field-full {
	width: 100%;
}

.ewd-spp-register-form input[type="text"],
.ewd-spp-register-form input[type="email"],
.ewd-spp-register-form input[type="tel"] {
	width: 100%;
	height: 40px;
	padding: 0 15px;
	box-sizing: border-box;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 16px;
}

.ewd-spp-register-form input[type="text"]:focus,
.ewd-spp-register-form input[type="email"]:focus,
.ewd-spp-register-form input[type="tel"]:focus {
	outline: none;
	border-color: #2196F3;
	box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.ewd-spp-field-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	text-align: left;
	margin: 20px 0;
}

.ewd-spp-field-checkbox input[type="checkbox"] {
	width: 16px;
	height: 16px;
	margin-top: 3px;
	flex-shrink: 0;
}

.ewd-spp-field-checkbox label {
	line-height: 1.4;
	font-size: 12px;
	color: #555;
}

.ewd-spp-submit-btn {
	padding: 12px 40px;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-size: 16px;
	font-weight: 600;
	background: #667eea;
	color: #fff;
	transition: all 0.2s ease;
}

.ewd-spp-submit-btn:hover {
	background: #5a6fd6;
}

.ewd-spp-submit-btn:disabled {
	cursor: not-allowed;
	opacity: 0.6;
}

.ewd-spp-form-message {
	margin-top: 20px;
	padding: 15px;
	border-radius: 8px;
	font-size: 14px;
}

/* Inline registration form (shortcode, même contenu que le popup) */
.ewd-spp-register-inline {
	max-width: 600px;
	margin: 2em auto;
	padding: 2em;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}
.ewd-spp-register-inline .ewd-spp-popup-title {
	margin-top: 0;
}
.ewd-spp-register-inline .ewd-spp-register-form input[type="date"] {
	width: 100%;
	height: 40px;
	padding: 0 15px;
	box-sizing: border-box;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 16px;
}
.ewd-spp-already-logged-in {
	text-align: center;
	padding: 1em;
	color: #555;
}

/* Bloc connexion sur shortcode [ewd_spp_register_form] */
.ewd-spp-login-inline {
	margin-bottom: 2em;
	padding-bottom: 2em;
	border-bottom: 1px solid #eee;
}
.ewd-spp-login-inline-title {
	margin: 0 0 1em;
	font-size: 1.1em;
	color: #1d2327;
}
.ewd-spp-login-form .ewd-spp-form-field {
	margin-bottom: 12px;
}
.ewd-spp-login-form input[type="text"],
.ewd-spp-login-form input[type="password"] {
	width: 100%;
	max-width: 320px;
	height: 40px;
	padding: 0 12px;
	box-sizing: border-box;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 16px;
}
.ewd-spp-login-form input:focus {
	outline: none;
	border-color: #2196F3;
}
.ewd-spp-login-submit-btn {
	padding: 10px 24px;
	border: none;
	border-radius: 6px;
	font-size: 15px;
	font-weight: 600;
	background: #2271b1;
	color: #fff;
	cursor: pointer;
	transition: background 0.2s;
}
.ewd-spp-login-submit-btn:hover {
	background: #135e96;
}
.ewd-spp-login-submit-btn:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}
.ewd-spp-login-message {
	margin-top: 12px;
}

.ewd-spp-form-message.success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.ewd-spp-form-message.error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

/* Responsive */
@media (max-width: 768px) {
	.ewd-spp-calculator {
		padding: 20px 15px;
	}

	.ewd-spp-categories-list {
		flex-direction: column;
	}

	.ewd-spp-category-btn {
		width: 100%;
	}

	.ewd-spp-category-content {
		padding: 20px;
	}

	.ewd-spp-category-images {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	}

	.ewd-spp-result-value {
		font-size: 24px;
	}

	.ewd-spp-popup-container {
		margin: 20px;
		padding: 30px 20px;
	}

	.ewd-spp-form-row {
		flex-direction: column;
	}

	.ewd-spp-field-phone,
	.ewd-spp-field-sponsor {
		flex: 0 0 100%;
	}
}

/* Popup résultat validation (lien visité par le client) */
.ewd-spp-validation-result-popup .ewd-spp-popup-container {
	max-width: 480px;
}
.ewd-spp-validation-result--success .ewd-spp-validation-result-title {
	color: #155724;
}
.ewd-spp-validation-result--success .ewd-spp-validation-result-message {
	color: #155724;
}
.ewd-spp-validation-result--error .ewd-spp-validation-result-title {
	color: #721c24;
}
.ewd-spp-validation-result--error .ewd-spp-validation-result-message {
	color: #721c24;
}
.ewd-spp-validation-result-message {
	margin: 0 0 20px;
	font-size: 16px;
	line-height: 1.5;
}
.ewd-spp-validation-result-close {
	margin-top: 8px;
}
