/**
 * Favicon Generator — tool styles.
 *
 * Pure front-end tool (Canvas only, nothing is uploaded), so it lives in the
 * theme instead of a plugin. Uses the same design tokens as the 51web theme and
 * the WordPress Theme Checker plugin so both tools look like one family.
 *
 * @package 51web
 */

.w51f {
	--w51f-navy: #081631;
	--w51f-blue: #1e6ef5;
	--w51f-blue-400: #3b82f6;
	--w51f-text: #0f172a;
	--w51f-sub: #55647a;
	--w51f-line: #e5eaf2;
	--w51f-bg: #f5f8fc;
	--w51f-radius: 14px;
	--w51f-shadow: 0 10px 30px rgba(13, 38, 76, .08);

	max-width: 1080px;
	margin: 0 auto;
	color: var(--w51f-text);
	font-size: 16px;
	line-height: 1.65;
}

.w51f *,
.w51f *::before,
.w51f *::after {
	box-sizing: border-box;
}

/* ---------- Dropzone ---------- */

.w51f-drop {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 54px 24px;
	background: #fff;
	border: 2px dashed var(--w51f-line);
	border-radius: var(--w51f-radius);
	box-shadow: var(--w51f-shadow);
	text-align: center;
	cursor: pointer;
	transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.w51f-drop:hover {
	border-color: rgba(30, 110, 245, .5);
	background: rgba(30, 110, 245, .03);
}

.w51f-drop.is-over {
	border-color: var(--w51f-blue);
	background: rgba(30, 110, 245, .07);
	transform: scale(1.005);
}

.w51f-drop-icon {
	width: 54px;
	height: 54px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 14px;
	background: rgba(30, 110, 245, .1);
	color: var(--w51f-blue);
}

.w51f-drop-icon svg {
	width: 26px;
	height: 26px;
}

.w51f-drop-title {
	margin: 4px 0 0;
	font-size: 18px;
	font-weight: 700;
	color: var(--w51f-navy);
}

.w51f-drop-text {
	margin: 0;
	color: var(--w51f-sub);
	font-size: 14px;
}

.w51f-drop kbd {
	display: inline-block;
	padding: 1px 7px;
	border: 1px solid var(--w51f-line);
	border-bottom-width: 2px;
	border-radius: 5px;
	background: var(--w51f-bg);
	font-family: inherit;
	font-size: 12.5px;
	color: var(--w51f-navy);
}

/* ---------- Workspace ---------- */

.w51f-work[hidden] {
	display: none;
}

.w51f-grid {
	display: grid;
	grid-template-columns: 320px minmax(0, 1fr);
	gap: 22px;
	align-items: start;
}

.w51f-panel {
	background: #fff;
	border: 1px solid var(--w51f-line);
	border-radius: var(--w51f-radius);
	box-shadow: var(--w51f-shadow);
	padding: 20px;
}

.w51f-panel-title {
	margin: 0 0 14px;
	font-size: 15px;
	font-weight: 700;
	color: var(--w51f-navy);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

/* ---------- Source preview ---------- */

.w51f-stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	border-radius: 12px;
	background:
		linear-gradient(45deg, #eef2f8 25%, transparent 25%, transparent 75%, #eef2f8 75%),
		linear-gradient(45deg, #eef2f8 25%, #fff 25%, #fff 75%, #eef2f8 75%);
	background-size: 16px 16px;
	background-position: 0 0, 8px 8px;
}

.w51f-stage canvas {
	display: block;
	width: 192px;
	height: 192px;
	border-radius: 8px;
}

.w51f-meta {
	margin: 12px 0 0;
	color: var(--w51f-sub);
	font-size: 13px;
	overflow-wrap: anywhere;
}

.w51f-warn {
	display: none;
	margin: 12px 0 0;
	padding: 10px 13px;
	border-radius: 9px;
	background: rgba(181, 71, 8, .07);
	border: 1px solid rgba(181, 71, 8, .2);
	color: #7a3208;
	font-size: 13px;
}

.w51f-warn.show {
	display: block;
}

/* ---------- Options ---------- */

.w51f-opts {
	margin-top: 18px;
	padding-top: 18px;
	border-top: 1px dashed var(--w51f-line);
	display: grid;
	gap: 15px;
}

.w51f-field {
	display: grid;
	gap: 7px;
}

.w51f-field > label,
.w51f-field-label {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: var(--w51f-sub);
}

.w51f-row {
	display: flex;
	align-items: center;
	gap: 10px;
}

.w51f-row input[type="range"] {
	flex: 1 1 auto;
	min-width: 0;
	accent-color: var(--w51f-blue);
}

.w51f-num {
	flex: 0 0 46px;
	text-align: right;
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	color: var(--w51f-navy);
}

.w51f-color {
	width: 46px;
	height: 34px;
	padding: 2px;
	border: 1px solid var(--w51f-line);
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
}

.w51f-check {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13.5px;
	color: var(--w51f-text);
	cursor: pointer;
}

.w51f-check input {
	width: 16px;
	height: 16px;
	accent-color: var(--w51f-blue);
}

.w51f-seg {
	display: inline-flex;
	border: 1px solid var(--w51f-line);
	border-radius: 9px;
	overflow: hidden;
	background: var(--w51f-bg);
}

.w51f-seg button {
	padding: 8px 14px;
	border: 0;
	background: none;
	font: inherit;
	font-size: 13.5px;
	color: var(--w51f-sub);
	cursor: pointer;
}

.w51f-seg button[aria-pressed="true"] {
	background: #fff;
	color: var(--w51f-navy);
	font-weight: 600;
	box-shadow: inset 0 0 0 1px var(--w51f-line);
}

/* ---------- Size grid ---------- */

.w51f-sizes {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
	gap: 12px;
}

.w51f-size {
	position: relative;
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr);
	gap: 12px;
	align-items: center;
	padding: 12px;
	border: 1px solid var(--w51f-line);
	border-radius: 11px;
	background: #fff;
	cursor: pointer;
	transition: border-color .2s ease, background .2s ease;
}

.w51f-size:hover {
	border-color: rgba(30, 110, 245, .4);
}

.w51f-size input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.w51f-size.on {
	border-color: rgba(30, 110, 245, .55);
	background: rgba(30, 110, 245, .045);
}

.w51f-size canvas {
	display: block;
	width: 48px;
	height: 48px;
	border-radius: 6px;
}

.w51f-size-label {
	min-width: 0;
	display: grid;
	gap: 2px;
}

.w51f-size-label b {
	font-size: 14.5px;
	color: var(--w51f-navy);
}

.w51f-size-label span {
	font-size: 12px;
	color: var(--w51f-sub);
}

.w51f-tag {
	display: inline-block;
	padding: 1px 7px;
	border-radius: 99px;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: .03em;
	background: rgba(6, 118, 71, .1);
	color: #067647;
	border: 1px solid rgba(6, 118, 71, .22);
}

.w51f-size-dl {
	grid-column: 1 / -1;
	display: flex;
	justify-content: flex-end;
}

/* ---------- Buttons ---------- */

.w51f-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 20px;
	border: 1px solid transparent;
	border-radius: 10px;
	font: inherit;
	font-size: 14.5px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	white-space: nowrap;
	transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}

.w51f-btn.primary {
	background: linear-gradient(92deg, var(--w51f-blue), var(--w51f-blue-400));
	color: #fff;
	box-shadow: 0 8px 24px rgba(30, 110, 245, .3);
}

.w51f-btn.primary:hover:not(:disabled) {
	transform: translateY(-2px);
	box-shadow: 0 12px 30px rgba(30, 110, 245, .4);
}

.w51f-btn.outline {
	background: #fff;
	border-color: var(--w51f-line);
	color: var(--w51f-navy);
}

.w51f-btn.outline:hover:not(:disabled) {
	border-color: var(--w51f-blue);
	color: var(--w51f-blue);
	background: rgba(30, 110, 245, .05);
}

.w51f-btn.mini {
	padding: 6px 12px;
	font-size: 12.5px;
	border-color: var(--w51f-line);
	background: #fff;
	color: var(--w51f-navy);
}

.w51f-btn.mini:hover {
	border-color: var(--w51f-blue);
	color: var(--w51f-blue);
}

.w51f-btn:disabled {
	opacity: .6;
	cursor: progress;
	transform: none !important;
}

.w51f-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 18px;
	padding-top: 18px;
	border-top: 1px dashed var(--w51f-line);
}

