/* ==========================================================================
   MUN Delegate Hub - Inicio de sesion, registro y recuperacion de contrasena
   Reproduce src/pages/Auth.tsx y ResetPassword.tsx (y los componentes Input,
   Label y Alert de shadcn). Breakpoints de Tailwind: md 768px, lg 1024px.
   ========================================================================== */

/* ---- Controles de formulario ---- */

.mun-label {
	font-size: 0.875rem;
	line-height: 1;
	font-weight: 500;
}

.mun-input {
	display: flex;
	width: 100%;
	height: 2.5rem;
	padding: 0.5rem 0.75rem;
	border: 1px solid hsl(var(--input));
	border-radius: calc(var(--radius) - 2px);
	background-color: hsl(var(--background));
	color: inherit;
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.5rem;
}

.mun-input::placeholder {
	color: hsl(var(--muted-foreground));
}

.mun-input:focus-visible {
	outline: 2px solid transparent;
	outline-offset: 2px;
	box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}

.mun-input:disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

.mun-input--pr {
	padding-right: 2.75rem;
}

@media (min-width: 768px) {
	.mun-input { font-size: 0.875rem; line-height: 1.25rem; }
}

/* ---- Alertas (alert.tsx) ---- */

.mun-alert {
	position: relative;
	width: 100%;
	padding: 1rem;
	border: 1px solid hsl(var(--border));
	border-radius: 0.5rem;
}

.mun-alert__text {
	font-size: 0.875rem;
	line-height: 1.25rem;
}

.mun-alert--destructive {
	border-color: hsl(var(--destructive) / 0.5);
	color: hsl(var(--destructive));
}

.mun-alert--success {
	border-color: hsl(var(--success));
	background-color: hsl(var(--success) / 0.1);
	color: hsl(var(--success));
}

.mun-alert--primary {
	border-color: hsl(var(--primary));
	background-color: hsl(var(--primary) / 0.1);
	color: hsl(var(--primary));
}

/* alerta con icono a la izquierda (CheckCircle de la pagina de nueva contrasena) */
.mun-alert--icon .icon {
	position: absolute;
	top: 1rem;
	left: 1rem;
	width: 1rem;
	height: 1rem;
}

.mun-alert--icon .mun-alert__text {
	padding-left: 1.75rem;
	transform: translateY(-3px);
}

/* ---- Pagina y paneles ---- */

.auth-page {
	display: flex;
	min-height: 100vh;
	background-color: hsl(var(--background));
}

.auth-left {
	display: none;
	position: relative;
	flex-direction: column;
	justify-content: space-between;
	overflow: hidden;
	padding: 3rem;
}

.auth-left__image {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.auth-left__overlay {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background-image: linear-gradient(to bottom right, hsl(var(--secondary) / 0.9), hsl(var(--secondary) / 0.8), rgb(0 0 0 / 0.8));
}

.auth-left__block {
	position: relative;
	z-index: 10;
}

.auth-left__back {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 3rem;
	color: rgb(255 255 255 / 0.9);
	transition-property: color;
	transition-duration: 150ms;
	transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-left__back:hover {
	color: #fff;
}

.auth-left__back .icon {
	width: 1rem;
	height: 1rem;
}

.auth-left__brand {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 2rem;
}

.auth-left__crest {
	width: 3rem;
	height: 3rem;
	object-fit: contain;
	filter: drop-shadow(0 4px 3px rgb(0 0 0 / 0.07)) drop-shadow(0 2px 2px rgb(0 0 0 / 0.06));
}

.auth-left__name {
	font-size: 1.5rem;
	line-height: 2rem;
	font-weight: 700;
	color: #fff;
	filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.1)) drop-shadow(0 1px 1px rgb(0 0 0 / 0.06));
}

.auth-left__tag {
	font-size: 0.875rem;
	line-height: 1.25rem;
	color: rgb(255 255 255 / 0.8);
}

.auth-left__title {
	margin-bottom: 1rem;
	font-size: 2.25rem;
	line-height: 2.5rem;
	font-weight: 700;
	color: #fff;
	filter: drop-shadow(0 10px 8px rgb(0 0 0 / 0.04)) drop-shadow(0 4px 3px rgb(0 0 0 / 0.1));
}

.auth-left__blurb {
	max-width: 28rem;
	font-size: 1.125rem;
	line-height: 1.75rem;
	color: rgb(255 255 255 / 0.9);
	filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.1)) drop-shadow(0 1px 1px rgb(0 0 0 / 0.06));
}

