/* ==========================================================================
   Bolsa de Empleo — CSS3 vanilla, estilo corporativo con animaciones.
   ========================================================================== */

:root {
	/* Neutros. */
	--ink: #0f1115;
	--white: #ffffff;
	--gray-50: #f7f8fa;
	--gray-100: #f0f1f4;
	--gray-200: #e3e6ec;
	--gray-400: #94a0b4;
	--gray-600: #545e6f;

	/* Corporativo: azul índigo profundo + acento violeta. */
	--primary: #1d4ed8;
	--primary-dark: #1e3a8a;
	--primary-light: #eaf0ff;
	--accent: #7c3aed;
	--gradient: linear-gradient(135deg, #1d4ed8 0%, #7c3aed 100%);

	/* Estado. */
	--success: #067a46;
	--success-bg: #e8f9ef;
	--error: #b42318;
	--error-bg: #fdeeed;

	--font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;

	--space-1: 0.5rem;
	--space-2: 1rem;
	--space-3: 1.5rem;
	--space-4: 2.5rem;
	--space-5: 4.5rem;

	--radius-sm: 6px;
	--radius: 12px;
	--radius-lg: 20px;

	--border: 1px solid var(--gray-200);
	--shadow-sm: 0 1px 2px rgba(15, 17, 21, 0.06);
	--shadow: 0 10px 28px rgba(29, 78, 216, 0.10);
	--shadow-lg: 0 22px 50px rgba(29, 78, 216, 0.16);

	--ease: cubic-bezier(0.16, 1, 0.3, 1);
	--max-width: 1140px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.65;
	color: var(--ink);
	background: var(--white);
	font-weight: 400;
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.02em;
	margin: 0 0 var(--space-2);
	color: var(--ink);
}

h1 { font-size: clamp(2rem, 3.4vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 2.2vw, 1.9rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 var(--space-2); color: var(--gray-600); }

a { color: var(--primary); text-decoration: none; transition: color 0.15s var(--ease); }
a:hover { color: var(--primary-dark); }

::selection { background: var(--primary); color: var(--white); }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-3); }

/* ==========================================================================
   Animaciones
   ========================================================================== */

@keyframes fadeInUp {
	from { opacity: 0; transform: translateY(14px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

.fade-in { animation: fadeIn 0.5s var(--ease) both; }

.reveal {
	opacity: 0;
	transform: translateY(14px);
	transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* Sin JS (noscript) o navegadores que no soporten IntersectionObserver:
   el contenido nunca debe quedar invisible. */
.no-js .reveal, .reveal.reveal-fallback { opacity: 1; transform: none; }

/* ==========================================================================
   Header / Footer
   ========================================================================== */

.site-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: rgba(255, 255, 255, 0.85);
	backdrop-filter: saturate(180%) blur(12px);
	border-bottom: var(--border);
	padding: var(--space-2) 0;
}

.site-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-3);
}

.site-header-inner .nav { flex: 1; justify-content: center; }

@media (max-width: 720px) {
	.site-header-inner { flex-wrap: wrap; }
	.site-header-inner .nav { order: 3; flex-basis: 100%; justify-content: flex-start; }
}

.logo {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: 800;
	font-size: 1.15rem;
	color: var(--ink);
}

.logo::before {
	content: "";
	width: 10px;
	height: 10px;
	border-radius: 3px;
	background: var(--gradient);
	flex-shrink: 0;
}

.logo:hover { color: var(--ink); }

.nav { display: flex; align-items: center; gap: var(--space-3); }
.nav a { font-size: 0.9rem; font-weight: 500; color: var(--gray-600); }
.nav a:hover { color: var(--primary); }

.header-actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }
.header-action-link { font-size: 0.9rem; font-weight: 600; color: var(--gray-600); }
.header-action-link:hover { color: var(--primary); }

.site-footer {
	border-top: var(--border);
	padding: var(--space-4) 0 0;
	margin-top: var(--space-5);
	color: var(--gray-400);
	font-size: 0.85rem;
	background: var(--gray-50);
}

.footer-grid {
	display: grid;
	grid-template-columns: 1.5fr repeat(3, 1fr);
	gap: var(--space-3);
	padding-bottom: var(--space-4);
}

@media (max-width: 720px) {
	.footer-grid { grid-template-columns: repeat(2, 1fr); }
}

.footer-col h4 { font-size: 0.85rem; color: var(--ink); margin-bottom: var(--space-1); }
.footer-col p { font-size: 0.85rem; }

.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a { font-size: 0.85rem; color: var(--gray-400); }
.footer-links a:hover { color: var(--primary); }

.footer-bottom { border-top: var(--border); padding: var(--space-2) 0; }
.footer-bottom p { margin: 0; }

main { padding: var(--space-5) 0 var(--space-4); }

