/**
 * CostoCajero Styles
 */

/* Calculadora Form */
.costo-cajero-confronto {
	max-width: 100%;
	margin: 0;
	padding: 0;
}

.costo-cajero-confronto h2 {
	margin-top: 0;
	color: #333;
}

.cc-description {
	color: #5f6b76;
	margin-bottom: 1.2em;
}

.cc-how-it-works {
	background: #f8fbff;
	border-left: 4px solid #0073aa;
	padding: 12px 14px;
	border-radius: 6px;
	margin-bottom: 1.25em;
}

.cc-how-it-works p {
	margin: 0 0 0.5em;
	font-size: 0.95em;
	color: #2f3b45;
}

.cc-how-it-works p:last-child {
	margin-bottom: 0;
}

.cc-confronto-form {
	background: #fff;
	border-radius: 10px;
	border: 1px solid #e5e7eb;
	box-shadow: 0 1px 3px rgba(0,0,0,0.04);
	padding: 1.2em;
	margin-bottom: 1.2em;
}

.cc-form-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 1.5em;
	margin-bottom: 1.5em;
}

.cc-form-group {
	margin-bottom: 1.5em;
	position: relative;
}

.cc-form-group label {
	display: block;
	margin-bottom: 0.5em;
	font-weight: 600;
	color: #555;
}

/*
 * Bordo sul contenitore: input/select senza bordo → stesso aspetto (il tema non può “spezzare” il modello).
 */
