/**
 * Front-end styling for Utilities: Security & Crypto (password tool + hash
 * calculator). Loaded only on pages containing the relevant shortcode via
 * utilities_core_enqueue_for_shortcode().
 */

.util-security-tool {
	max-width: 640px;
	margin: 1.5em 0;
	font-size: 15px;
}

.util-security-tool h3 {
	margin-top: 0;
	margin-bottom: 0.5em;
}

.util-security-tool hr {
	margin: 1.5em 0;
	border: none;
	border-top: 1px solid #ddd;
}

.util-field-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 10px;
	flex-wrap: wrap;
}

.util-checkbox-row label {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-right: 12px;
}

.util-security-tool input[type="text"],
.util-security-tool input[type="number"],
.util-security-tool textarea,
.util-security-tool select {
	padding: 6px 8px;
	border: 1px solid #8c8f94;
	border-radius: 4px;
	font-size: 14px;
}

.util-password-checker-input,
.util-generated-password {
	flex: 1 1 auto;
	min-width: 0;
	font-family: Consolas, Monaco, monospace;
}

.util-password-length-slider {
	flex: 1 1 auto;
}

.util-password-length-number {
	width: 70px;
}

/* Strength meter */

.util-strength-meter {
	margin-top: 8px;
}

.util-strength-bar-track {
	height: 8px;
	border-radius: 4px;
	background: #e2e4e7;
	overflow: hidden;
}

.util-strength-bar-fill {
	height: 100%;
	width: 0%;
	border-radius: 4px;
	background: #d63638;
	transition: width 0.2s ease, background-color 0.2s ease;
}

.util-strength-bar-fill.util-strength-weak {
	background: #d63638;
}

.util-strength-bar-fill.util-strength-fair {
	background: #dba617;
}

.util-strength-bar-fill.util-strength-good {
	background: #cbb400;
}

.util-strength-bar-fill.util-strength-strong {
	background: #4ab866;
}

.util-strength-bar-fill.util-strength-excellent {
	background: #008a20;
}

.util-strength-label {
	margin-top: 4px;
	font-weight: 600;
	font-size: 13px;
}

.util-strength-breakdown {
	margin: 8px 0 0;
	padding-left: 1.1em;
	font-size: 13px;
	color: #3c434a;
}

.util-strength-breakdown li {
	margin-bottom: 3px;
}

.util-strength-breakdown li.util-flag-warning {
	color: #d63638;
}

.util-strength-breakdown li.util-flag-ok {
	color: #008a20;
}

.util-inline-error {
	color: #d63638;
	font-size: 13px;
	margin-top: 6px;
}

/* Hash calculator */

.util-hash-mode-toggle {
	margin-bottom: 14px;
}

.util-hash-mode-btn.is-active {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
}

.util-hash-input-block {
	margin-bottom: 12px;
}

.util-hash-input-block textarea {
	width: 100%;
	box-sizing: border-box;
	font-family: Consolas, Monaco, monospace;
}

.util-hash-or {
	font-style: italic;
	color: #646970;
}

.util-hash-filename {
	font-size: 12px;
	color: #646970;
	margin: 2px 0 0;
}

.util-hash-results-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 10px;
}

.util-hash-results-table th {
	text-align: left;
	padding: 6px 10px 6px 0;
	width: 90px;
	vertical-align: top;
	font-weight: 600;
}

.util-hash-results-table td {
	padding: 6px 0;
	display: flex;
	align-items: center;
	gap: 8px;
}

.util-hash-output {
	flex: 1 1 auto;
	min-width: 0;
	word-break: break-all;
	background: #f6f7f7;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 13px;
}

.util-hash-algo-toggles {
	margin: 6px 0 10px;
	font-size: 13px;
}

.util-hash-algo-toggles label {
	margin-right: 12px;
}

.util-hash-status {
	font-size: 13px;
	color: #646970;
	min-height: 1.2em;
}

.util-hash-compare-columns {
	display: flex;
	gap: 16px;
}

.util-hash-compare-columns .util-hash-input-block {
	flex: 1 1 50%;
	min-width: 0;
}

.util-hash-compare-result {
	margin-top: 10px;
	padding: 10px 12px;
	border-radius: 4px;
	font-weight: 600;
}

.util-hash-compare-result.util-compare-match {
	background: #edfaef;
	color: #008a20;
	border: 1px solid #b8e6c1;
}

.util-hash-compare-result.util-compare-no-match {
	background: #fcf0f1;
	color: #d63638;
	border: 1px solid #f1c6c8;
}

@media (max-width: 480px) {
	.util-hash-compare-columns {
		flex-direction: column;
	}
}
