/* AMLAB base — shared utilities ported from the KBIT design system, header/footer, buttons. */

/* Preflight parity. This theme builds Tailwind with preflight disabled, so the base
   reset it normally ships is missing. Without it: `w-full`+`px-*`+`border` overflow
   (content-box), and a bare `border` utility draws nothing (default border-style:none,
   width:medium). Re-declaring the four properties Tailwind's preflight sets makes every
   border/box utility behave as designed — same block Tailwind emits. */
*,
::before,
::after {
	box-sizing: border-box;
	border-width: 0;
	border-style: solid;
	border-color: #e5e7eb;
}

/* The `hidden` attribute must beat display utilities. A Tailwind `.block`/`.flex`
   class (author stylesheet) otherwise overrides the UA `[hidden]{display:none}` at
   equal specificity, leaving elements toggled via `el.hidden` still visible
   (e.g. the attendee-group fields in the registration form). */
[hidden] {
	display: none !important;
}

/* Preflight margin reset — Tailwind zeroes default block margins so utilities own all
   spacing. Scoped to the Tailwind-built markup (.kbit-container) to avoid collapsing
   Gutenberg prose. `:where(.kbit-container)` keeps specificity at (0,0,1) — like
   Tailwind's own element reset — so mt-*/mb-* utilities (0,1,0) still win (previously
   `.kbit-container h3` was (0,1,1) and clobbered utility margins). */
:where(.kbit-container) blockquote,
:where(.kbit-container) dl,
:where(.kbit-container) dd,
:where(.kbit-container) h1,
:where(.kbit-container) h2,
:where(.kbit-container) h3,
:where(.kbit-container) h4,
:where(.kbit-container) h5,
:where(.kbit-container) h6,
:where(.kbit-container) hr,
:where(.kbit-container) figure,
:where(.kbit-container) p,
:where(.kbit-container) pre {
	margin: 0;
}

::selection {
	background: rgba(197, 161, 90, 0.35);
}

/* theme.json emits `.has-text-color{color:text !important}` which, being later
 * in the cascade with equal specificity, overrides `.has-white-color`. Restore
 * white with a higher-specificity !important so white headings/text stay white. */
.has-white-color.has-text-color {
	color: var(--wp--preset--color--white) !important;
}
.has-gold-color.has-text-color {
	color: var(--wp--preset--color--gold) !important;
}
.has-navy-color.has-text-color {
	color: var(--wp--preset--color--navy) !important;
}
.has-aurora-color.has-text-color {
	color: var(--wp--preset--color--aurora) !important;
}

html {
	scroll-behavior: smooth;
}

/* WordPress inserts a 1.5rem gap between top-level blocks
 * (`:where(.wp-site-blocks) > *`). Our sections are full-bleed and manage
 * their own padding, so the gap only leaves a white strip under the sticky
 * header — remove it. */
.wp-site-blocks > * {
	margin-block-start: 0;
	margin-block-end: 0;
}

.kbit-container {
	width: min(100% - 2rem, 1180px);
	margin-inline: auto;
}

/* ===== Shared surface utilities ===== */

.kbit-shell-bg {
	background:
		linear-gradient(115deg, rgba(255, 255, 255, 0.92), rgba(246, 243, 236, 0.82)),
		radial-gradient(circle at 72% 28%, rgba(197, 161, 90, 0.15), transparent 22rem),
		radial-gradient(circle at 86% 16%, rgba(79, 120, 165, 0.16), transparent 20rem);
}

.portrait-placeholder {
	background:
		linear-gradient(180deg, rgba(238, 241, 248, 0.75), rgba(255, 255, 255, 0.95)),
		radial-gradient(circle at 50% 28%, rgba(32, 41, 64, 0.12), transparent 5rem);
}

