:root
{
	--primary: #2563eb;
	--primary-soft: #dbeafe;
	--accent: #22c55e;
	--danger: #ef4444;
	--warning: #f59e0b;

	--bg-main: #f8fafc;
	--bg-card: rgba(255,255,255,0.85);

	--text-main: #0f172a;
	--text-muted: #64748b;

	--border-soft: rgba(0,0,0,0.08);
	--shadow-soft: 0 10px 30px rgba(0,0,0,0.08);
	--shadow-hover: 0 15px 40px rgba(0,0,0,0.12);

	--radius-sm: 8px;
	--radius-md: 14px;
	--radius-lg: 20px;
}

*,
*::before,
*::after
{
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body
{
	font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background-image: url("../images/jfk_bg.jpg");
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
    backdrop-filter: blur(5px);
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 100dvh;
	color: var(--text-main);
}

.hidden { display: none !important; }

/* ===================== */
/* NOTIFICACIONES */
/* ===================== */

#notifications
{
	position: fixed;
	bottom: 24px;
	right: 24px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	z-index: 20;
	pointer-events: none;
}

.notification
{
	pointer-events: auto;
	background: var(--bg-card);
	border-radius: var(--radius-md);
	padding: 14px 16px;
	width: 320px;
	display: flex;
	align-items: center;
	gap: 12px;
	box-shadow: var(--shadow-soft);
	backdrop-filter: blur(10px);
	animation: fadeInUp 0.3s ease;
}

.notification-icon
{
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-weight: 700;
	font-size: 0.9em;
}

.notification.success .notification-icon { background: var(--accent); }
.notification.warning .notification-icon { background: var(--warning); }
.notification.error   .notification-icon { background: var(--danger); }
.notification.info    .notification-icon { background: var(--primary); }

/* ===================== */
/* LOADER */
/* ===================== */

.loader-overlay
{
	position: fixed;
	inset: 0;
	background: rgba(15,23,42,0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 30;
	backdrop-filter: blur(6px);
}

.spinner
{
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 4px solid rgba(255,255,255,0.3);
	border-top-color: var(--primary);
	animation: spin 0.9s linear infinite;
}

/* ===================== */
/* LANGUAGE SWITCHER */
/* ===================== */

.language-switcher
{
	position: fixed;
	top: 24px;
	right: 24px;
	display: flex;
	gap: 8px;
	z-index: 10;
}

.lang-btn
{
	padding: 8px 14px;
	border-radius: 999px;
	border: 1px solid var(--border-soft);
	background: var(--bg-card);
	color: var(--text-main);
	font-size: 0.85em;
	font-weight: 600;
	cursor: pointer;
	backdrop-filter: blur(8px);
	transition: all 0.2s ease;
}

.lang-btn:hover
{
	background: var(--primary);
	color: #fff;
	border-color: transparent;
}

/* ===================== */
/* CONTENEDOR PRINCIPAL */
/* ===================== */

.window-container
{
	width: 360px;
	background: var(--bg-card);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-soft);
	backdrop-filter: blur(14px);
	overflow: hidden;
}

.window-titlebar
{
	padding: 14px 18px;
	font-weight: 600;
	color: var(--text-main);
	border-bottom: 1px solid var(--border-soft);
	background: rgba(255,255,255,0.6);
}

.window-content
{
	padding: 24px;
}

/* ===================== */
/* INPUTS */
/* ===================== */

.win-input
{
	width: 100%;
	padding: 12px 14px;
	border-radius: var(--radius-sm);
	border: 1px solid var(--border-soft);
	font-size: 0.95em;
	color: var(--text-main);
	background: #fff;
	transition: all 0.2s ease;
}

.win-input::placeholder { color: var(--text-muted); }

.win-input:focus
{
	outline: none;
	border-color: var(--primary);
	box-shadow: 0 0 0 3px var(--primary-soft);
}

.win-input:disabled
{
	background: #f1f5f9;
	color: var(--text-muted);
	cursor: not-allowed;
}

/* ===================== */
/* TITULOS */
/* ===================== */

.modern-heading
{
	text-align: center;
	font-size: 1.6em;
	font-weight: 700;
	margin-bottom: 20px;
	color: var(--primary);
}

/* ===================== */
/* BOTONES */
/* ===================== */

.liquid-button
{
	width: 100%;
	padding: 14px;
    margin-top: 10px;
    margin-bottom: 10px;
	border-radius: var(--radius-md);
	border: none;
	background: var(--primary);
	color: #fff;
	font-size: 1em;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.25s ease;
	box-shadow: var(--shadow-soft);
}

.liquid-button:hover
{
	transform: translateY(-2px);
	box-shadow: var(--shadow-hover);
}

.liquid-button:disabled
{
	background: #cbd5e1;
	color: #475569;
	cursor: not-allowed;
	box-shadow: none;
	transform: none;
}

/* ===================== */
/* CHECKBOX */
/* ===================== */

.win-checkbox
{
	appearance: none;
	width: 18px;
	height: 18px;
	border-radius: 6px;
	border: 1px solid var(--border-soft);
	display: inline-grid;
	place-content: center;
	cursor: pointer;
}

.win-checkbox:checked
{
	background: var(--primary);
	border-color: var(--primary);
}

.win-checkbox:checked::after
{
	content: "✓";
	color: #fff;
	font-size: 12px;
	font-weight: 700;
}

/* ===================== */
/* MODAL */
/* ===================== */

.modal-active
{
	background: rgba(15,23,42,0.5);
	backdrop-filter: blur(8px);
}

.modal-window
{
	background: var(--bg-card);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-hover);
	animation: modalPop 0.25s ease;
}

