/* Interfibras Avatar - site. Personalize pelas variáveis abaixo no CSS do tema:
   .ifa-app { --ifa-primary: #c00; --ifa-max: 520px; } */
.ifa-app {
	--ifa-primary: #1e6fd9;
	--ifa-primary-text: #fff;
	--ifa-radius: 10px;
	--ifa-max: 480px;
	box-sizing: border-box;
	max-width: var(--ifa-max);
	margin: 0 auto;
	position: relative;
}

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

.ifa-app [hidden] {
	display: none !important;
}

.ifa-section {
	margin: 0 0 1.5em;
}

.ifa-title {
	text-align: center;
	margin: 0 0 .75em;
}

.ifa-label {
	font-weight: 700;
	margin: 0 0 .6em;
}

.ifa-hint {
	font-size: .875em;
	opacity: .75;
	margin: .6em 0 0;
}

/* Botões */
.ifa-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5em;
	padding: .8em 1.25em;
	min-height: 48px;
	border-radius: var(--ifa-radius);
	border: 2px solid var(--ifa-primary);
	background: #fff;
	color: var(--ifa-primary);
	font: inherit;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	text-align: center;
	text-decoration: none !important;
	transition: filter .15s, transform .05s;
	-webkit-tap-highlight-color: transparent;
}

.ifa-btn-primary {
	background: var(--ifa-primary);
	color: var(--ifa-primary-text);
}

.ifa-btn:hover,
.ifa-btn:focus-visible,
.ifa-btn:focus-within {
	filter: brightness(.93);
}

.ifa-btn:active {
	transform: translateY(1px);
}

.ifa-btn:disabled {
	opacity: .6;
	cursor: wait;
}

.ifa-btn svg {
	width: 1.25em;
	height: 1.25em;
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.ifa-btn input[type="file"] {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.ifa-upload-buttons,
.ifa-actions {
	display: flex;
	flex-wrap: wrap;
	gap: .75em;
}

.ifa-upload-buttons .ifa-btn,
.ifa-actions .ifa-btn {
	flex: 1 1 180px;
}

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

/* Escolha de moldura */
.ifa-frames-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
	gap: .75em;
}

.ifa-frame-option {
	position: relative;
	display: block;
	cursor: pointer;
	text-align: center;
	margin: 0;
}

.ifa-frame-option input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.ifa-frame-thumb {
	display: block;
	aspect-ratio: 1 / 1;
	border-radius: var(--ifa-radius);
	overflow: hidden;
	border: 3px solid #ddd;
	background-color: #fff;
	background-image:
		linear-gradient(45deg, #e6e6e6 25%, transparent 25%),
		linear-gradient(-45deg, #e6e6e6 25%, transparent 25%),
		linear-gradient(45deg, transparent 75%, #e6e6e6 75%),
		linear-gradient(-45deg, transparent 75%, #e6e6e6 75%);
	background-size: 16px 16px;
	background-position: 0 0, 0 8px, 8px -8px, -8px 0;
	transition: border-color .15s;
}

.ifa-frame-thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.ifa-frame-option input:checked + .ifa-frame-thumb {
	border-color: var(--ifa-primary);
	box-shadow: 0 0 0 2px rgba(0, 0, 0, .06);
}

.ifa-frame-option input:focus-visible + .ifa-frame-thumb {
	outline: 2px solid var(--ifa-primary);
	outline-offset: 2px;
}

.ifa-frame-name {
	display: block;
	font-size: .875em;
	margin-top: .35em;
}

/* Editor */
.ifa-canvas-wrap {
	width: 100%;
	border-radius: var(--ifa-radius);
	overflow: hidden;
	background: #eee;
	box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
}

.ifa-canvas {
	display: block;
	width: 100%;
	height: auto;
	touch-action: none;
	cursor: grab;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
}

.ifa-canvas:active {
	cursor: grabbing;
}

.ifa-canvas:focus-visible {
	outline: 3px solid var(--ifa-primary);
	outline-offset: -3px;
}

.ifa-zoom-label {
	display: flex;
	align-items: center;
	gap: .75em;
	margin: .75em 0 1em;
	font-weight: 700;
}

.ifa-zoom {
	flex: 1;
	min-width: 120px;
	accent-color: var(--ifa-primary);
	margin: 0;
}

/* Resultado */
.ifa-result-img {
	display: block;
	width: 100%;
	height: auto;
	margin: 0 auto 1em;
	border-radius: var(--ifa-radius);
	box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
}

/* Erros */
.ifa-error {
	margin-top: 1em;
	padding: .75em 1em;
	border-radius: var(--ifa-radius);
	background: #fdecea;
	color: #8a1c1c;
	border: 1px solid #f5c2c0;
}

.ifa-app--empty {
	padding: 1em;
	border: 1px dashed #c33;
	border-radius: var(--ifa-radius, 10px);
	color: #822;
	background: #fff6f6;
}