.kbit-dark-hero {
	color: #fff;
	background-color: #0c1220;
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
		radial-gradient(ellipse 80% 55% at 50% -10%, rgba(79, 120, 165, 0.28) 0%, transparent 65%),
		radial-gradient(ellipse 34% 28% at 58% 64%, rgba(233, 220, 195, 0.07) 0%, transparent 60%),
		radial-gradient(ellipse 40% 35% at 88% 45%, rgba(197, 161, 90, 0.09) 0%, transparent 50%),
		radial-gradient(ellipse 50% 40% at 12% 90%, rgba(21, 28, 44, 0.55) 0%, transparent 50%),
		linear-gradient(165deg, rgba(12, 18, 32, 1) 0%, rgba(21, 28, 44, 1) 55%, rgba(15, 24, 40, 1) 100%);
	background-size: 44px 44px, 44px 44px, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
}

.kbit-glass {
	background: rgba(255, 255, 255, 0.055);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	border: 1px solid rgba(255, 255, 255, 0.09);
}

.kbit-glass-light {
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: blur(22px) saturate(150%);
	-webkit-backdrop-filter: blur(22px) saturate(150%);
}

.kbit-grid-pattern {
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
	background-size: 44px 44px;
}

.text-gradient-gold {
	background: linear-gradient(135deg, #C5A15A 0%, #e9cc8a 45%, #C5A15A 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.kbit-pillar {
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.02) 100%);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border: 1px solid rgba(255, 255, 255, 0.1);
	transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.kbit-pillar:hover {
	transform: translateY(-4px);
	border-color: rgba(197, 161, 90, 0.35);
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), 0 0 40px rgba(197, 161, 90, 0.1);
}

.kbit-beam {
	background: linear-gradient(90deg, transparent, rgba(197, 161, 90, 0.65), transparent);
}

@keyframes kbit-pulse-soft {
	0%, 100% { opacity: 0.55; transform: scale(1); }
	50% { opacity: 1; transform: scale(1.5); }
}

.kbit-pulse-dot {
	animation: kbit-pulse-soft 2.4s ease-in-out infinite;
}

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

.amlab-footer .amlab-footer__tagline {
	color: rgba(255, 255, 255, 0.65);
	max-width: 22rem;
}

.amlab-footer a {
	color: rgba(255, 255, 255, 0.72);
	text-decoration: none;
	transition: color 0.2s ease;
}

.amlab-footer a:hover {
	color: #C5A15A;
}

.amlab-footer__rule {
	opacity: 0.5;
	width: 100%;
}

.amlab-footer__copyright {
	color: rgba(255, 255, 255, 0.45);
}

/* Top CTA band */
.amlab-footer-band {
	gap: 1.5rem 2rem;
	margin-bottom: 2.5rem;
}

.amlab-footer-band h2 {
	max-width: 32rem;
	line-height: 1.2;
}

/* Main columns row */
.amlab-footer-main {
	gap: 2.5rem 3rem;
	align-items: flex-start;
}

.amlab-footer-brand .amlab-footer__social {
	margin-top: 1.25rem;
	gap: 0.25rem;
}

.amlab-footer-brand .amlab-footer__social a { color: #fff; }

.amlab-footer-cols {
	gap: 2rem 3rem;
	flex: 1;
	justify-content: flex-end;
}

.amlab-footer-col {
	min-width: 8.5rem;
}

.amlab-footer-col__title {
	color: #fff;
	font-weight: 700;
	font-size: 0.82rem;
	letter-spacing: 0.02em;
	margin-bottom: 0.9rem;
}

.amlab-footer-col__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
}

.amlab-footer-col__list li { font-size: 0.85rem; }

.amlab-footer-col__contact {
	color: rgba(255, 255, 255, 0.72);
	line-height: 1.7;
}

@media (max-width: 900px) {
	.amlab-footer-cols { justify-content: flex-start; }
}

/* ===== Language switcher ===== */

/* Footer lists never show markers/indent (preflight is off, so belt-and-braces). */
.amlab-footer ul {
	list-style: none;
	margin: 0;
	padding-left: 0;
}

