/**
 * ESG Scoring — stile wizard + risultato.
 * Palette coerente con la collana "Rendimento Sostenibile".
 *
 * @package ESG_Scoring
 */
.esgsc {
	--esgsc-green: #1F4E3D;
	--esgsc-green2: #2E5E4E;
	--esgsc-ink: #233027;
	--esgsc-grey: #6B7A72;
	--esgsc-light: #EEF4F0;
	--esgsc-line: #DCE6E0;
	max-width: 820px;
	margin: 0 auto;
	color: var(--esgsc-ink);
	font-family: Georgia, "Times New Roman", serif;
	line-height: 1.55;
}
.esgsc *, .esgsc *::before, .esgsc *::after { box-sizing: border-box; }

.esgsc-eyebrow { color: var(--esgsc-green2); font-weight: bold; letter-spacing: .04em; font-size: .82rem; text-transform: uppercase; }
.esgsc-h2 { color: var(--esgsc-green); font-size: 1.9rem; margin: .2rem 0 .6rem; line-height: 1.15; }
.esgsc-h3 { color: var(--esgsc-green); font-size: 1.45rem; margin: .2rem 0 .6rem; line-height: 1.2; }
.esgsc-field textarea {
	width: 100%; padding: .7rem .8rem; border: 1px solid var(--esgsc-line);
	border-radius: 8px; font-size: 1rem; font-family: inherit; background: #fff; color: var(--esgsc-ink); resize: vertical;
}
.esgsc-field textarea:focus { outline: none; border-color: var(--esgsc-green2); box-shadow: 0 0 0 3px rgba(46,94,78,.15); }

