@font-face {
	font-family: "AIAEverest";
	src: url("/fonts/AIAEverest-Regular.otf") format("opentype");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

:root {
	--color-bg: #ffffff;
	--color-accent: #D00047;
	--color-accent-100: #fce6ed;
	--color-accent-700: #8c0031;
	--color-text: #1a1a1a;
	--color-text-muted: rgba(26, 26, 26, 0.6);
	--color-divider: #e5e5e5;
	--color-neutral-200: #ececec;
	--tb: calc(min(100vw, 460px) / 447);
	--font-heading: "AIAEverest", "Segoe UI", Arial, sans-serif;
	--font-body: "AIAEverest", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: var(--font-body);
	color: var(--color-text);
	background: var(--color-bg);
}

.av-app {
	min-height: 100vh;
	background: var(--color-bg);
	display: flex;
	justify-content: center;
}

.av-shell {
	position: relative;
	width: 100%;
	max-width: 460px;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	color: var(--color-text);
	background: var(--color-bg);
	overflow: hidden;
}

.av-shell::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	background-image: url('/img/AIA-Selangkah-Berkat-KeyVisual-transparent.png');
	background-repeat: no-repeat;
	background-position: right calc(var(--tb) * 94);
	background-size: 340px auto;
	opacity: 0.2;
	pointer-events: none;
}

.av-topbar, .av-screen {
	position: relative;
	z-index: 1;
}

/* Top banner on every participant page (markup lives in _topbar.cfm): Selangkah Berkat logo on the left,
   "Satu inisiatif oleh" + the AIA Public Takaful | media prima logo on the right. Drawn from the banner mockup
   (447 units wide x 94 tall), so every size is a multiple of --tb (1/447 of the page width, capped at the
   460px shell) and the banner scales like the mockup on any phone. */
.av-topbar {
	background: #CF174B;
	color: #fff;
}

.av-topbar__stage {
	position: relative;
	width: 100%;
	max-width: 460px;
	height: calc(var(--tb) * 94);
	margin: 0 auto;
}
.av-topbar__stage > * { position: absolute; display: block; }
.av-topbar__campaign-logo { left: calc(var(--tb) * 62); top: calc(var(--tb) * 22); width: calc(var(--tb) * 124); height: auto; }
.av-topbar__by {
	left: calc(var(--tb) * 207); width: calc(var(--tb) * 153); top: calc(var(--tb) * 35);
	text-align: center; white-space: nowrap; font-weight: 700;
	font-size: calc(var(--tb) * 9.5); line-height: calc(var(--tb) * 12);
}
.av-topbar__partner { left: calc(var(--tb) * 207); top: calc(var(--tb) * 52); width: calc(var(--tb) * 153); height: auto; }

.av-screen { padding: 4px 20px 40px; flex: 1; display: none; flex-direction: column; }
.av-screen.is-active { display: flex; }

.av-kicker { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent-700); margin-bottom: 6px; margin-top: 20px; }
.av-h1 { font-family: var(--font-heading); font-weight: 800; font-size: 26px; line-height: 1.15; margin: 0 0 10px; }
.av-p { font-size: 14px; line-height: 1.5; color: rgba(26,26,26,0.7); margin: 0 0 24px; }

