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

:root {
	/* Palette inspired by provided image (maroon / Estado de México) */
	--bg: #fff6f7; /* very light rose */
	--bg-2: #f9eef0; /* soft pink-beige */
	--ink: #2b0b0f; /* deep near-black maroon */
	--muted: #6b4f52; /* muted brownish-maroon */
	--brand: #7b0b1f; /* deep maroon */
	--brand-2: #b33a4b; /* warmer maroon */
	--accent: #f3c33b; /* warm gold accent */
	--surface: rgba(255, 250, 250, 0.9);
	--line: rgba(139, 11, 31, 0.12);
	--shadow: 0 18px 54px rgba(43, 11, 15, 0.08);
	--radius-xl: 26px;
	--radius-lg: 16px;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
	margin: 0;
	font-family: 'Outfit', sans-serif;
	color: var(--ink);
	background:
		radial-gradient(circle at top left, rgba(123, 11, 31, 0.06), transparent 28%),
		radial-gradient(circle at top right, rgba(179, 58, 75, 0.06), transparent 30%),
		linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 55%, #fff0f2 100%);
}

a { color: inherit; }
img { max-width: 100%; display: block; }

.shell { width: min(1220px, calc(100% - 24px)); margin: 12px auto 28px; }

.creator-watermark {
	position: fixed;
	right: 14px;
	bottom: 10px;
	z-index: 10;
	padding: 0.42rem 0.65rem;
	border: 1px solid rgba(123, 11, 31, 0.16);
	border-radius: 10px;
	background: rgba(255, 250, 250, 0.96);
	box-shadow: 0 8px 24px rgba(43, 11, 15, 0.12);
	color: #7b0b1f;
	font-size: 0.76rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-decoration: none;
	pointer-events: auto;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	text-align: right;
}

.creator-watermark:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 28px rgba(43, 11, 15, 0.16);
}

.creator-watermark .help-link,
.creator-watermark .creator-instagram {
	display: block;
}

.creator-watermark .help-link {
	margin-top: 0;
	margin-bottom: 0.14rem;
	color: #7b0b1f;
	font-size: 0.72rem;
}

.creator-instagram {
	color: #8a6267;
	font-size: 0.7rem;
	font-weight: 700;
	text-decoration: none;
}

.creator-watermark .help-link:hover,
.creator-watermark .help-link:focus-visible,
.creator-instagram:hover,
.creator-instagram:focus-visible {
	color: rgba(123, 11, 31, 0.72);
}

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 18px 20px;
	border-radius: 22px;
	background: linear-gradient(110deg, rgba(43,11,15,0.96), rgba(123,11,31,0.96) 55%, rgba(179,58,75,0.95));
	color: #fff6f7;
	box-shadow: var(--shadow);
}

.brand { font-family: 'Space Grotesk', sans-serif; font-size: 1.1rem; font-weight: 700; letter-spacing: 0.03em; }
.brand-subtitle { color: rgba(248, 250, 252, 0.72); font-size: 0.92rem; }
.nav { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: flex-end; }
.nav-link {
	text-decoration: none;
	padding: 0.62rem 0.9rem;
	border-radius: 999px;
	color: rgba(248, 250, 252, 0.94);
	border: 1px solid transparent;
}
.nav-link.active, .nav-link:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.14); }

.container { padding: 20px 0 8px; }
.hero { padding: 22px 2px 16px; }
.hero-eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.14em;
	font-size: 0.76rem;
	font-weight: 700;
	color: var(--brand);
	margin: 0 0 0.6rem;
}
.hero-title, .card-title { margin: 0; font-family: 'Space Grotesk', sans-serif; letter-spacing: -0.03em; }
.hero { padding: 22px 2px 16px; text-align: center; }
.hero-eyebrow { text-align: center; }
.hero-title, .card-title { margin: 0; font-family: 'Space Grotesk', sans-serif; letter-spacing: -0.03em; }
.hero-title { font-size: clamp(2rem, 4vw, 3.55rem); line-height: 1; max-width: 48ch; margin: 0 auto 0.6rem; text-align: center; }
.hero-text, .card-subtitle { color: var(--muted); line-height: 1.6; }

