/**
 * AI Saree Virtual Try-On — front-end styles.
 * Every selector is namespaced with .aivton- ; no global element rules.
 */

.aivton-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	margin: 12px 0;
	padding: 14px 26px;
	border: 0;
	border-radius: 999px;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1.2;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.aivton-trigger--gradient {
	color: #fff;
	background: linear-gradient(135deg, #b4185c 0%, #d4348a 50%, #f0a35e 100%);
	box-shadow: 0 8px 20px rgba(180, 24, 92, 0.28);
}

.aivton-trigger--solid {
	color: #fff;
	background: #17151a;
}

.aivton-trigger--outline {
	color: #b4185c;
	background: transparent;
	border: 2px solid #b4185c;
}

.aivton-trigger:hover {
	transform: translateY(-1px);
	opacity: 0.95;
}

.aivton-trigger:focus-visible {
	outline: 3px solid #f0a35e;
	outline-offset: 2px;
}

/* Overlay */
.aivton-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(18, 12, 20, 0.72);
	backdrop-filter: blur(4px);
	overflow-y: auto;
}

.aivton-overlay[hidden] {
	display: none;
}

.aivton-modal {
	position: relative;
	width: 100%;
	max-width: 880px;
	max-height: 92vh;
	overflow-y: auto;
	border-radius: 22px;
	padding: 32px 28px 28px;
	background: #fffdfb;
	color: #211b23;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
	font-family: inherit;
}

.aivton-overlay--dark .aivton-modal {
	background: #191319;
	color: #f6eef3;
}

.aivton-close {
	position: absolute;
	top: 12px;
	right: 14px;
	width: 38px;
	height: 38px;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.06);
	color: inherit;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.aivton-overlay--dark .aivton-close {
	background: rgba(255, 255, 255, 0.12);
}

.aivton-close:focus-visible {
	outline: 3px solid #d4348a;
	outline-offset: 2px;
}

.aivton-header {
	text-align: center;
	margin-bottom: 22px;
}

.aivton-title {
	margin: 0 0 6px;
	font-size: 26px;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.aivton-subtitle {
	margin: 0;
	font-size: 15px;
	opacity: 0.72;
}

.aivton-grid {
	display: grid;
	grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
	gap: 26px;
	align-items: start;
}

.aivton-garment {
	margin: 0;
	text-align: center;
}

.aivton-garment img {
	width: 100%;
	border-radius: 16px;
	object-fit: cover;
	aspect-ratio: 3 / 4;
	background: rgba(0, 0, 0, 0.04);
}

.aivton-garment figcaption {
	margin-top: 10px;
	font-size: 14px;
	font-weight: 600;
}

.aivton-h3 {
	margin: 0 0 10px;
	font-size: 16px;
	font-weight: 700;
}

.aivton-dropzone {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 26px 16px;
	border: 2px dashed rgba(180, 24, 92, 0.45);
	border-radius: 16px;
	background: rgba(212, 52, 138, 0.05);
	cursor: pointer;
	text-align: center;
}

.aivton-dropzone:hover,
.aivton-dropzone.is-dragover {
	border-color: #b4185c;
	background: rgba(212, 52, 138, 0.1);
}

.aivton-dropzone:focus-within {
	outline: 3px solid #d4348a;
	outline-offset: 2px;
}

.aivton-dropzone__icon {
	font-size: 26px;
}

.aivton-dropzone__label {
	font-weight: 600;
}

.aivton-dropzone__hint {
	font-size: 12px;
	opacity: 0.7;
}

.aivton-file {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	overflow: hidden;
}

.aivton-preview {
	display: block;
	width: 120px;
	margin: 12px 0 0;
	border-radius: 12px;
	object-fit: cover;
	aspect-ratio: 3 / 4;
}

.aivton-hint {
	margin: 10px 0 0;
	font-size: 13px;
	opacity: 0.72;
}

.aivton-consent {
	display: flex;
	gap: 9px;
	align-items: flex-start;
	margin: 14px 0 6px;
	font-size: 13px;
	line-height: 1.45;
	cursor: pointer;
}

.aivton-consent input {
	margin-top: 3px;
	flex: none;
}

.aivton-quota {
	margin: 4px 0 0;
	font-size: 13px;
	opacity: 0.85;
}

.aivton-error {
	margin: 12px 0 0;
	padding: 10px 12px;
	border-radius: 10px;
	background: rgba(200, 30, 40, 0.1);
	color: #9d1420;
	font-size: 13px;
}

.aivton-overlay--dark .aivton-error {
	color: #ffb3ba;
}

.aivton-error[hidden] {
	display: none;
}

.aivton-primary,
.aivton-secondary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 16px;
	padding: 14px 24px;
	border: 0;
	border-radius: 999px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
}

