/* MAGECO — Servizio Privati chat page
   Design system: Premium Green Evolution */

:root {
	--green-900: #1A2F27;
	--green-700: #2D6650;
	--green-600: #008351;
	--green-500: #2E8B57;
	--green-100: #E8F5E9;
	--cream: #FAF9F5;
	--white: #FFFFFF;
	--text-dark: #1F211C;
	--text-muted: #747474;
	--radius: 16px;
	--shadow: 0 10px 34px rgba(26, 47, 39, 0.10);
	--font-head: 'Plus Jakarta Sans', system-ui, sans-serif;
	--font-body: 'Inter', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

.mpv-body {
	font-family: var(--font-body);
	color: var(--text-dark);
	background: var(--cream);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

.mpv-container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3 { font-family: var(--font-head); color: var(--green-900); }

a { color: var(--green-600); }

/* ---------- Header ---------- */
.mpv-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(26, 47, 39, 0.92);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}
.mpv-header-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.mpv-logo {
	font-family: var(--font-head); font-weight: 800; font-size: 1.3rem;
	color: #fff; text-decoration: none; letter-spacing: 0.5px;
}
.mpv-logo span { color: var(--green-600); }
.mpv-header-right { display: flex; align-items: center; gap: 16px; }
.mpv-header-note { color: #BFD9CC; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1.2px; }
.mpv-header-phone {
	display: inline-flex; align-items: center; gap: 7px;
	background: var(--green-600); color: #fff; text-decoration: none;
	font-weight: 600; font-size: 0.88rem; padding: 9px 16px; border-radius: 10px;
	transition: background 0.2s;
}
.mpv-header-phone:hover { background: var(--green-500); }

/* ---------- Hero ---------- */
.mpv-hero {
	background: linear-gradient(160deg, var(--green-900) 0%, #14251E 100%);
	padding: 64px 0 56px; text-align: center;
}
.mpv-hero-badge {
	display: inline-block; background: rgba(0, 131, 81, 0.18); color: #7FD3AE;
	border: 1px solid rgba(0, 131, 81, 0.45);
	font-size: 0.78rem; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase;
	padding: 7px 16px; border-radius: 999px; margin-bottom: 22px;
}
.mpv-hero h1 {
	color: #fff; font-size: clamp(1.9rem, 4.5vw, 3rem);
	font-weight: 800; line-height: 1.18; margin-bottom: 18px;
}
.mpv-hero h1 em { font-style: normal; color: #7FD3AE; }
.mpv-hero-sub {
	color: #C9DAD1; max-width: 680px; margin: 0 auto 26px; font-size: 1.02rem;
}
.mpv-hero-sub strong { color: #fff; }
.mpv-trust {
	display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px;
	color: #8FB3A3; font-size: 0.82rem; font-weight: 500;
}
.mpv-trust i { width: 4px; height: 4px; border-radius: 50%; background: var(--green-600); }

/* ---------- Steps ---------- */
.mpv-steps { background: var(--white); border-bottom: 1px solid var(--green-100); }
.mpv-steps-inner {
	display: flex; align-items: center; justify-content: center; gap: 26px;
	padding: 20px; flex-wrap: wrap;
}
.mpv-step { display: flex; align-items: center; gap: 12px; }
.mpv-step b {
	width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%;
	background: var(--green-100); color: var(--green-700);
	display: flex; align-items: center; justify-content: center;
	font-family: var(--font-head); font-size: 0.95rem;
}
.mpv-step strong { display: block; font-size: 0.9rem; color: var(--green-900); }
.mpv-step span { font-size: 0.78rem; color: var(--text-muted); }
.mpv-step-arrow { color: var(--green-600); font-weight: 700; }

/* ---------- Layout ---------- */
.mpv-main { padding: 42px 0 60px; }
.mpv-grid {
	display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
	gap: 26px; align-items: start;
}

/* ---------- Chat card ---------- */
.mpv-chat-card {
	background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
	display: flex; flex-direction: column; overflow: hidden;
	border-top: 4px solid var(--green-600);
}
.mpv-chat-head {
	display: flex; align-items: center; gap: 12px;
	padding: 16px 20px; border-bottom: 1px solid var(--green-100);
}
.mpv-avatar {
	width: 42px; height: 42px; border-radius: 12px; background: var(--green-900);
	color: #7FD3AE; display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.mpv-chat-head strong { font-family: var(--font-head); font-size: 0.98rem; color: var(--green-900); display: block; }
.mpv-status { display: inline-flex; align-items: center; gap: 6px; font-size: 0.76rem; color: var(--text-muted); }
.mpv-status i { width: 7px; height: 7px; border-radius: 50%; background: #2ECC71; box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.2); }
.mpv-reset {
	margin-left: auto; background: none; border: 1px solid var(--green-100);
	color: var(--text-muted); font-size: 0.76rem; padding: 6px 12px; border-radius: 8px;
	cursor: pointer; transition: all 0.2s; font-family: var(--font-body);
}
.mpv-reset:hover { border-color: var(--green-600); color: var(--green-600); }

.mpv-chat-body {
	height: 430px; overflow-y: auto; padding: 20px;
	display: flex; flex-direction: column; gap: 12px;
	background: linear-gradient(180deg, #FBFDFC 0%, var(--white) 100%);
}
.mpv-msg {
	max-width: 84%; padding: 11px 15px; border-radius: 14px;
	font-size: 0.92rem; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word;
	animation: mpvIn 0.3s ease both;
}
@keyframes mpvIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.mpv-msg-bot { align-self: flex-start; background: var(--green-100); color: var(--green-900); border-bottom-left-radius: 4px; }
.mpv-msg-user { align-self: flex-end; background: var(--green-700); color: #fff; border-bottom-right-radius: 4px; }
.mpv-msg-error { align-self: flex-start; background: #FDF2F2; color: #8A2C2C; border: 1px solid #F3D9D9; border-bottom-left-radius: 4px; }
.mpv-msg-error a { color: #8A2C2C; font-weight: 600; }

.mpv-typing { align-self: flex-start; background: var(--green-100); border-radius: 14px; border-bottom-left-radius: 4px; padding: 14px 18px; display: flex; gap: 5px; }
.mpv-typing i {
	width: 7px; height: 7px; border-radius: 50%; background: var(--green-700); opacity: 0.4;
	animation: mpvDot 1.2s infinite;
}
.mpv-typing i:nth-child(2) { animation-delay: 0.2s; }
.mpv-typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes mpvDot { 0%, 60%, 100% { opacity: 0.35; transform: none; } 30% { opacity: 1; transform: translateY(-4px); } }

.mpv-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 6px; }
.mpv-chip {
	background: var(--white); border: 1.5px solid var(--green-100); color: var(--green-700);
	font-size: 0.82rem; font-weight: 500; padding: 7px 14px; border-radius: 999px;
	cursor: pointer; transition: all 0.2s; font-family: var(--font-body);
}
.mpv-chip:hover { border-color: var(--green-600); background: var(--green-100); }

.mpv-chat-input { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--green-100); }
.mpv-chat-input input {
	flex: 1; border: 1.5px solid var(--green-100); border-radius: 12px;
	padding: 12px 16px; font-size: 0.94rem; font-family: var(--font-body);
	outline: none; transition: border-color 0.2s; color: var(--text-dark); background: var(--white);
}
.mpv-chat-input input:focus { border-color: var(--green-600); }
.mpv-chat-input button {
	width: 48px; border: 0; border-radius: 12px; background: var(--green-600); color: #fff;
	cursor: pointer; display: flex; align-items: center; justify-content: center;
	transition: background 0.2s;
}
.mpv-chat-input button:hover { background: var(--green-500); }
.mpv-chat-input button:disabled { background: #B9CFC5; cursor: not-allowed; }
.mpv-disclaimer { padding: 0 20px 14px; font-size: 0.72rem; color: var(--text-muted); }

/* ---------- Scheda card ---------- */
.mpv-scheda-card {
	background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
	padding: 22px; position: sticky; top: 82px;
}
.mpv-scheda-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.mpv-scheda-head h2 { font-size: 1.05rem; }
.mpv-scheda-count {
	background: var(--green-100); color: var(--green-700); font-weight: 700;
	font-size: 0.8rem; padding: 4px 10px; border-radius: 999px; font-family: var(--font-head);
}
.mpv-progress { height: 6px; background: var(--green-100); border-radius: 999px; overflow: hidden; margin-bottom: 16px; }
.mpv-progress-bar {
	height: 100%; width: 0; border-radius: 999px;
	background: linear-gradient(90deg, var(--green-700), var(--green-600));
	transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.mpv-scheda-list { display: flex; flex-direction: column; gap: 2px; }
.mpv-scheda-list .mpv-field {
	display: flex; justify-content: space-between; gap: 12px;
	padding: 8px 10px; border-radius: 8px; font-size: 0.85rem;
	transition: background 0.4s;
}
.mpv-field dt { color: var(--text-muted); flex: 0 0 auto; }
.mpv-field dd { text-align: right; color: #C4C9C2; font-weight: 500; }
.mpv-field.mpv-filled dd { color: var(--green-900); font-weight: 600; }
.mpv-field.mpv-flash { background: var(--green-100); }

.mpv-scheda-hint { margin-top: 16px; padding: 12px 14px; background: var(--cream); border-radius: 10px; }
.mpv-scheda-hint p { font-size: 0.8rem; color: var(--text-muted); }

/* ---------- Contact form ---------- */
.mpv-contact { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--green-100); animation: mpvIn 0.4s ease both; }
.mpv-contact h3 { font-size: 1rem; margin-bottom: 4px; }
.mpv-contact > p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 12px; }
.mpv-contact form { display: flex; flex-direction: column; gap: 10px; }
.mpv-contact input[type="text"], .mpv-contact input[type="tel"], .mpv-contact input[type="email"] {
	border: 1.5px solid var(--green-100); border-radius: 10px; padding: 11px 14px;
	font-size: 0.9rem; font-family: var(--font-body); outline: none; width: 100%;
	transition: border-color 0.2s; color: var(--text-dark);
}
.mpv-contact input:focus { border-color: var(--green-600); }
.mpv-consent { display: flex; gap: 9px; align-items: flex-start; font-size: 0.76rem; color: var(--text-muted); cursor: pointer; }
.mpv-consent input { margin-top: 3px; accent-color: var(--green-600); }
.mpv-contact button[type="submit"] {
	background: var(--green-600); color: #fff; border: 0; border-radius: 10px;
	padding: 13px; font-size: 0.95rem; font-weight: 600; font-family: var(--font-head);
	cursor: pointer; transition: background 0.2s, transform 0.15s;
}
.mpv-contact button[type="submit"]:hover { background: var(--green-500); transform: translateY(-1px); }
.mpv-contact button[type="submit"]:disabled { background: #B9CFC5; cursor: wait; transform: none; }
.mpv-contact-error { color: #8A2C2C; font-size: 0.8rem; }

/* ---------- Success ---------- */
.mpv-success { margin-top: 18px; text-align: center; padding: 10px 4px; animation: mpvIn 0.4s ease both; }
.mpv-success-icon {
	width: 58px; height: 58px; margin: 0 auto 12px; border-radius: 50%;
	background: var(--green-100); color: var(--green-600);
	font-size: 1.7rem; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.mpv-success h3 { font-size: 1.1rem; margin-bottom: 6px; }
.mpv-success p { font-size: 0.86rem; color: var(--text-muted); margin-bottom: 8px; }
.mpv-success-alt { padding-top: 6px; border-top: 1px dashed var(--green-100); }

/* ---------- Reassurance ---------- */
.mpv-reassure { background: var(--white); border-top: 1px solid var(--green-100); }
.mpv-reassure-inner {
	display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; padding: 34px 20px;
}
.mpv-reassure-inner strong { display: block; font-family: var(--font-head); color: var(--green-700); font-size: 0.95rem; margin-bottom: 4px; }
.mpv-reassure-inner span { font-size: 0.83rem; color: var(--text-muted); }

/* ---------- Footer ---------- */
.mpv-footer { background: var(--green-900); color: #C9DAD1; padding: 26px 0; font-size: 0.84rem; }
.mpv-footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
.mpv-footer a { color: #7FD3AE; text-decoration: none; }
.mpv-footer a:hover { text-decoration: underline; }
.mpv-footer-back { font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.mpv-grid { grid-template-columns: 1fr; }
	.mpv-scheda-card { position: static; }
	.mpv-chat-body { height: 380px; }
	.mpv-reassure-inner { grid-template-columns: 1fr; gap: 16px; }
	.mpv-header-note { display: none; }
	.mpv-steps-inner { gap: 14px; }
	.mpv-step-arrow { display: none; }
	.mpv-steps-inner { flex-direction: column; align-items: flex-start; }
}