/* Outer pill container with a subtle border/bg (matches the Next reference). */
.amlab-lang-switch {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	margin: 0 0.5rem;
	padding: 4px;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.05);
}

.amlab-lang-switch__item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 28px;
	min-width: 32px;
	padding: 0 8px;
	border: 1px solid transparent;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.7);
	letter-spacing: 0.02em;
	transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.amlab-lang-switch__item:hover { color: #fff; }

/* Active language — gold border, midnight fill, gold text. */
.amlab-lang-switch__item.is-active {
	border-color: rgba(197, 161, 90, 0.6);
	background: #151C2C;
	color: #C5A15A;
}

/* ===== Buttons ===== */

/* Bản CSS của core (wp-block-library) không được nạp ở front-end, phần đệm nút
   đến từ theme.json — nên thẻ <a> vẫn là display:inline. Đệm dọc của phần tử
   inline được vẽ ra ngoài mà KHÔNG tính vào chiều cao ô .wp-block-button: ô chỉ
   cao bằng một dòng chữ (~23px) trong khi nút vẽ ra 43px. Xếp ngang thì không
   lộ, còn xuống dòng trên điện thoại là hai nút chồng lên nhau. */
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
}

.is-style-amlab-cta-gold .wp-block-button__link {
	background: linear-gradient(135deg, #d4ac62 0%, #C5A15A 60%, #b08d47 100%);
	color: #151C2C;
	box-shadow: 0 0 24px rgba(197, 161, 90, 0.35), 0 8px 24px rgba(0, 0, 0, 0.4);
	transition: box-shadow 0.3s ease, transform 0.2s ease;
	border-radius: 999px;
}

.is-style-amlab-cta-gold .wp-block-button__link:hover {
	box-shadow: 0 0 44px rgba(197, 161, 90, 0.55), 0 8px 24px rgba(0, 0, 0, 0.4);
	transform: translateY(-1px);
	color: #151C2C;
}

.is-style-amlab-outline-light .wp-block-button__link {
	background: transparent;
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 999px;
	transition: border-color 0.2s ease, background 0.2s ease;
}

.is-style-amlab-outline-light .wp-block-button__link:hover {
	border-color: #C5A15A;
	color: #C5A15A;
	background: rgba(197, 161, 90, 0.08);
}

/* Registration event card — active (checked) state: gold top border + gold ring.
   Done in CSS because a multi-layer box-shadow can't be expressed as a Tailwind
   arbitrary value (its comma breaks class extraction), and Tailwind `ring-*` needs
   the preflight vars this theme omits. */
.amlab-reg-event:has(:checked) {
	border-top-color: #C5A15A;
	box-shadow: 0 0 0 2px rgba(197, 161, 90, 0.45), 0 6px 18px rgba(0, 0, 0, 0.18);
}

/* Sự kiện đã đóng đăng ký: làm mờ cả thẻ, không bắt chuột, và gắn nhãn thay ô tick. */
.amlab-reg-event--closed {
	opacity: .55;
	filter: grayscale(.65);
	cursor: not-allowed;
}
.amlab-reg-event-closed-tag {
	flex: none;
	border-radius: 999px;
	background: #F3F4F6;
	padding: 3px 10px;
	color: #6B7280;
	font-size: 11px;
	font-weight: 700;
	white-space: nowrap;
}

/* Registration form control focus glow. Real box-shadow because Tailwind `ring-*`
   depends on the preflight ring vars this theme omits. Mirrors focus:ring-kbit-gold/15. */
.amlab-reg-input:focus {
	box-shadow: 0 0 0 2px rgba(197, 161, 90, 0.15);
}

/* The register page has its own membership CTA in the form, so hide the global
   footer "Tham gia Mạng lưới KBIT" band there to avoid a duplicate. */
.amlab-register-page .amlab-home-cta {
	display: none;
}

/* Client-side validation state (registration-validate.js). */
.amlab-invalid {
	border-color: #dc2626 !important;
}
.amlab-invalid:focus {
	box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15) !important;
}
.amlab-err {
	display: block;
	margin-top: 6px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	color: #dc2626;
}
.amlab-err[hidden] {
	display: none;
}

