/**
 * Stili front-end del plugin, indipendenti dal tema.
 * Coprono la dashboard "Tuoi Software", i badge licenza in pagina prodotto
 * e i campi SDD al checkout.
 */

/* ----- Dashboard "Tuoi Software" -----
 * Allineata al design system del sito: font IBM Plex, accent #E8521C,
 * palette "ink", card bianche con bordo #DCE5E9 / radius 4px / shadow morbida.
 */
.sga-applications {
	--sga-accent: #E8521C;
	--sga-ink-900: #1A1F23;
	--sga-ink-700: #3A4047;
	--sga-ink-500: #6A7178;
	--sga-ink-100: #DCE5E9;
	--sga-bg: #EEF4F6;
	font-family: 'IBM Plex Sans', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	color: var(--sga-ink-700);
	margin-top: 1em;
}
.sga-applications .sga-welcome {
	font-size: 13px;
	color: var(--sga-ink-500);
	margin: 0 0 6px;
}
.sga-applications .sga-welcome a {
	color: var(--sga-accent);
}
.sga-applications .sga-title {
	font-family: 'IBM Plex Sans', system-ui, sans-serif;
	color: var(--sga-ink-900);
	font-size: 30px;
	font-weight: 700;
	line-height: 1.15;
	margin: 0 0 2px;
}
.sga-applications .sga-intro {
	font-size: 14px;
	color: var(--sga-ink-500);
	margin: 0 0 18px;
}
.sga-applications .sga-warning {
	font-size: 13px;
	line-height: 1.5;
	color: var(--sga-ink-700);
	background: #fff5f1;
	border-left: 3px solid var(--sga-accent);
	border-radius: 4px;
	padding: 12px 14px;
	margin: 0 0 32px;
}
.sga-applications .sga-warning strong {
	color: var(--sga-ink-900);
}

/* Override spacing del widget Elementor "My Account": l'h2/h3 nativo ha un
 * margine inferiore che allontana il titolo dal sottotitolo, e l'ultimo
 * paragrafo (l'avviso) va distanziato dalla prima card. */
.sga-title {
	margin-bottom: 0 !important;
}
.sga-warning {
	margin-bottom: 40px !important;
}

/* Lista card */
.sga-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.sga-card {
	display: grid;
	grid-template-columns: minmax(0, 250px) 150px minmax(0, 1fr);
	align-items: center;
	gap: 10px 24px;
	background: #fff;
	border: 1px solid var(--sga-ink-100);
	border-radius: 4px;
	padding: 18px 22px;
	box-shadow: 0 8px 24px rgba(26, 22, 18, .05);
}
.sga-card__main {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 5px;
}
.sga-card__name {
	font-size: 16px;
	font-weight: 600;
	color: var(--sga-accent);
	line-height: 1.2;
}
.sga-card__subjects {
	font-size: 13px;
	color: var(--sga-ink-500);
}
.sga-card__subjects strong {
	color: var(--sga-ink-900);
	font-weight: 700;
}
.sga-card__subjects-extra {
	color: var(--sga-ink-500);
}
.sga-card__status {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
}
.sga-card__exp {
	font-family: 'IBM Plex Mono', ui-monospace, monospace;
	font-size: 11px;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--sga-ink-500);
}
.sga-card__action {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	justify-content: flex-end;
}
.sga-note {
	font-size: 12.5px;
	line-height: 1.5;
	color: var(--sga-ink-500);
	max-width: 260px;
}

/* Stato licenza come badge (radius 4px, mono, come i badge del sito) */
.sga-status {
	display: inline-block;
	font-family: 'IBM Plex Mono', ui-monospace, monospace;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	padding: 5px 10px;
	border-radius: 4px;
	white-space: nowrap;
}
.sga-status.sga-active {
	background: #dcfce7;
	color: #15803d;
}
.sga-status.sga-expiring {
	background: #fef3c7;
	color: #92600a;
}
.sga-status.sga-expired {
	background: #fee2e2;
	color: #b91c1c;
}
.sga-status.sga-cancelled {
	background: var(--sga-bg);
	color: var(--sga-ink-500);
}

@media (max-width: 700px) {
	.sga-card {
		grid-template-columns: 1fr;
		align-items: flex-start;
	}
	.sga-card__action {
		justify-content: flex-start;
	}
}

/* Badge in pagina prodotto */
.sga-license-badge {
	margin: 1em 0;
	padding: 0.75em 1em;
	border-radius: 6px;
	background: #f7f7f7;
}
.sga-license-badge h2 {
	margin: 0 0 0.3em;
	font-size: 1.2em;
}
.sga-license-badge h2.sga-expired {
	color: #c00;
	background: none;
}
.sga-license-badge h2.sga-active {
	color: #2e7d32;
	background: none;
}
.sga-license-status.sga-valid {
	color: #2e7d32;
}
.sga-license-status.sga-expired {
	color: #c00;
	background: none;
}

/* Pulsanti (stile bottoni del sito: radius 4px, accent #E8521C) */
.sga-btn,
.sga-renew {
	display: inline-block;
	padding: 10px 16px;
	border: 1px solid #E8521C;
	border-radius: 4px;
	background: #E8521C;
	color: #fff !important;
	text-decoration: none;
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	transition: filter .15s;
}
.sga-btn:hover,
.sga-renew:hover {
	filter: brightness(.92);
}
/* Variante "ghost" (es. Annulla): contorno, non pieno */
.sga-btn--ghost,
.sga-cancel {
	background: #fff;
	color: #E8521C !important;
	border-color: #DCE5E9;
}
.sga-btn--ghost:hover,
.sga-cancel:hover {
	filter: none;
	border-color: #E8521C;
}
.sga-loading {
	opacity: 0.6;
}
.sga-admin-form {
	margin-top: 6px;
	display: inline-block;
}

/* Campi SDD al checkout */
.sga-sdd-fields {
	margin-top: 1em;
}