.grid { display: grid; gap: 1.2rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
	background: var(--surface);
	border: 1px solid var(--line);
	box-shadow: var(--shadow);
	border-radius: var(--radius-xl);
	padding: clamp(18px, 2.5vw, 28px);
	backdrop-filter: blur(16px);
}
.accent-card { background: linear-gradient(180deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.88)); }
.stat-card .card-title { font-size: clamp(2rem, 4vw, 3rem); }

.card-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.form { display: grid; gap: 1rem; margin-top: 1rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.field { display: grid; gap: 0.45rem; }
.field span { font-size: 0.95rem; font-weight: 600; }
.input {
	width: 100%;
	border: 1px solid rgba(148, 163, 184, 0.34);
	border-radius: 14px;
	padding: 0.9rem 1rem;
	font: inherit;
	background: rgba(255, 255, 255, 0.95);
	color: var(--ink);
	outline: none;
}
.input:focus { border-color: rgba(123,11,31,0.55); box-shadow: 0 0 0 4px rgba(123,11,31,0.08); }

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	border: 0;
	border-radius: 999px;
	padding: 0.86rem 1.25rem;
	background: linear-gradient(135deg, var(--brand), var(--brand-2));
	color: #fff6f7;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	box-shadow: 0 10px 24px rgba(123,11,31,0.18);
}
.btn:hover { filter: brightness(1.03); }
.btn-secondary { background: rgba(15, 23, 42, 0.06); color: var(--ink); box-shadow: none; }
.btn-danger { background: linear-gradient(135deg, #dc2626, #991b1b); }

.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1rem; }
.inline-actions { align-items: center; }
.stacked-actions { flex-direction: column; align-items: stretch; }

.notice { margin-top: 1rem; padding: 0.95rem 1rem; border-radius: 14px; border: 1px solid var(--line); }
.notice-error { background: rgba(254, 242, 242, 0.95); color: #991b1b; border-color: rgba(239, 68, 68, 0.28); }
.notice-success { background: rgba(249, 241, 235, 0.95); color: #6b331b; border-color: rgba(179,58,75,0.12); }
.notice-info { background: rgba(250, 243, 244, 0.95); color: #7b0b1f; border-color: rgba(123,11,31,0.12); }

.risk-alert {
	margin: 0.75rem 0;
	padding: 0.55rem 0.75rem;
	border: 1px solid rgba(179, 58, 75, 0.14);
	border-left: 3px solid rgba(179, 58, 75, 0.45);
	border-radius: 10px;
	background: rgba(255, 250, 250, 0.82);
	color: #6b4f52;
	font-size: 0.82rem;
	box-shadow: none;
}

.risk-alert summary {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	cursor: pointer;
	list-style: none;
}

.risk-alert summary::-webkit-details-marker {
	display: none;
}

.risk-alert summary strong {
	color: #7b0b1f;
	font-weight: 700;
}

.risk-alert-dot {
	width: 7px;
	height: 7px;
	flex: 0 0 7px;
	border-radius: 50%;
	background: rgba(179, 58, 75, 0.72);
}

.risk-alert-count {
	margin-left: 0.35rem;
	color: #8a6267;
}

.risk-alert-content {
	margin-top: 0.45rem;
	padding-top: 0.45rem;
	border-top: 1px solid rgba(179, 58, 75, 0.10);
}

.risk-alert-content p {
	margin: 0 0 0.35rem;
	color: #7b6265;
}

.risk-alert-content ul {
	max-height: 160px;
	margin: 0;
	padding-left: 1.1rem;
	overflow-y: auto;
}

.risk-alert-content li {
	margin: 0.18rem 0;
}

.risk-alert-content li span {
	color: #8a6267;
}

.table-wrap { overflow-x: auto; margin-top: 1rem; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
	padding: 0.9rem 0.75rem;
	border-bottom: 1px solid rgba(148, 163, 184, 0.18);
	text-align: left;
	vertical-align: top;
}
.table th { color: var(--muted); font-size: 0.84rem; text-transform: uppercase; letter-spacing: 0.08em; }

.list { display: grid; gap: 0.8rem; margin-top: 1rem; }
.list-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.95rem 1rem;
	border-radius: 16px;
	background: rgba(255, 255, 255, 0.72);
	border: 1px solid rgba(148, 163, 184, 0.18);
}

.student-groups {
	display: grid;
	gap: 1rem;
	margin-top: 1rem;
}

.student-toolbar {
	margin-top: 1rem;
	padding: 1rem;
	border-radius: 18px;
	background: rgba(255,255,255,0.78);
	border: 1px solid rgba(123, 11, 31, 0.08);
}

.student-toolbar-head {
	display: flex;
	align-items: start;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	margin-bottom: 1rem;
}

.student-toolbar-kicker {
	margin: 0 0 0.35rem;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-size: 0.75rem;
	font-weight: 800;
	color: var(--brand);
}

.student-toolbar-title {
	margin: 0;
	font-family: 'Space Grotesk', sans-serif;
	font-size: 1.02rem;
	letter-spacing: -0.03em;
	color: var(--ink);
}

.student-filter-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto auto;
	gap: 0.9rem;
	align-items: end;
}

.student-filter-field-wide { min-width: 0; }
.student-filter-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
	justify-content: flex-end;
	align-items: center;
}

.student-group-card {
	padding: 1rem;
	border-radius: 18px;
	background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(252, 247, 248, 0.92));
	border: 1px solid rgba(123, 11, 31, 0.08);
	box-shadow: 0 12px 28px rgba(43, 11, 15, 0.05);
}