/* ==========================================================================
   Hero + búsqueda
   ========================================================================== */

.hero {
	position: relative;
	overflow: hidden;
	padding: var(--space-5) var(--space-4);
	margin-bottom: var(--space-4);
	border-radius: var(--radius-lg);
	color: var(--white);
	background: var(--gradient);
	animation: fadeInUp 0.7s var(--ease) both;
}

.hero::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.22), transparent 55%);
	pointer-events: none;
}

.hero > * { position: relative; }
.hero h1 { color: var(--white); max-width: 720px; }
.hero p { color: rgba(255, 255, 255, 0.85); font-size: 1.05rem; max-width: 620px; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: var(--space-3); }

.button-light { background: var(--white); color: var(--primary-dark); border-color: var(--white); }
.button-light:hover { background: var(--ink); color: var(--white); border-color: var(--ink); }

.button-ghost { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, 0.6); }
.button-ghost:hover { background: rgba(255, 255, 255, 0.15); color: var(--white); border-color: var(--white); }

/* Hero con video de fondo en loop. */

.hero-video { padding: 0; min-height: 480px; display: flex; align-items: center; }

.hero-bg-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 0;
}

.hero-video .hero-overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(135deg, rgba(29, 78, 216, 0.82) 0%, rgba(124, 58, 237, 0.82) 100%);
}

.hero-content {
	position: relative;
	z-index: 2;
	padding: var(--space-5) var(--space-4);
	width: 100%;
}

@media (max-width: 720px) {
	.hero-video { min-height: 420px; }
}

.search-form {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-top: var(--space-3);
	max-width: 720px;
	background: var(--white);
	padding: 0.5rem;
	border-radius: var(--radius);
	box-shadow: var(--shadow-lg);
}

.search-form .input { flex: 1; min-width: 160px; border-color: var(--gray-200); }
.search-form .button { background: var(--ink); border-color: var(--ink); flex-shrink: 0; }
.search-form .button:hover { background: var(--primary); border-color: var(--primary); }

/* ==========================================================================
   Formularios
   ========================================================================== */

.input {
	width: 100%;
	padding: 0.75rem 0.9rem;
	border: 1px solid var(--gray-200);
	border-radius: var(--radius-sm);
	font-family: inherit;
	font-size: 0.95rem;
	background: var(--gray-50);
	color: var(--ink);
	transition: border-color 0.15s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.input:focus { outline: none; border-color: var(--primary); background: var(--white); box-shadow: 0 0 0 3px var(--primary-light); }
.input-sm { padding: 0.4rem 0.6rem; font-size: 0.85rem; width: 90px; }

textarea.input { min-height: 130px; resize: vertical; }

.form {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	max-width: 620px;
	background: var(--white);
	border: var(--border);
	border-radius: var(--radius);
	padding: var(--space-3);
	box-shadow: var(--shadow-sm);
}

.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field label { font-size: 0.85rem; font-weight: 600; }
.field-row { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 180px; }

.inline-form { display: inline-flex; gap: 0.4rem; align-items: center; }

/* ==========================================================================
   Botones
   ========================================================================== */

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.75rem 1.5rem;
	background: var(--primary);
	color: var(--white);
	border: 1px solid var(--primary);
	border-radius: var(--radius-sm);
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	text-align: center;
	transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.button:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--white); box-shadow: var(--shadow); transform: translateY(-2px); }
.button:active { transform: translateY(0); }

.button-block { display: flex; width: 100%; }
.button-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }

.button-outline { background: var(--white); color: var(--ink); border-color: var(--gray-200); }
.button-outline:hover { background: var(--ink); color: var(--white); border-color: var(--ink); box-shadow: var(--shadow-sm); transform: translateY(-2px); }

.button-link {
	background: none;
	border: none;
	padding: 0;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--primary);
	text-decoration: underline;
	cursor: pointer;
	transition: color 0.15s var(--ease);
}

.button-link:hover { color: var(--primary-dark); }
.button-link-danger { color: var(--gray-600); }
.button-link-danger:hover { color: var(--error); }

/* ==========================================================================
   Tarjetas de plaza
   ========================================================================== */

.job-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: var(--space-3);
}

.job-card {
	border: var(--border);
	border-radius: var(--radius);
	padding: var(--space-3);
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
	background: var(--white);
	box-shadow: var(--shadow-sm);
	transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease), border-color 0.25s var(--ease);
}

.job-card:hover { box-shadow: var(--shadow); border-color: var(--primary); transform: translateY(-4px); }

.job-card h3 { margin-bottom: 0; font-size: 1.05rem; }
.job-card h3 a { color: var(--ink); }
.job-card h3 a:hover { color: var(--primary); }
.job-company, .job-card p { font-size: 0.9rem; margin-bottom: 0; }

