@import url('https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
	--bg-deep: #0a0d12;
	--bg-panel: #11141b;
	--bg-elevated: #161a23;
	--bg-input: #0d1016;
	--border: #1f2430;
	--border-soft: #1a1e28;

	--text-primary: #eef1f6;
	--text-muted: #8893a3;
	--text-faint: #5b6373;

	--accent: #3b82f6;
	--clinical: #14b8a6;
	--violet: #8b5cf6;
	--danger: #ef4444;
	--success: #10b981;

	--radius-sm: 8px;
	--radius-md: 12px;
	--radius-lg: 20px;

	--font-display: 'Sora', sans-serif;
	--font-body: 'Inter', sans-serif;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: var(--font-body);
	background: var(--bg-deep);
	color: var(--text-primary);
	min-height: 100vh;
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 30px 20px;
	position: relative;
	overflow: hidden;
}

/* ============================================================
   Fondo animado — "pulso clínico"
   Una red de nodos conectados (referencia a monitorización /
   signos vitales en red) deriva muy lentamente, más una traza
   de ECG cruzando el lienzo. Dos capas, ambas tenues: la
   página de bienvenida puede permitirse algo más de presencia
   que el panel de trabajo, pero sigue siendo ambiente, no
   protagonista.
   ============================================================ */
.pulse-field {
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	overflow: hidden;
	background:
		radial-gradient(ellipse 60% 50% at 15% 20%, rgba(59, 130, 246, 0.08), transparent 60%),
		radial-gradient(ellipse 55% 45% at 85% 80%, rgba(20, 184, 166, 0.07), transparent 60%);
}

.pulse-field svg {
	position: absolute;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
}

.pulse-field .node-link {
	stroke: var(--border);
	stroke-width: 1;
	opacity: 0.55;
}

.pulse-field .node-dot {
	fill: var(--clinical);
	opacity: 0.5;
}

.pulse-field .node-group {
	animation: drift 22s ease-in-out infinite;
	transform-origin: center;
}

.pulse-field .node-group.alt {
	animation-duration: 28s;
	animation-delay: -6s;
}

@keyframes drift {
	0%, 100% { transform: translate(0, 0); }
	50% { transform: translate(14px, -10px); }
}

.pulse-field .ekg-line {
	fill: none;
	stroke: var(--accent);
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-dasharray: 6 2400;
	animation: ekg-sweep 16s linear infinite;
	opacity: 0.45;
	filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.3));
}

@keyframes ekg-sweep {
	0% { stroke-dashoffset: 2400; }
	100% { stroke-dashoffset: -400; }
}

@media (prefers-reduced-motion: reduce) {
	.pulse-field .node-group { animation: none; }
	.pulse-field .ekg-line { animation: none; stroke-dasharray: none; opacity: 0.15; }
}

/* ============================================================
   Tarjeta de login / registro
   ============================================================ */
.container-register {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	position: relative;
	z-index: 1;
}

.register-decoration {
	display: none;
}

.register-box {
	background: var(--bg-panel);
	border: 1px solid var(--border);
	padding: 2.75rem 2.5rem;
	border-radius: var(--radius-lg);
	box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
	width: 100%;
	max-width: 520px;
	position: relative;
}

@media (prefers-reduced-motion: no-preference) {
	.register-box {
		animation: card-enter .6s cubic-bezier(.16, 1, .3, 1) both;
	}
}

@keyframes card-enter {
	from {
		opacity: 0;
		transform: translateY(18px) scale(.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.register-box h1 {
	font-family: var(--font-display);
	font-size: 1.65rem;
	font-weight: 700;
	color: var(--text-primary);
	text-align: center;
	margin-bottom: .4rem;
	letter-spacing: -0.01em;
}

.subtitle {
	color: var(--text-muted);
	text-align: center;
	margin-bottom: 1.8rem;
	font-size: .9rem;
}

.form-group {
	margin-bottom: 1.3rem;
	opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
	.form-group {
		animation: rise-in .45s ease both;
	}
	.form-group:nth-of-type(1) { animation-delay: .15s; }
	.form-group:nth-of-type(2) { animation-delay: .2s; }
	.form-group:nth-of-type(3) { animation-delay: .25s; }
	.form-group:nth-of-type(4) { animation-delay: .3s; }
	.form-group:nth-of-type(5) { animation-delay: .35s; }
	.form-group:nth-of-type(6) { animation-delay: .4s; }
	.form-group:nth-of-type(7) { animation-delay: .45s; }
}

@keyframes rise-in {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

.form-group label {
	display: block;
	font-weight: 600;
	margin-bottom: .5rem;
	color: var(--text-muted);
	font-size: .85rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"] {
	width: 100%;
	padding: .8rem 1rem;
	background: var(--bg-input);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	font-size: .95rem;
	color: var(--text-primary);
	font-family: inherit;
	transition: border-color .2s ease, box-shadow .2s ease;
}

.form-group input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.form-group input::placeholder {
	color: var(--text-faint);
}

.password-container {
	position: relative;
	display: flex;
	align-items: center;
}

.toggle-password {
	position: absolute;
	right: 14px;
	background: none;
	border: none;
	cursor: pointer;
	font-size: 1rem;
	color: var(--text-faint);
	transition: color .2s ease;
}

.toggle-password:hover {
	color: var(--accent);
}

.password-requirements {
	margin-top: .6rem;
	font-size: .78rem;
	color: var(--text-faint);
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 4px;
}

.password-requirements p {
	margin: 0;
}

.error-message {
	color: #fca5a5;
	font-size: .78rem;
	margin-top: .3rem;
	display: block;
}

.btn-register {
	width: 100%;
	padding: .85rem;
	background: var(--accent);
	color: #fff;
	border: none;
	border-radius: var(--radius-sm);
	font-size: 1rem;
	font-weight: 700;
	font-family: var(--font-body);
	cursor: pointer;
	transition: filter .2s ease, transform .15s ease;
	margin-top: .3rem;
	opacity: 0;
	animation: rise-in .45s ease .5s both;
}

.btn-register:hover {
	filter: brightness(1.1);
	transform: translateY(-1px);
}

.btn-register:active {
	transform: scale(.98);
}

.register-links {
	margin-top: 1.6rem;
	text-align: center;
	font-size: .88rem;
	color: var(--text-muted);
	opacity: 0;
	animation: rise-in .45s ease .55s both;
}

.link-login {
	color: var(--accent);
	text-decoration: none;
	font-weight: 600;
}

.link-login:hover {
	color: #60a5fa;
}

.alert {
	padding: .75rem 1rem;
	border-radius: var(--radius-sm);
	margin-bottom: 1.2rem;
	font-size: .88rem;
	font-weight: 500;
}

.alert-danger {
	background: rgba(239, 68, 68, 0.12);
	border: 1px solid rgba(239, 68, 68, 0.3);
	color: #fca5a5;
}

.alert-success {
	background: rgba(16, 185, 129, 0.12);
	border: 1px solid rgba(16, 185, 129, 0.3);
	color: #6ee7b7;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}