.student-group-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.75rem;
}

.student-group-title,
.student-shift-title {
	margin: 0;
	font-family: 'Space Grotesk', sans-serif;
	letter-spacing: -0.02em;
}

.student-group-title { font-size: 1.15rem; }
.student-group-subtitle { margin: 0.25rem 0 0; color: var(--muted); }

.student-shift-block {
	margin-top: 0.9rem;
	padding-top: 0.9rem;
	border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.student-shift-title {
	font-size: 0.92rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--brand);
	margin: 0 0 0.55rem;
}

.muted { color: var(--muted); }
.card-title { font-size: clamp(1.3rem, 2vw, 1.7rem); }
.card-subtitle { margin: 0.35rem 0 0; }

.qr-box {
	display: grid;
	place-items: center;
	padding: 1rem;
	margin-top: 1rem;
	background: rgba(255, 255, 255, 0.88);
	border-radius: 20px;
	border: 1px solid rgba(148, 163, 184, 0.18);
}
.qr-box svg { width: min(280px, 100%); height: auto; }
.qr-url { margin-top: 1rem; word-break: break-all; }
.reader-box { margin-top: 1rem; overflow: hidden; border-radius: 18px; border: 1px solid rgba(148, 163, 184, 0.18); }

/* Visual feedback on scan result */
.reader-box.scan-success {
	border-color: rgba(16,185,129,0.9);
	box-shadow: 0 0 0 6px rgba(16,185,129,0.08);
}
.reader-box.scan-duplicate {
	border-color: rgba(220, 38, 38, 0.95);
	box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.08);
}
.reader-box.scan-error {
	border-color: rgba(191, 90, 242, 0.9);
	box-shadow: 0 0 0 6px rgba(191, 90, 242, 0.06);
}