.job-card-head { display: flex; align-items: flex-start; gap: 0.75rem; }

.job-logo {
	width: 44px;
	height: 44px;
	flex-shrink: 0;
	border-radius: var(--radius-sm);
	object-fit: cover;
	border: var(--border);
}

.job-logo-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--primary-light);
	color: var(--primary-dark);
	font-weight: 800;
	font-size: 0.85rem;
}

.job-card-headings { min-width: 0; }

.job-time { font-size: 0.78rem; color: var(--gray-400); }

.job-card-footer {
	margin-top: auto;
	padding-top: var(--space-1);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-1);
	flex-wrap: wrap;
}

.share-row { display: flex; gap: 0.6rem; }
.share-link { font-size: 0.75rem; font-weight: 600; color: var(--gray-400); }
.share-link:hover { color: var(--primary); }

.badge-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.2rem 0; }
.badge {
	display: inline-block;
	padding: 0.25rem 0.65rem;
	border-radius: 999px;
	background: var(--primary-light);
	color: var(--primary-dark);
	font-size: 0.72rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.empty-state {
	padding: var(--space-4) var(--space-2);
	color: var(--gray-400);
	text-align: center;
	border: 1px dashed var(--gray-200);
	border-radius: var(--radius);
}

/* ==========================================================================
   Cómo funciona
   ========================================================================== */

.how-it-works { padding: var(--space-5) 0 var(--space-3); text-align: center; }
.how-it-works h2 { margin-bottom: var(--space-4); }

.steps-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: var(--space-3);
	text-align: left;
}

.step {
	border: var(--border);
	border-radius: var(--radius);
	padding: var(--space-3);
	background: var(--white);
	box-shadow: var(--shadow-sm);
	transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.step:hover { box-shadow: var(--shadow); transform: translateY(-3px); }

.step-number { display: inline-block; font-size: 0.85rem; font-weight: 800; color: var(--primary); margin-bottom: 0.5rem; }

/* ==========================================================================
   Ficha individual
   ========================================================================== */

.job-single { border-bottom: var(--border); padding-bottom: var(--space-3); margin-bottom: var(--space-3); }
.job-content { margin: var(--space-2) 0; }

/* ==========================================================================
   Notificaciones
   ========================================================================== */

.notice {
	padding: var(--space-2);
	border-radius: var(--radius-sm);
	font-size: 0.9rem;
	margin-bottom: var(--space-3);
	border: 1px solid transparent;
	animation: fadeInUp 0.4s var(--ease) both;
}

.notice-error { border-color: #f4c7c2; background: var(--error-bg); color: var(--error); }
.notice-success { border-color: #a8e6c1; background: var(--success-bg); color: var(--success); }

/* ==========================================================================
   Auth
   ========================================================================== */

.auth-card {
	max-width: 420px;
	margin: var(--space-4) auto 0;
	background: var(--white);
	border: var(--border);
	border-radius: var(--radius);
	padding: var(--space-4);
	box-shadow: var(--shadow);
	animation: fadeInUp 0.5s var(--ease) both;
}

.page-subtitle { margin-top: -0.5rem; }

.auth-card .form { border: none; box-shadow: none; padding: 0; max-width: none; margin-bottom: var(--space-2); }

/* ==========================================================================
   Dashboards
   ========================================================================== */

.back-link { display: inline-block; font-size: 0.85rem; font-weight: 600; margin-bottom: var(--space-2); }

.dashboard-heading {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--space-2);
	flex-wrap: wrap;
	margin-bottom: var(--space-4);
	padding-bottom: var(--space-3);
	border-bottom: var(--border);
}

.dashboard-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: var(--space-2);
	margin-bottom: var(--space-4);
}

.stat {
	border: var(--border);
	padding: var(--space-3);
	border-radius: var(--radius);
	background: var(--white);
	box-shadow: var(--shadow-sm);
	transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.stat:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-value { font-size: 2.1rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gray-400); font-weight: 600; }

.panel-section { margin-bottom: var(--space-5); }

.table-wrap { overflow-x: auto; }

.table {
	width: 100%;
	border-collapse: collapse;
	margin-top: var(--space-2);
	background: var(--white);
	border: var(--border);
	border-radius: var(--radius);
	overflow: hidden;
}

.table th, .table td { text-align: left; padding: 0.85rem; border-bottom: var(--border); font-size: 0.9rem; white-space: nowrap; }
.table tbody tr { transition: background 0.15s var(--ease); }
.table tbody tr:hover { background: var(--gray-50); }
.table tbody tr:last-child td { border-bottom: none; }
.table th { text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.04em; color: var(--gray-400); background: var(--gray-50); font-weight: 700; }
.actions-cell { display: flex; gap: 0.6rem; align-items: center; white-space: nowrap; }