/* ===== Registration thank-you page (post-submit) ===== */
/* Self-contained; CSS vars scoped to the page so they never leak globally. Rendered
   outside .kbit-container so the container margin reset can't collapse its spacing. */
.kbit-thankyou-page {
	--ty-navy: #202940;
	--ty-midnight: #151c2c;
	--ty-gold: #c5a15a;
	--ty-aurora: #4f78a5;
	--ty-ivory: #f6f3ec;
	--ty-border: #e6eaf0;
	box-sizing: border-box;
	padding: 56px 20px;
	background: #f6f3ec;
	color: #151b2f;
}
.kbit-thankyou-wrap {
	box-sizing: border-box;
	width: min(1120px, 100%);
	margin: 0 auto;
}
.kbit-thankyou-card {
	box-sizing: border-box;
	padding: 40px;
	border: 1px solid var(--ty-border);
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 14px 40px rgba(21, 28, 44, 0.08);
}
.kbit-thankyou-grid {
	display: grid;
	grid-template-columns: 1fr 320px;
	gap: 32px;
	align-items: start;
}
.kbit-badge {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	border-radius: 8px;
	background: #ecf9f0;
	color: #1f7a43;
	font-size: 12px;
	font-weight: 900;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}
.kbit-badge-mark {
	display: inline-flex;
	width: 19px;
	height: 19px;
	align-items: center;
	justify-content: center;
	border: 2px solid currentColor;
	border-radius: 50%;
	font-size: 13px;
	line-height: 1;
}
.kbit-thankyou-title {
	margin: 28px 0 0;
	color: var(--ty-navy);
	font-size: clamp(36px, 5vw, 64px);
	line-height: 1.04;
	font-weight: 900;
}
.kbit-thankyou-lead {
	max-width: 760px;
	margin: 26px 0 0;
	color: rgba(21, 27, 47, 0.76);
	font-size: 20px;
	line-height: 1.75;
}
.kbit-next-box {
	margin-top: 32px;
	padding: 22px;
	border: 1px solid var(--ty-border);
	border-radius: 8px;
	background: var(--ty-ivory);
}
.kbit-section-label {
	margin: 0;
	color: var(--ty-aurora);
	font-size: 12px;
	font-weight: 900;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}
.kbit-next-table {
	margin-top: 16px;
	border-top: 1px solid var(--ty-border);
}
.kbit-next-row {
	display: grid;
	grid-template-columns: 104px 1fr;
	gap: 18px;
	padding: 15px 0;
	border-bottom: 1px solid var(--ty-border);
}
.kbit-next-row:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}
.kbit-next-number {
	margin: 0;
	color: var(--ty-navy);
	font-size: 12px;
	font-weight: 900;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}