.w51f-actions .w51f-btn {
	flex: 1 1 auto;
}

.w51f-swap {
	padding: 0;
	border: 0;
	background: none;
	color: var(--w51f-blue);
	font: inherit;
	font-size: 13px;
	cursor: pointer;
	border-bottom: 1px dashed rgba(30, 110, 245, .45);
	line-height: 1.8;
}

.w51f-swap:hover {
	color: var(--w51f-navy);
	border-bottom-color: var(--w51f-navy);
}

/* ---------- Code output ---------- */

.w51f-code {
	margin-top: 18px;
}

.w51f-code[hidden] {
	display: none;
}

.w51f-code textarea {
	width: 100%;
	min-height: 150px;
	padding: 13px 15px;
	border: 1px solid var(--w51f-line);
	border-radius: 10px;
	background: var(--w51f-bg);
	color: var(--w51f-navy);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 12.5px;
	line-height: 1.65;
	resize: vertical;
	white-space: pre;
}

.w51f-code-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 10px;
}

.w51f-code-head h4 {
	margin: 0;
	font-size: 15px;
	color: var(--w51f-navy);
}

/* ---------- Messages ---------- */

.w51f-msg {
	display: none;
	margin-top: 16px;
	padding: 13px 17px;
	border-radius: 10px;
	font-size: 14px;
	border: 1px solid transparent;
}

.w51f-msg.show {
	display: block;
}

.w51f-msg.info {
	background: rgba(30, 110, 245, .06);
	border-color: rgba(30, 110, 245, .22);
	color: #17417f;
}

.w51f-msg.err {
	background: rgba(220, 38, 38, .06);
	border-color: rgba(220, 38, 38, .25);
	color: #8c1d1d;
}

.w51f-msg.ok {
	background: rgba(6, 118, 71, .07);
	border-color: rgba(6, 118, 71, .25);
	color: #067647;
}

/* ---------- Notes ---------- */

.w51f-note {
	margin: 18px 0 0;
	color: var(--w51f-sub);
	font-size: 13px;
	line-height: 1.75;
}

.w51f-note strong {
	color: var(--w51f-navy);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {

	.w51f-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 560px) {

	.w51f-sizes {
		grid-template-columns: 1fr;
	}

	.w51f-actions .w51f-btn {
		flex-basis: 100%;
	}
}
