/* Xerador de Contrasinais
   Todo vai dentro de .xc para non tocar o tema. A tipografía hérdase do tema;
   os bordos e os fondos calcúlanse a partir da cor do texto (--xc-text).
   Para cambiar a cor principal, define --xc-accent no CSS adicional do tema:
   .xc { --xc-accent: #c0392b; }                                            */

.xc {
	--xc-accent: #1a1c1e;
	--xc-accent-hover: #3a3c3e;
	--xc-accent-fg: #ffffff;
	--xc-line: color-mix(in srgb, currentColor 18%, transparent);
	--xc-soft: color-mix(in srgb, currentColor 5%, transparent);
	--xc-text: #1a1c1e;
	--xc-muted: #55585c;
	--xc-weak: #c0392b;
	--xc-fair: #c98a0b;
	--xc-good: #5a9a2f;
	--xc-strong: #1f8a55;
	--xc-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

	display: grid;
	gap: 20px;
	max-width: 640px;
	margin: 0 auto;
	font-family: inherit;
	color: var(--xc-text);
}
.xc *, .xc *::before, .xc *::after { box-sizing: border-box; }

.xc-card {
	display: grid;
	gap: 16px;
	padding: 20px;
	border: 1px solid var(--xc-line);
	border-radius: 12px;
	background: var(--xc-soft);
}

.xc-field-label { display: block; margin: 0 0 -8px; font-size: 0.85em; color: var(--xc-muted); }

.xc-pw-wrap { position: relative; }
.xc .xc-pw {
	width: 100%;
	margin: 0;
	padding: 14px 96px 14px 16px;
	font-family: var(--xc-mono);
	font-size: 1.25rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	line-height: 1.4;
	color: inherit;
	background: transparent;
	border: 1px solid var(--xc-line);
	border-radius: 8px;
	box-shadow: none;
}
.xc .xc-pw::placeholder { color: var(--xc-muted); font-family: inherit; font-size: 1rem; letter-spacing: 0; }

.xc .xc-btn {
	margin: 0;
	padding: 10px 18px;
	font: inherit;
	font-weight: 600;
	line-height: 1.3;
	text-transform: none;
	letter-spacing: normal;
	color: inherit;
	background: transparent;
	border: 1px solid var(--xc-line);
	border-radius: 8px;
	box-shadow: none;
	opacity: 1; /* o tema pon os botóns semitransparentes ao pasar o rato */
	cursor: pointer;
}
.xc .xc-btn:hover { background: var(--xc-soft); }
.xc .xc-primary {
	flex: 1;
	min-width: 160px;
	color: var(--xc-accent-fg);
	background: var(--xc-accent);
	border-color: var(--xc-accent);
}
.xc .xc-primary:hover { background: var(--xc-accent-hover); border-color: var(--xc-accent-hover); }
.xc .xc-toggle {
	position: absolute;
	top: 50%;
	right: 8px;
	transform: translateY(-50%);
	padding: 6px 10px;
	font-size: 0.8em;
	font-weight: 500;
}
.xc .xc-btn:focus-visible, .xc input:focus-visible { outline: 2px solid var(--xc-accent); outline-offset: 2px; }

.xc-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.xc-toast { min-height: 1.3em; margin: -6px 0 0; font-size: 0.85em; color: var(--xc-strong); }
.xc-err { color: var(--xc-weak); }

.xc-verdict { display: grid; gap: 8px; }
.xc-verdict-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; }
.xc-badge {
	padding: 3px 12px;
	font-size: 0.95em;
	font-weight: 600;
	color: var(--xc-muted);
	border: 1.5px solid currentColor;
	border-radius: 999px;
}
.xc-crack { font-size: 0.85em; color: var(--xc-muted); font-variant-numeric: tabular-nums; }
.xc-meter { height: 6px; overflow: hidden; border-radius: 3px; background: var(--xc-line); }
.xc-meter span { display: block; width: 0; height: 100%; background: var(--xc-muted); transition: width .2s, background .2s; }
.xc-facts { margin: 0; font-size: 0.85em; color: var(--xc-muted); font-variant-numeric: tabular-nums; }
.xc-tips { display: grid; gap: 2px; margin: 0; padding-left: 1.2em; font-size: 0.9em; }
.xc-tips:empty { display: none; }

.xc-heading {
	margin: 0;
	font-size: 0.8em;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--xc-muted);
}
.xc-len { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 14px; }
.xc-len label { font-weight: 500; }
.xc-len output { min-width: 2.5ch; font-family: var(--xc-mono); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.xc-len input { grid-column: 1 / -1; width: 100%; margin: 0; accent-color: var(--xc-accent); }

.xc-sets { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.xc-opt {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	min-width: 0;
	margin: 0;
	padding: 10px 12px;
	border: 1px solid var(--xc-line);
	border-radius: 8px;
	cursor: pointer;
}
.xc-opt input { margin: 4px 0 0; accent-color: var(--xc-accent); }
.xc-opt b { display: block; font-weight: 500; }
.xc-opt code {
	padding: 0;
	font-family: var(--xc-mono);
	font-size: 0.85em;
	color: var(--xc-muted);
	background: none;
	word-break: break-all;
}

.xc-note { margin: 0; font-size: 0.85em; color: var(--xc-muted); }

@media (prefers-reduced-motion: reduce) { .xc-meter span { transition: none; } }