.btn { padding: 12px 16px; border-radius: 8px; border: 1px solid transparent; font-weight: 700; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { opacity: 0.9; }
.btn-primary[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: #f4f4f5; color: var(--color-text); border-color: var(--color-divider); }
.btn-secondary:hover { background: #ebebec; }
.btn-ghost { background: transparent; color: var(--color-text); padding-inline: 0; }
.btn-ghost:hover { text-decoration: underline; }
.av-topbar .btn-ghost { color: #fff; }
.av-topbar .btn-ghost:hover { background: rgba(255,255,255,0.15); text-decoration: none; }
.av-topbar .btn-ghost:active { background: rgba(255,255,255,0.25); }

.av-social { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }

.av-divider { display: flex; align-items: center; gap: 12px; margin: 4px 0 20px; }
.av-divider__line { flex: 1; height: 1px; background: var(--color-divider); }
.av-divider__label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(26,26,26,0.55); }

.field { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.field:first-of-type { margin-top: 0; }
.field label { font-weight: 600; font-size: 0.85rem; }
.av-input { padding: 10px; border: 1px solid var(--color-divider); border-radius: 8px; font-size: 1rem; background: var(--color-bg); color: var(--color-text); }
.av-input::placeholder { color: rgba(26,26,26,0.4); }
.av-input:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 0; }
.av-input:disabled { background: #f4f4f5; color: var(--color-text-muted); cursor: not-allowed; }

/* intl-tel-input's own wrapper defaults to inline-block with no set width — without this the phone
   field would sit narrower than every other full-width field in this form. */
.iti { width: 100%; }

.av-error { font-size: 12.5px; font-weight: 600; color: var(--color-accent-700); margin: 10px 0 0; }

.av-icon-badge { width: 56px; height: 56px; background: var(--color-accent-100); border-radius: 50%; display: flex; align-items: center; justify-content: center; }

.seg { display: inline-flex; border: 1px solid var(--color-divider); border-radius: 999px; padding: 3px; background: #f4f4f5; }
.seg.seg-block { display: flex; width: 100%; }
.seg-opt { position: relative; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt label, .seg-opt > span { display: block; }
.seg-opt {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px 16px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	color: var(--color-text);
	cursor: pointer;
}
.seg-opt.is-active { background: var(--color-accent); color: #fff; }
.seg.seg-block .seg-opt { flex: 1; }

.card { background: var(--color-bg); color: var(--color-text); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; box-shadow: 0 1px 3px rgba(0,0,0,0.12); border: 1px solid var(--color-divider); }
.card-kicker { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-muted); font-weight: 700; }

.av-info-btn { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex: none; border-radius: 50%; border: 1px solid var(--color-accent); background: transparent; color: var(--color-accent); font-family: var(--font-heading); font-weight: 800; font-size: 11px; line-height: 1; cursor: pointer; padding: 0; }
.av-info-btn:hover, .av-info-btn:focus { background: var(--color-accent); color: #fff; }
.av-info-panel { background: var(--color-accent-100); border-radius: 10px; padding: 12px 14px; margin-top: 10px; }
.av-info-panel ul { margin: 0; padding-left: 18px; }
.av-info-panel li { font-size: 12.5px; line-height: 1.55; color: var(--color-accent-700); margin-bottom: 6px; }
.av-info-panel li:last-child { margin-bottom: 0; }
.av-info-samples-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-accent-700); margin-top: 10px; }
.av-info-samples { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.av-info-sample { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.av-info-sample img { width: 100%; max-width: 140px; border-radius: 8px; border: 1px solid var(--color-divider); }
.av-info-sample span { font-size: 11px; font-weight: 600; color: var(--color-accent-700); text-align: center; }


.av-success { font-size: 12.5px; color: var(--color-accent-700); margin: 0; }

.av-dropzone { width: 100%; aspect-ratio: 16 / 10; border: 1px dashed var(--color-divider); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--color-text-muted); font-size: 13px; text-align: center; cursor: pointer; overflow: hidden; }
.av-dropzone img { width: 100%; height: 100%; object-fit: cover; }

.av-ocr-status { font-size: 12.5px; margin: 10px 0 0; }
.av-ocr-status.pending { color: var(--color-text-muted); font-style: italic; }
.av-ocr-status.ready { color: var(--color-accent-700); font-weight: 600; }
.av-ocr-status.none { color: var(--color-text-muted); }

.av-entries { margin-top: 24px; }
.av-entry { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--color-divider); }
.av-entry__date { font-size: 14px; font-weight: 600; }
.av-entry__source { font-size: 12px; color: rgba(26,26,26,0.55); }
.av-entry__source a { color: var(--color-accent-700); text-decoration: underline; }
.av-entry__steps { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.av-entry__empty { font-size: 13px; color: rgba(26,26,26,0.55); }

.av-leaderboard-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--color-divider); }
.av-leaderboard-row:last-child { border-bottom: none; }
.av-leaderboard-row__rank { flex: 0 0 22px; height: 22px; border-radius: 50%; background: var(--color-accent); color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.av-leaderboard-row__name { flex: 1; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.av-leaderboard-row__steps { font-size: 14px; font-weight: 700; color: var(--color-accent-700); font-variant-numeric: tabular-nums; }
.av-leaderboard__empty { font-size: 13px; color: rgba(26,26,26,0.55); }

.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; margin-top: 4px; }
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-700); }
.tag-outline { background: transparent; color: var(--color-text-muted); border: 1px solid var(--color-divider); }

.av-progress-meta { font-size: 13px; color: var(--color-text-muted); margin-top: 4px; }
.av-meter-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.av-meter-label { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-muted); }
.av-meter-value { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.av-meter-track { height: 10px; width: 100%; background: var(--color-neutral-200); border-radius: 999px; position: relative; overflow: hidden; }
.av-meter-fill { height: 100%; background: var(--color-accent); border-radius: 999px; transition: width 0.34s cubic-bezier(0.22, 0.68, 0.36, 1); }

.av-personal-row { display: flex; justify-content: space-between; align-items: baseline; }
.av-personal-value { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; font-family: var(--font-heading); }

.av-doc-shell { width: 100%; max-width: 760px; min-height: 100vh; display: flex; flex-direction: column; background: var(--color-bg); }
.av-doc { padding: 32px 24px 64px; }
.av-doc__meta { font-size: 13px; color: var(--color-text-muted); margin: 0 0 28px; }
.av-doc h2 { font-family: var(--font-heading); font-weight: 700; font-size: 17px; margin: 30px 0 10px; color: var(--color-accent-700); }
.av-doc h2:first-of-type { margin-top: 4px; }
.av-doc p { font-size: 14.5px; line-height: 1.65; color: rgba(26,26,26,0.8); margin: 0 0 14px; }
.av-doc ul { padding-left: 20px; margin: 0 0 14px; }
.av-doc li { font-size: 14.5px; line-height: 1.65; color: rgba(26,26,26,0.8); margin-bottom: 6px; }
.av-doc a { color: var(--color-accent-700); }
.av-doc strong { color: var(--color-text); }

/* ---- Admin panel ---- */

.av-admin-login-shell { width: 100%; max-width: 380px; min-height: 100vh; margin: 0 auto; display: flex; flex-direction: column; justify-content: center; padding: 24px; }
.av-admin-login-card { background: var(--color-bg); border: 1px solid var(--color-divider); border-radius: 12px; padding: 32px; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.av-admin-login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.av-admin-login-brand img { height: 36px; width: auto; }
.av-admin-login-brand span { font-family: var(--font-heading); font-weight: 800; font-size: 18px; color: var(--color-accent); }

.av-admin-shell { width: 100%; min-height: 100vh; display: flex; flex-direction: column; background: var(--color-bg); }
.av-admin-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 16px 28px; background: var(--color-accent); color: #fff; }
.av-admin-nav__brand { height: 30px; width: auto; margin-right: 24px; display: block; }
.av-admin-nav a { color: rgba(255,255,255,0.85); text-decoration: none; font-size: 13.5px; font-weight: 600; padding: 8px 12px; border-radius: 6px; }
.av-admin-nav a:hover { background: rgba(255,255,255,0.15); color: #fff; }
.av-admin-nav a.is-active { background: rgba(255,255,255,0.22); color: #fff; }
.av-admin-nav__spacer { flex: 1; }
.av-admin-nav__lang { display: flex; align-items: center; gap: 2px; margin-right: 8px; padding: 3px; border-radius: 8px; background: rgba(255,255,255,0.12); }
.av-admin-nav__lang a { padding: 4px 10px; font-size: 12px; border-radius: 5px; }
.av-admin-nav__lang--light { background: var(--color-accent-100); }
.av-admin-nav__lang--light a { color: var(--color-accent-700); }
.av-admin-nav__lang--light a:hover { background: rgba(0,0,0,0.06); color: var(--color-accent-700); }
.av-admin-nav__lang--light a.is-active { background: var(--color-accent); color: #fff; }

.av-admin-main { max-width: 1160px; width: 100%; margin: 0 auto; padding: 28px 24px 64px; }
.av-admin-h1 { font-family: var(--font-heading); font-weight: 800; font-size: 22px; margin: 0 0 20px; }

.av-admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.av-admin-stat { background: var(--color-bg); border: 1px solid var(--color-divider); border-radius: 12px; padding: 18px 20px; }
.av-admin-stat__label { font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-muted); font-weight: 700; }
.av-admin-stat__value { font-size: 26px; font-weight: 800; font-family: var(--font-heading); margin-top: 6px; }
.av-admin-stat__meta { font-size: 12px; color: var(--color-text-muted); margin-top: 4px; }

.av-admin-card { background: var(--color-bg); border: 1px solid var(--color-divider); border-radius: 12px; padding: 24px; margin-bottom: 24px; }
.av-admin-card h2 { font-family: var(--font-heading); font-weight: 700; font-size: 16px; margin: 0 0 16px; }

.av-admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.av-admin-table th, .av-admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--color-divider); vertical-align: middle; }
.av-admin-table th { font-size: 11.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--color-text-muted); font-weight: 700; }
.av-admin-table tbody tr:hover { background: #fafafa; }
.av-admin-table a { color: var(--color-accent-700); }
.av-admin-table img.av-admin-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--color-divider); }

.av-admin-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.av-admin-form .field { margin-top: 0; }
.av-admin-form-inline { display: flex; gap: 8px; align-items: center; }
.av-admin-form-inline .av-input { width: 90px; }

.av-admin-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.av-admin-badge--warn { background: var(--color-accent-100); color: var(--color-accent-700); }
.av-admin-badge--ok { background: #e7f6ec; color: #1c7a3c; }

.av-admin-alert { padding: 12px 16px; border-radius: 8px; font-size: 13.5px; margin-bottom: 20px; }
.av-admin-alert--error { background: var(--color-accent-100); color: var(--color-accent-700); }
.av-admin-alert--ok { background: #e7f6ec; color: #1c7a3c; }

.av-admin-btn-icon { background: transparent; border: 1px solid var(--color-divider); border-radius: 6px; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 13px; }
.av-admin-btn-icon:hover { background: #f4f4f5; }

.av-admin-pager { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 16px; border-top: 1px solid var(--color-divider); }
.av-admin-pager__label { font-size: 13px; color: var(--color-text-muted); }
.av-admin-pager__disabled { opacity: 0.4; pointer-events: none; }
