/**
 * Estilos del formulario de autenticación personalizado (Mi Evento Bolivia).
 *
 * Se cargan únicamente en la pantalla de acceso restringido (visitantes sin
 * sesión viendo el planificador) y se apoyan en la tarjeta base de
 * ppwp-guest-access.css.
 *
 * @package PabloPonceWeddingPlanner
 */

.custom-planner-auth-card {
	width: 100%;
	max-width: 420px;
	margin: 0 auto 8px;
	text-align: left;
}

.custom-planner-auth-title {
	margin: 0 0 6px;
	font-size: 1.25rem;
	line-height: 1.3;
	font-weight: 700;
	color: #0f172a;
	text-align: center;
}

.custom-planner-auth-card .auth-subtitle {
	margin: 0 0 20px;
	font-size: 0.95rem;
	line-height: 1.5;
	color: #64748b;
	text-align: center;
}

/* ─── Bloque de Google ───────────────────────────────────────────────── */

.auth-google-block {
	display: flex;
	justify-content: center;
	width: 100%;
	margin-bottom: 4px;
}

.auth-google-block .g_id_signin,
.auth-google-block iframe {
	width: 100%;
}

.auth-divider {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 18px 0;
	color: #94a3b8;
	font-size: 0.78rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
	content: "";
	flex: 1 1 auto;
	height: 1px;
	background: #e2e8f0;
}

.auth-divider span {
	white-space: nowrap;
}

/* ─── Formulario correo/contraseña ───────────────────────────────────── */

#planner-custom-login-form {
	display: flex;
	flex-direction: column;
	gap: 0;
}

#planner-custom-login-form .auth-field,
#planner-custom-login-form .form-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

/* ─── Estandarización de campos de texto ───────────────────────────────
 * Los dos campos del formulario (usuario/correo y contraseña) deben verse
 * EXACTAMENTE iguales: mismo alto, radio, borde, padding y foco.
 *
 * IMPORTANTE: el primer campo es type="text" porque el login acepta tanto
 * el nombre de usuario como el correo electrónico. NO hay que depender del
 * selector input[type="email"]: al cambiar el tipo dejó de coincidir y el
 * campo caía a los estilos por defecto del navegador (bordes cuadrados y
 * línea negra fina), mientras que input[type="password"] sí se estilizaba.
 *
 * Se cubren todos los puntos de anclaje posibles: el id del formulario, la
 * clase compartida .planner-input, el contenedor .form-group y la página de
 * acceso restringido (.planner-access-restricted-page). ------------------ */

#planner-custom-login-form input,
#planner-custom-login-form input[type="text"],
#planner-custom-login-form input[type="email"],
#planner-custom-login-form input[type="password"],
#planner-custom-login-form .planner-input,
.planner-access-restricted-page input[type="text"],
.planner-access-restricted-page input[type="email"],
.planner-access-restricted-page input[type="password"] {
	width: 100% !important;
	height: 48px !important;
	padding: 12px 16px !important;
	border: 1px solid #e2e8f0 !important;
	border-radius: 12px !important;
	background: #ffffff !important;
	font-size: 14px !important;
	line-height: 1.4 !important;
	color: #334155 !important;
	box-shadow: none !important;
	outline: none !important;
	box-sizing: border-box !important;
	transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
	margin-top: 6px !important;
	margin-bottom: 16px !important;
}

#planner-custom-login-form input::placeholder,
.planner-access-restricted-page .planner-input::placeholder {
	color: #94a3b8 !important;
	opacity: 1 !important;
}

#planner-custom-login-form input:focus,
#planner-custom-login-form .planner-input:focus,
.planner-access-restricted-page input[type="text"]:focus,
.planner-access-restricted-page input[type="email"]:focus,
.planner-access-restricted-page input[type="password"]:focus {
	border-color: #e57373 !important;
	box-shadow: 0 0 0 3px rgba(229, 115, 115, 0.15) !important;
	outline: none !important;
}

.planner-access-restricted-page label,
#planner-custom-login-form label {
	font-size: 13px !important;
	font-weight: 600 !important;
	color: #475569 !important;
	display: block !important;
	margin-bottom: 2px !important;
	text-align: left !important;
}

.btn-primary-auth {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	margin-top: 4px;
	padding: 13px 18px;
	border: none;
	border-radius: 999px;
	background: linear-gradient(135deg, #e11d48, #be123c);
	color: #ffffff;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-primary-auth:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 22px rgba(225, 29, 72, 0.28);
}

.btn-primary-auth:active {
	transform: translateY(0);
}

.btn-primary-auth[disabled] {
	opacity: 0.65;
	cursor: wait;
	transform: none;
	box-shadow: none;
}

/* ─── Pestañas Iniciar Sesión / Registrarse ───────────────────────────
 * La pestaña activa se marca con la clase `.active` (botón y contenido).
 * El CSS decide qué panel se ve, de modo que el JS solo alterna clases y
 * el formulario sigue siendo usable aunque falle el script (se ve el login). */

.planner-auth-tabs-wrapper {
	width: 100%;
}

.auth-tabs {
	display: flex !important;
	background: #f1f5f9 !important;
	border-radius: 12px !important;
	padding: 4px !important;
	margin-bottom: 20px !important;
}

.auth-tab-btn {
	flex: 1 1 0 !important;
	padding: 10px 16px !important;
	border: none !important;
	background: transparent !important;
	border-radius: 8px !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	color: #64748b !important;
	cursor: pointer !important;
	transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease !important;
}

.auth-tab-btn:hover {
	color: #334155 !important;
}

.auth-tab-btn.active {
	background: #ffffff !important;
	color: #1e293b !important;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06) !important;
}

.auth-tab-content {
	display: none !important;
}

.auth-tab-content.active {
	display: block !important;
	animation: ppwp-auth-fade-in 0.25s ease-in-out;
}

@keyframes ppwp-auth-fade-in {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.auth-tab-content.active {
		animation: none;
	}
}

/* Nota de ayuda bajo un campo (p. ej. longitud mínima de la contraseña). */
.auth-hint {
	margin: -8px 0 12px;
	font-size: 12px;
	line-height: 1.4;
	color: #94a3b8;
	text-align: left;
}

/* ─── Mensajes de respuesta ──────────────────────────────────────────── */

#auth-response-message {
	display: none;
	margin-top: 14px;
	padding: 11px 14px;
	border-radius: 10px;
	font-size: 0.9rem;
	line-height: 1.45;
	text-align: center;
}

#auth-response-message.is-visible {
	display: block;
}

#auth-response-message.is-loading {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	color: #475569;
}

#auth-response-message.is-success {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	color: #15803d;
}

#auth-response-message.is-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
}

/* ─── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 480px) {
	.custom-planner-auth-card {
		max-width: 100%;
	}

	.custom-planner-auth-title {
		font-size: 1.12rem;
	}

	.auth-divider {
		margin: 14px 0;
	}
}