/* ===================== */
/* SCROLLBAR */
/* ===================== */

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb
{
	background: var(--primary);
	border-radius: 4px;
}
::-webkit-scrollbar-track
{
	background: transparent;
}

/* ===================== */
/* ACTION BUTTONS */
/* ===================== */

#back-button,
#save-button,
#logout-button
{
	position: fixed;

	padding: 10px 16px;
	border-radius: 999px;

	font-size: 0.9em;
	font-weight: 600;

	border: 1px solid transparent;
	backdrop-filter: blur(8px);

	cursor: pointer;
	transition: all 0.25s ease;

	z-index: 15;
}

#back-button
{
	right: 160px;
    top: 24px;

	background: #FFF;
	color: var(--text-main);
	border: 2px solid var(--border-soft);
	box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#back-button:hover
{
	background: #F1F5F9;
	border-color: var(--text-muted);
	transform: translateY(-2px);
}

#save-button
{
	right: 24px;
    bottom: 24px;

	background: var(--primary);
	color: #FFF;
	border: none;
	padding: 12px 24px;
	box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

#save-button:hover
{
	background: #1D4ED8;
	box-shadow: 0 12px 30px rgba(37,99,235,0.5);
	transform: scale(1.05);
}

#save-button.is-dirty
{
	outline: 3px solid var(--primary-soft);
	animation: pulseSave 1.5s infinite ease-in-out;
}

#logout-button
{
	position: fixed;
	top: 24px;
	right: 24px;

	padding: 10px 20px;
	border-radius: 999px;

	background: var(--danger);
	color: #FFF;

	font-size: 0.9em;
	font-weight: 700;

	border: none;

	backdrop-filter: blur(8px);

	cursor: pointer;
	transition: all 0.25s ease;

	z-index: 15;
}

#logout-button:hover
{
	background: #DC2626;
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(239, 68, 68, 0.45);
}

.modal-active #logout-button
{
	opacity: 0.2;
	pointer-events: none;
}

/* ===================== */
/* STATES */
/* ===================== */

#save-button:disabled
{
	opacity: 0.5;
	cursor: not-allowed;
	box-shadow: none;
}

/* ===================== */
/* ANIMACIONES */
/* ===================== */

@keyframes spin
{
	to { transform: rotate(360deg); }
}

@keyframes modalPop
{
	from { opacity: 0; transform: scale(0.92); }
	to   { opacity: 1; transform: scale(1); }
}

@keyframes fadeInUp
{
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulseSave
{
	0%   { box-shadow: 0 0 0 0 rgba(37,99,235,0.6); }
	70%  { box-shadow: 0 0 0 12px rgba(37,99,235,0); }
	100% { box-shadow: 0 0 0 0 rgba(37,99,235,0); }
}

/* ===================== */
/* MOBILE */
/* ===================== */

@media (max-width: 768px)
{
	.window-container
	{
		width: 90vw;
	}

    #back-button,
	#save-button,
	#logout-button
	{
		position: fixed;
		bottom: env(safe-area-inset-bottom, 0);
		top: auto;

		padding: 14px 12px;
		font-size: 1em;

		border-radius: 14px;
		backdrop-filter: blur(10px);
	}

    #fixed-action-bar
	{
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;

		display: flex;
		gap: 10px;
		padding: 12px;

		background: white;
		border-top: 1px solid rgba(0,0,0,0.08);

		z-index: 20;
	}

    #back-button
	{
		position: relative;
		left: auto;
		right: auto;
		flex: 1;

		background: rgba(15,23,42,0.08);
	}

    #save-button
	{
		position: relative;
		left: auto;
		right: auto;
		flex: 2;

		background: var(--primary);
		color: #fff;
		box-shadow: 0 8px 24px rgba(37,99,235,0.4);
	}

	#logout-button
	{
		display: none;
	}
}

/* ===================== */
/* PRINT */
/* ===================== */

@media print
{
	body
    {
        background: white !important;
        backdrop-filter: none !important;
		display: block !important;
		width: 100% !important;
		height: auto;
    }

    #back-button, #logout-button, #notifications, #loader .close-btn, .liquid-button
    {
        display: none !important;
    }

    .window-container
    {
        position: static;
        box-shadow: none !important;
        border: 1px solid #000 !important;
        width: 100% !important;
        margin: 0 !important;
    }

	.window-content
	{
		border: none !important;
		box-shadow: none !important;
		margin: 0;
		padding: 0;
	}

    .window-titlebar
    {
        background:  #CCC !important;
        color: #000 !important;
        border-bottom: 1px solid #000;
    }
}