.kbit-next-text {
	margin: 0;
	color: rgba(21, 27, 47, 0.76);
	font-size: 15px;
	line-height: 1.7;
}
.kbit-side-panel {
	box-sizing: border-box;
	padding: 24px;
	border: 1px solid rgba(197, 161, 90, 0.5);
	border-radius: 8px;
	background: #fbf4e6;
}
.kbit-code-list {
	display: grid;
	gap: 10px;
	margin-top: 16px;
}
.kbit-code {
	margin: 0;
	padding: 13px 14px;
	border: 1px solid rgba(197, 161, 90, 0.5);
	border-radius: 6px;
	background: #fff;
	color: var(--ty-navy);
	font-size: 15px;
	font-weight: 900;
}
.kbit-code-note {
	margin: 16px 0 0;
	color: rgba(21, 27, 47, 0.68);
	font-size: 15px;
	line-height: 1.7;
}
.kbit-support {
	margin-top: 24px;
	padding-top: 22px;
	border-top: 1px solid rgba(197, 161, 90, 0.35);
}
.kbit-support-title {
	margin: 0;
	color: var(--ty-navy);
	font-size: 20px;
	font-weight: 900;
	line-height: 1.35;
}
.kbit-support-text {
	margin: 14px 0 0;
	color: rgba(21, 27, 47, 0.68);
	font-size: 15px;
	line-height: 1.7;
}
.kbit-support-email {
	display: block;
	margin-top: 12px;
	color: var(--ty-aurora);
	font-size: 15px;
	font-weight: 900;
	text-decoration: none;
	overflow-wrap: anywhere;
}
.kbit-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin-top: 34px;
	padding-top: 26px;
	border-top: 1px solid var(--ty-border);
}
.kbit-button {
	display: inline-flex;
	min-height: 48px;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	padding: 0 24px;
	border-radius: 6px;
	color: var(--ty-midnight);
	font-size: 15px;
	font-weight: 900;
	text-decoration: none;
}
.kbit-button-primary {
	background: var(--ty-gold);
}
.kbit-button-secondary {
	border: 1px solid rgba(32, 41, 64, 0.25);
	background: #fff;
	color: var(--ty-navy);
}
@media (max-width: 900px) {
	.kbit-thankyou-card { padding: 28px 22px; }
	.kbit-thankyou-grid { grid-template-columns: 1fr; }
	.kbit-side-panel { width: 100%; }
}
@media (max-width: 560px) {
	.kbit-thankyou-page { padding: 34px 14px; }
	.kbit-thankyou-title { font-size: 34px; }
	.kbit-thankyou-lead { font-size: 17px; }
	.kbit-next-row { grid-template-columns: 1fr; gap: 6px; }
	.kbit-button { width: 100%; }
}

/* ===== Contact Form 7 ===== */

.amlab-form-wrap { box-shadow: 0 14px 40px rgba(21, 28, 44, 0.08); }

.wpcf7 label {
	display: block;
	font-size: 0.85rem;
	font-weight: 600;
	color: #202940;
	margin-bottom: 1rem;
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 select,
.wpcf7 textarea {
	width: 100%;
	margin-top: 0.35rem;
	padding: 0.7rem 0.9rem;
	border: 1px solid #E6EAF0;
	border-radius: 0.6rem;
	background: #F6F3EC;
	font-size: 0.9rem;
	color: #151B2F;
	font-weight: 400;
}

.wpcf7 input:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
	outline: none;
	border-color: #C5A15A;
	background: #fff;
	box-shadow: 0 0 0 3px rgba(197, 161, 90, 0.15);
}

.wpcf7 textarea { min-height: 120px; resize: vertical; }

.wpcf7-checkbox .wpcf7-list-item,
.wpcf7-acceptance {
	display: block;
	font-weight: 400;
	font-size: 0.85rem;
	margin: 0.35rem 0;
}

.wpcf7 .wpcf7-submit {
	background: linear-gradient(135deg, #d4ac62 0%, #C5A15A 60%, #b08d47 100%);
	color: #151C2C;
	font-weight: 700;
	border: none;
	border-radius: 999px;
	padding: 0.8rem 2rem;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(197, 161, 90, 0.25);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
	margin-top: 0.5rem;
}

.wpcf7 .wpcf7-submit:hover {
	box-shadow: 0 0 30px rgba(197, 161, 90, 0.4);
	transform: translateY(-1px);
}

.wpcf7-response-output {
	border-radius: 0.6rem;
	margin: 1rem 0 0;
	padding: 0.8rem 1rem;
	font-size: 0.85rem;
}

.wpcf7 form.sent .wpcf7-response-output { border-color: #4F78A5; color: #202940; }

/* ===== Reduced motion ===== */

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.kbit-pulse-dot { animation: none; }
	.kbit-pillar,
	.kbit-pillar:hover,
	.is-style-amlab-cta-gold .wp-block-button__link:hover { transform: none; transition: none; }
}