/* --- AI screen --- */
.esgsc-ai-intro { font-size: 1rem; margin: 0 0 1.2rem; color: var(--esgsc-ink); }
.esgsc-ai-loading { text-align: center; padding: 2rem 0; color: var(--esgsc-grey); }
.esgsc-ai-card { display: flex; gap: .9rem; border: 1px solid var(--esgsc-line); border-left: 4px solid #44546A; border-radius: 10px; padding: 1.1rem 1.2rem; background: #F7F9FC; }
.esgsc-ai-card__badge { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 9px; background: #44546A; color: #fff; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: .9rem; }
.esgsc-ai-card__text { font-size: 1rem; }
.esgsc-ai-card__text p { margin: 0 0 .7rem; }
.esgsc-ai-card__text p:last-child { margin-bottom: 0; }
.esgsc-ai-failmsg { color: #B06A1E; font-style: italic; }
.esgsc-ai-disc { font-size: .82rem; color: var(--esgsc-grey); margin: .7rem 0 0; }

/* --- AI note nel risultato --- */
.esgsc-ai-note { border: 1px solid var(--esgsc-line); border-left: 4px solid #44546A; border-radius: 10px; padding: 1rem 1.1rem; margin: 0 0 1.4rem; background: #F7F9FC; }
.esgsc-ai-note__title { font-weight: bold; color: #44546A; margin-bottom: .4rem; }
.esgsc-ai-note p { margin: 0 0 .5rem; }
.esgsc-ai-note__foot { font-size: .8rem; color: var(--esgsc-grey); font-style: italic; }

.esgsc-result__descr { color: var(--esgsc-ink); font-size: .98rem; margin: 0 0 .3rem; }
.esgsc-lead { font-size: 1.05rem; margin: 0 0 1.4rem; }
.esgsc-note { font-size: .82rem; color: var(--esgsc-grey); margin-top: 1rem; }

/* --- Progress --- */
.esgsc-progress { margin: 0 0 1.4rem; }
.esgsc-progress__track { height: 8px; background: var(--esgsc-line); border-radius: 6px; overflow: hidden; }
.esgsc-progress__fill { display: block; height: 100%; background: var(--esgsc-green); transition: width .35s ease; }
.esgsc-progress__labels { display: flex; justify-content: space-between; margin-top: .4rem; font-size: .8rem; color: var(--esgsc-grey); }
.esgsc-progress__labels span { font-weight: bold; }
.esgsc-progress__labels span.is-active { color: var(--esgsc-green); }

/* --- Form --- */
.esgsc-form { margin-top: 1rem; }
.esgsc-field { margin-bottom: 1rem; }
.esgsc-field label { display: block; font-weight: bold; margin-bottom: .3rem; font-size: .95rem; }
.esgsc-req { color: var(--esgsc-grey); font-weight: normal; font-size: .85rem; }
.esgsc-field input {
	width: 100%; padding: .7rem .8rem; border: 1px solid var(--esgsc-line);
	border-radius: 8px; font-size: 1rem; font-family: inherit; background: #fff; color: var(--esgsc-ink);
}
.esgsc-field input:focus { outline: none; border-color: var(--esgsc-green2); box-shadow: 0 0 0 3px rgba(46,94,78,.15); }
.esgsc-consent { display: flex; gap: .55rem; align-items: flex-start; font-size: .9rem; margin: .2rem 0 1rem; }
.esgsc-consent input { margin-top: .25rem; }
.esgsc-form__err { color: #C0392B; font-size: .9rem; min-height: 1.2em; margin-bottom: .6rem; }

/* --- Buttons --- */
.esgsc-btn {
	appearance: none; border: 1px solid var(--esgsc-line); background: #fff; color: var(--esgsc-ink);
	padding: .7rem 1.3rem; border-radius: 8px; font-size: 1rem; font-family: inherit; cursor: pointer;
	transition: all .15s ease;
}
.esgsc-btn:hover { border-color: var(--esgsc-green2); }
.esgsc-btn--primary { background: var(--esgsc-green); border-color: var(--esgsc-green); color: #fff; font-weight: bold; }
.esgsc-btn--primary:hover { background: var(--esgsc-green2); }

/* --- Section head --- */
.esgsc-sec-head { display: flex; align-items: center; gap: .9rem; margin-bottom: .6rem; }
.esgsc-sec-letter {
	width: 46px; height: 46px; border-radius: 10px; color: #fff; font-weight: bold; font-size: 1.5rem;
	display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.esgsc-sec-kicker { font-size: .78rem; color: var(--esgsc-grey); text-transform: uppercase; letter-spacing: .04em; }
.esgsc-sec-title { margin: .1rem 0 0; font-size: 1.4rem; color: var(--esgsc-ink); }
.esgsc-sec-title span { color: var(--esgsc-grey); font-weight: normal; font-size: 1rem; font-style: italic; }
.esgsc-sec-intro { background: var(--esgsc-light); border-left: 4px solid var(--esgsc-green2); padding: .8rem 1rem; border-radius: 0 8px 8px 0; margin: .4rem 0 1.2rem; font-size: .97rem; }

/* --- Questions --- */
.esgsc-questions { display: flex; flex-direction: column; gap: 1rem; }
.esgsc-q { border: 1px solid var(--esgsc-line); border-radius: 10px; padding: 1rem; background: #fff; }
.esgsc-q--err { border-color: #C0392B; box-shadow: 0 0 0 2px rgba(192,57,43,.12); }
.esgsc-q__head { display: flex; gap: .5rem; align-items: baseline; }
.esgsc-q__id { font-weight: bold; color: var(--esgsc-green2); font-size: .9rem; flex: 0 0 auto; }
.esgsc-q__text { font-size: 1.02rem; }
.esgsc-q__source { font-size: .83rem; color: var(--esgsc-grey); margin: .35rem 0 .7rem; }
.esgsc-opts { display: grid; grid-template-columns: 1fr; gap: .5rem; }
.esgsc-opt {
	display: flex; align-items: center; gap: .7rem; text-align: left; width: 100%;
	border: 1px solid var(--esgsc-line); background: #fff; border-radius: 8px; padding: .55rem .7rem;
	cursor: pointer; font-family: inherit; font-size: .95rem; color: var(--esgsc-ink); transition: all .12s ease;
}
.esgsc-opt:hover { border-color: var(--esgsc-green2); background: #FAFCFB; }
.esgsc-opt__v {
	width: 30px; height: 30px; border-radius: 7px; flex: 0 0 auto; display: flex; align-items: center;
	justify-content: center; font-weight: bold; background: var(--esgsc-light); color: var(--esgsc-ink); font-size: .9rem;
}
.esgsc-opt--v2 .esgsc-opt__v { background: #DCEFE2; color: #2E7D52; }
.esgsc-opt--v1 .esgsc-opt__v { background: #FBF1D6; color: #B07A1E; }
.esgsc-opt--v0 .esgsc-opt__v { background: #F7DEDA; color: #C0392B; }
.esgsc-opt--na .esgsc-opt__v { background: #E6EBE8; color: var(--esgsc-grey); }
.esgsc-opt.is-on { border-color: var(--esgsc-green); box-shadow: 0 0 0 2px rgba(31,78,61,.15); background: #F4F9F6; }
.esgsc-opt.is-on .esgsc-opt__v { outline: 2px solid currentColor; outline-offset: 1px; }

/* --- Pulsanti info per domanda --- */
.esgsc-q__info { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 .8rem; }
.esgsc-infobtn {
	display: inline-flex; align-items: center; gap: .4rem; cursor: pointer;
	border: 1px solid var(--esgsc-line); background: #fff; color: var(--esgsc-green2);
	font-family: inherit; font-size: .83rem; padding: .32rem .7rem; border-radius: 999px; transition: all .12s ease;
}
.esgsc-infobtn:hover { border-color: var(--esgsc-green2); background: #F4F9F6; }
.esgsc-infobtn__ic {
	display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px;
	border-radius: 50%; background: var(--esgsc-green2); color: #fff; font-size: .7rem; font-weight: bold; line-height: 1;
}
.esgsc-infobtn--book { color: #8A6D1B; }
.esgsc-infobtn--book:hover { border-color: #C9A227; background: #FBF7EA; }
.esgsc-infobtn--book .esgsc-infobtn__ic { background: #C9A227; }

/* --- Modal --- */
.esgsc-modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.esgsc-modal[hidden] { display: none; }
.esgsc-modal__backdrop { position: absolute; inset: 0; background: rgba(20, 35, 28, .55); }
.esgsc-modal__dialog {
	position: relative; background: #fff; color: var(--esgsc-ink); max-width: 560px; width: 100%;
	max-height: 85vh; overflow: auto; border-radius: 14px; padding: 1.4rem 1.5rem;
	box-shadow: 0 18px 50px rgba(0,0,0,.28); border-top: 5px solid var(--esgsc-green2);
	font-family: Georgia, "Times New Roman", serif;
}
.esgsc-modal--book .esgsc-modal__dialog { border-top-color: #C9A227; }
.esgsc-modal__head { display: flex; align-items: flex-start; gap: .6rem; margin-bottom: .6rem; }
.esgsc-modal__qid {
	flex: 0 0 auto; background: var(--esgsc-green2); color: #fff; font-weight: bold; font-size: .82rem;
	padding: .18rem .5rem; border-radius: 6px; margin-top: .15rem;
}
.esgsc-modal--book .esgsc-modal__qid { background: #C9A227; }
.esgsc-modal__title { margin: 0; font-size: 1.12rem; color: var(--esgsc-green); flex: 1; line-height: 1.25; }
.esgsc-modal--book .esgsc-modal__title { color: #8A6D1B; }
.esgsc-modal__close {
	flex: 0 0 auto; appearance: none; border: 0; background: transparent; cursor: pointer;
	font-size: 1.7rem; line-height: 1; color: var(--esgsc-grey); padding: 0 .2rem;
}
.esgsc-modal__close:hover { color: var(--esgsc-ink); }
.esgsc-modal__q { font-size: .95rem; font-style: italic; color: var(--esgsc-grey); margin: 0 0 .9rem; padding-bottom: .8rem; border-bottom: 1px solid var(--esgsc-line); }
.esgsc-modal__body { font-size: 1rem; line-height: 1.6; }
.esgsc-modal__body p { margin: 0 0 .8rem; }
.esgsc-modal__body p:last-child { margin-bottom: 0; }
.esgsc-modal__book { background: #FBF7EA; border-left: 4px solid #C9A227; border-radius: 0 8px 8px 0; padding: .8rem 1rem; }

.esgsc-reading-key { margin-top: 1.3rem; background: #F4F9F6; border: 1px dashed var(--esgsc-green2); border-radius: 10px; padding: .9rem 1rem; font-size: .95rem; }

/* --- Nav --- */
.esgsc-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.4rem; }
.esgsc-nav__status { font-size: .85rem; color: var(--esgsc-grey); }

/* --- Loading --- */
.esgsc-screen--loading { text-align: center; padding: 3rem 0; color: var(--esgsc-grey); }
.esgsc-spinner { width: 42px; height: 42px; border: 4px solid var(--esgsc-line); border-top-color: var(--esgsc-green); border-radius: 50%; margin: 0 auto 1rem; animation: esgsc-spin 1s linear infinite; }
@keyframes esgsc-spin { to { transform: rotate(360deg); } }

/* --- Result --- */
.esgsc-result__eyebrow { color: var(--esgsc-green2); font-weight: bold; text-transform: uppercase; letter-spacing: .04em; font-size: .8rem; }
.esgsc-result__title { color: var(--esgsc-green); font-size: 1.7rem; margin: .2rem 0 .3rem; }
.esgsc-result__meta { color: var(--esgsc-grey); font-size: .9rem; margin: 0 0 1.4rem; }

.esgsc-gauges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.6rem; }
.esgsc-gauge { text-align: center; border: 1px solid var(--esgsc-line); border-radius: 12px; padding: 1rem .6rem .9rem; background: #fff; }
.esgsc-gauge--primary { border-color: var(--esgsc-green); background: #FAFCFB; }
.esgsc-gauge svg { width: 100%; max-width: 150px; height: auto; }
.esgsc-gauge__val { font-size: 22px; font-weight: bold; font-family: Georgia, serif; }
.esgsc-gauge__label { font-size: .88rem; margin-top: .2rem; }
.esgsc-gauge__band { font-size: .85rem; font-weight: bold; }

.esgsc-read { margin-bottom: 1.1rem; }
.esgsc-read h4 { margin: 0 0 .25rem; color: var(--esgsc-green2); font-size: 1.02rem; }
.esgsc-read p { margin: 0; }

.esgsc-flags { background: #FBECEC; border-left: 4px solid #C0392B; border-radius: 0 10px 10px 0; padding: 1rem 1.1rem; margin: 1.2rem 0; }
.esgsc-flags__title { font-weight: bold; color: #C0392B; margin-bottom: .4rem; }
.esgsc-flags ul { margin: 0; padding-left: 1.1rem; }
.esgsc-flags li { margin-bottom: .3rem; font-size: .94rem; }

.esgsc-sections { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin: 1.4rem 0; }
.esgsc-sec { border: 1px solid var(--esgsc-line); border-radius: 10px; padding: .9rem 1rem; }
.esgsc-sec__top { display: flex; align-items: center; gap: .6rem; }
.esgsc-sec__letter { width: 30px; height: 30px; border-radius: 7px; color: #fff; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.esgsc-sec__name { font-weight: bold; }
.esgsc-sec__pct { margin-left: auto; font-weight: bold; color: var(--esgsc-c); }
.esgsc-sec__bar { height: 8px; background: var(--esgsc-line); border-radius: 6px; overflow: hidden; margin: .6rem 0 .4rem; }
.esgsc-sec__bar span { display: block; height: 100%; border-radius: 6px; }
.esgsc-sec__meta { font-size: .83rem; color: var(--esgsc-grey); }

.esgsc-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 1.4rem 0 1rem; }
.esgsc-sent { font-size: .9rem; color: #2E7D52; }
.esgsc-sent--warn { color: #C0392B; }
.esgsc-disclaimer { font-size: .82rem; color: var(--esgsc-grey); border-top: 1px solid var(--esgsc-line); padding-top: 1rem; margin-top: 1.4rem; }

@media (max-width: 640px) {
	.esgsc-gauges { grid-template-columns: 1fr; }
	.esgsc-sections { grid-template-columns: 1fr; }
	.esgsc-h2 { font-size: 1.55rem; }
	.esgsc-nav { flex-wrap: wrap; }
	.esgsc-nav__status { order: 3; width: 100%; text-align: center; }
}