.costo-cajero-confronto .cc-confronto-form .cc-field-shell {
	display: flex;
	align-items: stretch;
	box-sizing: border-box;
	width: 100%;
	min-height: 2.75rem;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	background-color: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.costo-cajero-confronto .cc-confronto-form .cc-field-shell:focus-within {
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.costo-cajero-confronto .cc-confronto-form .cc-field-shell__control {
	flex: 1 1 auto;
	min-width: 0;
	width: 100%;
	margin: 0 !important;
	padding: 0.5rem 0.75rem !important;
	border: 0 !important;
	border-radius: 0 !important;
	outline: none !important;
	box-shadow: none !important;
	background: transparent !important;
	font-family: inherit !important;
	font-size: 1rem !important;
	line-height: 1.5 !important;
	font-weight: 400 !important;
	color: #1f2937 !important;
}

.costo-cajero-confronto .cc-confronto-form .cc-field-shell--select .cc-field-shell__control {
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	appearance: none !important;
	padding-right: 2.25rem !important;
	cursor: pointer !important;
	background-color: transparent !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 0.55rem center !important;
	background-size: 1rem 1rem !important;
}

.costo-cajero-confronto .cc-confronto-form .cc-field-shell__control:focus {
	box-shadow: none !important;
}

/* Form modale "tarjeta faltante" (fuori dal wrapper .costo-cajero-confronto) */
.cc-modal-dialog .cc-form-group input[type="text"],
.cc-modal-dialog .cc-form-group input[type="email"],
.cc-modal-dialog .cc-form-group textarea {
	box-sizing: border-box;
	width: 100%;
	padding: 0.75em;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 1em;
	font-family: inherit;
}

/* Autocomplete styles */
.cc-carta-autocomplete-results {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid #ddd;
	border-top: none;
	border-radius: 0 0 4px 4px;
	max-height: 300px;
	overflow-y: auto;
	z-index: 1000;
	box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.cc-carta-autocomplete-results .cc-autocomplete-item {
	padding: 0.75em;
	cursor: pointer;
	border-bottom: 1px solid #f0f0f0;
}

.cc-carta-autocomplete-results .cc-autocomplete-item:hover,
.cc-carta-autocomplete-results .cc-autocomplete-item.selected {
	background: #f5f5f5;
}

.cc-carta-autocomplete-results .cc-autocomplete-item:last-child {
	border-bottom: none;
}

.cc-carta-autocomplete-results .cc-autocomplete-item-title {
	font-weight: 600;
	color: #333;
}

.cc-carta-autocomplete-results .cc-autocomplete-item-details {
	font-size: 0.875em;
	color: #666;
	margin-top: 0.25em;
}

/* Result Card */
.cc-result-card {
	background: #fff;
	border-radius: 10px;
	border: 1px solid #e5e7eb;
	box-shadow: 0 1px 3px rgba(0,0,0,0.04);
	padding: 1.2em;
	margin-top: 1em;
}

.cc-result-card h3 {
	margin-top: 0;
	color: #0073aa;
}

.cc-results-above-fold {
	scroll-margin-top: 90px;
}

.cc-best-option-hero {
	background: #f0f7ff;
	color: #0f172a;
	border-radius: 8px;
	padding: 1em 1.25em;
	margin-bottom: 1em;
	border: 1px solid #bfdbfe;
}

.cc-best-amount {
	font-size: 2rem;
	font-weight: 700;
	line-height: 1;
}

.cc-best-caption {
	opacity: 0.85;
	margin-top: 0.35em;
}

.cc-best-meta {
	margin-top: 0.6em;
	font-size: 0.92em;
	opacity: 0.95;
}

.cc-result-info {
	background: #f9f9f9;
	border-radius: 8px;
	padding: 1.5em;
	margin-bottom: 2em;
}

.cc-info-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.75em 0;
	border-bottom: 1px solid #e0e0e0;
}

.cc-info-row:last-child {
	border-bottom: none;
}

.cc-label {
	font-weight: 600;
	color: #555;
}

.cc-value {
	color: #333;
	font-weight: 500;
}

.cc-calculation-details {
	margin-top: 2em;
}

.cc-calculation-details h4 {
	color: #333;
	margin-bottom: 1em;
	border-bottom: 2px solid #0073aa;
	padding-bottom: 0.5em;
}

.cc-detail-row {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	padding: 1em;
	margin-bottom: 0.5em;
	background: #f9f9f9;
	border-radius: 4px;
	flex-wrap: wrap;
}

.cc-detail-row small {
	display: block;
	width: 100%;
	margin-top: 0.25em;
	color: #666;
	font-size: 0.9em;
}

.cc-detail-row.cc-total {
	background: #0073aa;
	color: #fff;
	font-weight: 600;
	font-size: 1.1em;
	margin-top: 1em;
}

.cc-detail-row.cc-total .cc-total-amount {
	font-size: 1.3em;
}

.cc-summary {
	background: #e8f5e9;
	border-left: 4px solid #4caf50;
	border-radius: 4px;
	padding: 1.5em;
	margin-top: 1.5em;
}

.cc-summary-item {
	margin-bottom: 0.75em;
}

.cc-summary-item:last-child {
	margin-bottom: 0;
}

.cc-form-actions {
	display: flex;
	gap: 1em;
	margin-top: 1em;
	justify-content: flex-end;
	padding-top: 0.2em;
	background: transparent;
}

.cc-button-primary,
.cc-button-secondary {
	padding: 0.75em 2em;
	border: none;
	border-radius: 4px;
	font-size: 1em;
	cursor: pointer;
	transition: all 0.3s;
}

.cc-button-primary {
	background: #0073aa;
	color: #fff;
}

.cc-button-primary:hover {
	background: #005a87;
}

.cc-button-secondary {
	background: #f0f0f0;
	color: #333;
	border: 1px solid #ddd;
}

.cc-button-secondary:hover {
	background: #e0e0e0;
}

/* Results */
.cc-results {
	margin-top: 2em;
}

.cc-results-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	box-shadow: 0 2px 10px rgba(0,0,0,0.1);
	border-radius: 8px;
	overflow: hidden;
}

.cc-results-table th,
.cc-results-table td {
	padding: 1em;
	text-align: left;
	border-bottom: 1px solid #eee;
}

.cc-results-table th {
	background: #0073aa;
	color: #fff;
	font-weight: 600;
}

.cc-results-table tr:hover {
	background: #f9f9f9;
}

.cc-best-option {
	background: #e8f5e9 !important;
	border-left: 4px solid #4caf50;
	font-weight: 600;
}

.cc-best-option td:first-child::before {
	content: "🏆 ";
}

.cc-combination-header {
	font-weight: 600;
	color: #333;
}

.cc-combination-header .atm-name {
	color: #0073aa;
}

.cc-combination-header .carta-name {
	color: #d32f2f;
}

.cc-cost-highlight {
	font-size: 1.2em;
	font-weight: 600;
	color: #d32f2f;
}

.cc-effective-rate {
	color: #666;
	font-size: 0.9em;
}

.cc-loading {
	text-align: center;
	padding: 3em;
}

.cc-loading::after {
	content: "";
	display: inline-block;
	width: 30px;
	height: 30px;
	border: 3px solid #f3f3f3;
	border-top: 3px solid #0073aa;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

.cc-error {
	color: #d32f2f;
	background: #ffebee;
	padding: 1em;
	border-radius: 4px;
	border-left: 4px solid #d32f2f;
	margin: 1em 0;
}

.cc-success {
	color: #1b5e20;
	background: #e8f5e9;
	padding: 1em;
	border-radius: 4px;
	border-left: 4px solid #2e7d32;
	margin: 1em 0;
}

.cc-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	z-index: 9999;
	padding: 20px;
}

.cc-modal-dialog {
	background: #fff;
	max-width: 560px;
	margin: 4vh auto 0;
	border-radius: 10px;
	padding: 20px;
	position: relative;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.cc-modal-close {
	position: absolute;
	top: 8px;
	right: 12px;
	background: transparent;
	border: none;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: #666;
}

.cc-modal-close:hover {
	color: #111;
}

.cc-technical-details {
	margin-top: 1.1em;
	background: #f8f8f8;
	border-radius: 6px;
	padding: 0.5em 0.75em;
}

.cc-technical-details summary {
	cursor: pointer;
	font-weight: 600;
}

.cc-technical-details ul {
	margin: 0.8em 0 0.2em 1.2em;
}

.cc-remove-combination {
	background: #d32f2f;
	color: #fff;
	border: none;
	padding: 0.5em 1em;
	border-radius: 4px;
	cursor: pointer;
	font-size: 0.9em;
	margin-top: 0.5em;
}

.cc-remove-combination:hover {
	background: #b71c1c;
}

/* Responsive */
@media (max-width: 768px) {
	.costo-cajero-confronto {
		padding: 1em;
	}
	
	.cc-confronto-form {
		padding: 1em;
	}
	
	.cc-form-row {
		grid-template-columns: 1fr;
	}
	
	.cc-results-table {
		font-size: 0.9em;
	}
	
	.cc-results-table th,
	.cc-results-table td {
		padding: 0.5em;
	}
	
	.cc-form-actions {
		flex-direction: column;
		position: static;
		background: transparent;
		padding-top: 0;
	}
	
	.cc-button-primary,
	.cc-button-secondary {
		width: 100%;
	}
}