.auth-left__stats {
	position: relative;
	z-index: 10;
	display: flex;
	align-items: center;
	gap: 1.5rem;
	font-size: 0.875rem;
	line-height: 1.25rem;
	font-weight: 500;
	color: rgb(255 255 255 / 0.8);
}

.auth-left__dot {
	color: hsl(var(--primary));
}

.auth-accent {
	color: hsl(var(--primary));
}

.auth-right {
	flex: 1 1 0%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem;
}

@media (min-width: 1024px) {
	.auth-left { display: flex; width: 50%; }
}

/* ---- Tarjeta del formulario ---- */

.auth-card {
	width: 100%;
	max-width: 28rem;
}

.auth-card__header {
	display: flex;
	flex-direction: column;
	padding: 1.5rem;
	text-align: center;
}

.auth-card__header > * + * {
	margin-top: 0.375rem;
}

.auth-card__lang {
	display: flex;
	justify-content: center;
	margin-bottom: 1rem;
}

.auth-card__brand {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.auth-card__brand .crest {
	width: 2.25rem;
	height: 2.25rem;
	object-fit: contain;
}

.auth-card__brand span {
	font-size: 1.25rem;
	line-height: 1.75rem;
	font-weight: 700;
	color: hsl(var(--foreground));
}

.auth-card__brand .auth-accent {
	color: hsl(var(--primary));
}

.auth-card__brand .icon {
	width: 2rem;
	height: 2rem;
	color: hsl(var(--primary));
}

@media (min-width: 1024px) {
	.auth-card__brand--mobile { display: none; }
}

.auth-card__title {
	font-size: 1.5rem;
	line-height: 1;
	font-weight: 600;
	letter-spacing: -0.025em;
}

.auth-card__desc {
	font-size: 0.875rem;
	line-height: 1.25rem;
	color: hsl(var(--muted-foreground));
}

.auth-card__content {
	padding: 0 1.5rem 1.5rem;
}

/* ---- Formulario ---- */

.auth-form > * + * {
	margin-top: 1rem;
}

.auth-field > * + * {
	margin-top: 0.5rem;
}

.auth-pass {
	position: relative;
}

.auth-pass__toggle {
	position: absolute;
	top: 50%;
	right: 0.75rem;
	transform: translateY(-50%);
	padding: 0;
	border: 0;
	background: none;
	color: hsl(var(--muted-foreground));
	cursor: pointer;
	transition-property: color;
	transition-duration: 150ms;
	transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-pass__toggle:hover {
	color: hsl(var(--foreground));
}

.auth-pass__toggle .icon {
	width: 1rem;
	height: 1rem;
}

.auth-hint {
	font-size: 0.75rem;
	line-height: 1rem;
	color: hsl(var(--muted-foreground));
}

.mun-btn--full {
	width: 100%;
}

.icon-spin {
	animation: munSpin 1s linear infinite;
}

.mun-btn .icon-spin {
	margin-right: 0.5rem;
}

@keyframes munSpin {
	to { transform: rotate(360deg); }
}

.auth-links {
	text-align: center;
	font-size: 0.875rem;
	line-height: 1.25rem;
	color: hsl(var(--muted-foreground));
}

.auth-links > * + * {
	margin-top: 0.5rem;
}

.auth-link {
	padding: 0;
	border: 0;
	background: none;
	color: hsl(var(--primary));
	font: inherit;
	font-weight: 500;
	cursor: pointer;
}

.auth-link:hover {
	text-decoration: underline;
}

.auth-back {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.875rem;
	line-height: 1.25rem;
	color: hsl(var(--muted-foreground));
	transition-property: color;
	transition-duration: 150ms;
	transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-back:hover {
	color: hsl(var(--foreground));
}

.auth-back .icon {
	width: 1rem;
	height: 1rem;
}

.auth-back-wrap {
	margin-top: 1.5rem;
}

.auth-back-wrap--mobile { }

@media (min-width: 1024px) {
	.auth-back-wrap--mobile { display: none; }
}

/* ---- Estados controlados por JavaScript ---- */

.auth-hidden {
	display: none;
}

/* ---- Pagina de nueva contrasena (centrada, sin panel izquierdo) ---- */

.auth-page--center {
	align-items: center;
	justify-content: center;
	padding: 1rem;
}