/* Large overlay feedback inside the reader for immediate visibility */
.scan-feedback {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	z-index: 1200;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.6rem 1rem;
	border-radius: 12px;
	min-width: 60%;
	text-align: center;
	font-weight: 700;
	font-size: 1.05rem;
	opacity: 0;
	transition: opacity 180ms ease, transform 180ms ease;
	pointer-events: none;
}
.scan-feedback.visible { opacity: 1; transform: translate(-50%, -48%); }
.scan-feedback.ok { color: #064e3b; background: rgba(236, 253, 245, 0.96); border: 2px solid rgba(16,185,129,0.28); }
.scan-feedback.duplicate { color: #7f1d1d; background: rgba(254, 242, 242, 0.98); border: 2px solid rgba(220,38,38,0.28); }
.scan-feedback.error { color: #4c1d95; background: rgba(244,240,255,0.98); border: 2px solid rgba(124,58,237,0.12); }

/* Instruction overlay and last-scanned summary */
.reader-instruction {
	position: absolute;
	left: 50%;
	bottom: 14px;
	transform: translateX(-50%);
	z-index: 1000;
	background: rgba(255,255,255,0.9);
	color: var(--brand);
	padding: 0.5rem 0.9rem;
	border-radius: 999px;
	font-weight: 700;
	box-shadow: 0 8px 24px rgba(43,11,15,0.06);
	font-size: 0.98rem;
}

.last-scanned {
	margin-top: 12px;
	padding: 0.9rem 1rem;
	border-radius: 14px;
	background: rgba(255,255,255,0.95);
	border: 1px solid rgba(148,163,184,0.12);
	box-shadow: var(--shadow);
	font-weight: 700;
	color: var(--brand-2);
	text-align: center;
	font-size: 1rem;
}

.result { margin-top: 1rem; }
.result .ok, .result .error {
	padding: 0.95rem 1rem;
	border-radius: 14px;
	border: 1px solid;
}
.result .ok { color: #065f46; background: rgba(236, 253, 245, 0.95); border-color: rgba(16, 185, 129, 0.28); }
.result .error { color: #991b1b; background: rgba(254, 242, 242, 0.95); border-color: rgba(239, 68, 68, 0.28); }
/* Informational result state used during sending or duplicate notices */
.result .info {
	padding: 0.95rem 1rem;
	border-radius: 14px;
	border: 1px solid rgba(123,11,31,0.08);
	color: var(--brand);
	background: rgba(250, 243, 244, 0.95);
	border-color: rgba(123,11,31,0.12);
}

.meta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; margin-top: 1rem; }
.photo-preview { margin-top: 1rem; padding: 0.8rem; border-radius: 16px; background: rgba(255, 255, 255, 0.9); border: 1px solid rgba(148, 163, 184, 0.18); }
.photo-preview img { max-height: 280px; width: 100%; object-fit: cover; border-radius: 12px; }
.section-block { margin-top: 1.2rem; }
.section-title { margin: 0 0 0.8rem; font-family: 'Space Grotesk', sans-serif; }
.form-inline { display: flex; align-items: center; gap: 0.7rem; }

@media (max-width: 920px) {
	.grid-2, .grid-3, .form-grid, .meta-grid { grid-template-columns: 1fr; }
	.topbar, .card-head { flex-direction: column; align-items: stretch; }
	.nav { justify-content: flex-start; }
}

/* Home page specific layout tweaks */
.home-grid {
	display: flex;
	gap: 2rem;
	align-items: center;
	justify-content: center;
	padding: 20px 0;
	min-height: calc(100vh - 120px);
}
.login-panel {
	max-width: 560px;
	width: 100%;
	padding: 2rem 2rem;
	background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
	border-radius: 18px;
	box-shadow: 0 28px 64px rgba(43,11,15,0.14);
	backdrop-filter: blur(8px) saturate(120%);
	border: 1px solid rgba(255,255,255,0.05);
	transform: translateY(-18vh);
}
.logo-card { max-width: 420px; }

/* Hide logo on desktop to keep login fully centered */
.logo-card { display: none; }

.home-grid { align-items: center; }

.login-panel .card-title, .login-panel .card-subtitle {
	color: var(--ink);
}


.login-panel .form { gap: 1.15rem; }
.login-panel .card-title { font-size: 1.35rem; margin-bottom: 0.35rem; }
.login-panel .card-subtitle { font-size: 0.95rem; margin-bottom: 1rem; }
.login-panel .input {
	padding: 1.15rem 1.25rem;
	font-size: 1.03rem;
	border-radius: 12px;
}
.login-panel .input:focus { box-shadow: 0 8px 28px rgba(123,11,31,0.10); border-color: rgba(123,11,31,0.68); }

.btn { padding: 1.05rem 1.6rem; font-size: 1.02rem; }
.btn { border-radius: 999px; }

/* make login area vertically centered in viewport */
.home-grid { min-height: calc(100vh - 120px); }

/* subtle visual tweak for logo card */
.logo-card { background: linear-gradient(180deg, rgba(255,250,250,0.5), rgba(255,250,250,0.15)); border-radius: 18px; border: 1px solid rgba(139,11,31,0.04); box-shadow: 0 10px 30px rgba(43,11,15,0.06); }

@media (max-width: 920px) {
	.home-grid { flex-direction: column; }
	.logo-card { order: -1; display: block; }
	.login-panel { transform: none; max-width: 92%; padding: 1.25rem; }
	.login-panel .card-title { font-size: 1.15rem; }
}