.aivton-primary {
	width: 100%;
	color: #fff;
	background: linear-gradient(135deg, #b4185c, #d4348a);
}

.aivton-primary[disabled] {
	opacity: 0.55;
	cursor: not-allowed;
}

.aivton-secondary {
	color: inherit;
	background: rgba(0, 0, 0, 0.07);
}

.aivton-overlay--dark .aivton-secondary {
	background: rgba(255, 255, 255, 0.12);
}

.aivton-primary:focus-visible,
.aivton-secondary:focus-visible {
	outline: 3px solid #f0a35e;
	outline-offset: 2px;
}

/* Loading */
.aivton-step--loading {
	text-align: center;
	padding: 40px 10px;
}

.aivton-spinner {
	width: 46px;
	height: 46px;
	margin: 0 auto 16px;
	border: 4px solid rgba(180, 24, 92, 0.2);
	border-top-color: #b4185c;
	border-radius: 50%;
	animation: aivton-spin 0.9s linear infinite;
}

@keyframes aivton-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.aivton-spinner {
		animation-duration: 3s;
	}
}

.aivton-loading-text {
	margin: 0;
	font-weight: 600;
}

/* Result */
.aivton-compare {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	gap: 14px;
	align-items: center;
}

.aivton-compare figure {
	margin: 0;
	text-align: center;
}

.aivton-compare img {
	width: 100%;
	border-radius: 16px;
	object-fit: cover;
	aspect-ratio: 3 / 4;
	background: rgba(0, 0, 0, 0.05);
}

.aivton-compare figcaption {
	margin-top: 8px;
	font-size: 13px;
	font-weight: 600;
	opacity: 0.8;
}

.aivton-vs {
	font-weight: 700;
	font-size: 13px;
	opacity: 0.55;
}

.aivton-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
}

.aivton-actions .aivton-primary {
	width: auto;
}

/* My account */
.aivton-account__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 18px;
}

.aivton-account__card img {
	width: 100%;
	border-radius: 12px;
	aspect-ratio: 3 / 4;
	object-fit: cover;
}

.aivton-account__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 3 / 4;
	border-radius: 12px;
	background: rgba(0, 0, 0, 0.06);
	font-size: 13px;
	opacity: 0.7;
}

.aivton-account__name {
	margin: 8px 0 2px;
	font-size: 14px;
	font-weight: 600;
}

.aivton-account__date {
	margin: 0;
	font-size: 12px;
	opacity: 0.7;
}

.aivton-account__error {
	margin: 6px 0 0;
	font-size: 12px;
	color: #9d1420;
}

/* Responsive */
@media (max-width: 820px) {
	.aivton-grid {
		grid-template-columns: 1fr;
	}

	.aivton-garment img {
		max-width: 260px;
		margin: 0 auto;
	}
}

@media (max-width: 560px) {
	.aivton-modal {
		padding: 26px 16px 20px;
		border-radius: 16px;
	}

	.aivton-title {
		font-size: 21px;
	}

	.aivton-compare {
		grid-template-columns: 1fr;
	}

	.aivton-vs {
		padding: 4px 0;
	}

	.aivton-actions .aivton-primary,
	.aivton-actions .aivton-secondary {
		width: 100%;
	}
}

.aivton-buy {
	display: inline-block;
	margin: 0 0 12px;
	padding: 8px 14px;
	border: 1px solid currentColor;
	border-radius: 999px;
	font-weight: 600;
	text-decoration: none;
}
.aivton-buy[hidden] { display: none; }
