/* =====================================================================
   APP CHROME: vertical sidebar + light top bar (view_header.php /
   view_footer.php), and the sign-in pages' centred card (.auth-page).
   Page content is styled by app_modern.css.
   ===================================================================== */

:root {
	--brand-primary: #2563eb;
	--brand-primary-rgb: 37, 99, 235;
	--brand-primary-dark: #1d4ed8;
	--brand-primary-soft: #eef4ff;
	--brand-primary-border: #c7d7fb;
	--brand-primary-ink: #1e40af;

	--sidebar-width: 248px;
	--sidebar-strip: 60px;
	--sidebar-bg: #1b2330;
	--sidebar-border: rgba(255, 255, 255, 0.07);
	--sidebar-text: rgba(255, 255, 255, 0.82);
	--sidebar-text-muted: rgba(255, 255, 255, 0.48);
	--sidebar-hover-bg: rgba(255, 255, 255, 0.07);
	--sidebar-hover-text: #fff;
	--sidebar-active-bg: var(--brand-primary);
	--sidebar-active-text: #fff;
	--sidebar-sub-text: rgba(255, 255, 255, 0.66);
	--sidebar-sub-active-bg: rgba(var(--brand-primary-rgb), 0.28);
	--sidebar-sub-active-text: #fff;
	--sidebar-scroll-thumb: rgba(255, 255, 255, 0.15);

	--topbar-height: 60px;
	--topbar-bg: #ffffff;
	--topbar-border: #e3e8ef;
	--topbar-text: #1f2a37;
	--topbar-muted: #6b7a90;
	--topbar-hover-bg: #f1f4f9;

	--app-bg: #f3f5f8;
	--app-font: 'Mukta', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

body.app-modern {
	background-color: var(--app-bg);
	font-family: var(--app-font);
}

.tooltip,
.popover {
	font-family: var(--app-font);
}

/* ---- Main wrapper ---- */
#main-wrapper {
	margin-left: var(--sidebar-width);
	min-height: 100vh;
	padding: calc(var(--topbar-height) + 24px) 32px 48px;
	transition: margin-left 0.25s ease;
}

/* The page fills the space beside the sidebar at every width (Bootstrap would
   otherwise fix .container at 750/970/1170px, wider than the room there is
   beside a 248px sidebar). */
/* Some widget views nest a .container of their own; keep those fluid too */
#main-wrapper .container { width: 100%; }
#main-wrapper .container .container { margin-top: 0; margin-bottom: 0; }

#main-wrapper > .container {
	max-width: 1600px;
	margin-top: 0;          /* style.css's 50px was room for the old fixed navbar */
	margin-left: auto;
	margin-right: auto;
	padding: 0;
}

/* ---- Icons (inline SVG from app_icon_svg() in chchdb_helper.php) ---- */
.app-icon {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.75;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex-shrink: 0;
}

/* The app's mark: a database glyph on the brand colour */
.brand-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	border-radius: 9px;
	background: var(--brand-primary);
	color: #fff;
}

.brand-badge .app-icon {
	width: 19px;
	height: 19px;
	stroke-width: 1.9;
}

.brand-badge--sm {
	width: 28px;
	height: 28px;
	border-radius: 8px;
}

.brand-badge--sm .app-icon {
	width: 17px;
	height: 17px;
}

/* =====================================================================
   SIDEBAR
   ===================================================================== */
#app-sidebar {
	position: fixed;
	top: 0;
	left: 0;
	width: var(--sidebar-width);
	height: 100vh;
	height: 100dvh;
	background: var(--sidebar-bg);
	display: flex;
	flex-direction: column;
	z-index: 1000;
	box-shadow: 2px 0 8px rgba(0, 0, 0, 0.16);
	overflow: hidden;
	transition: transform 0.25s ease, width 0.25s ease;
}

.sidebar-brand {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
	height: var(--topbar-height);
	padding: 0 12px 0 16px;
	border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand a {
	display: flex;
	align-items: center;
	gap: 11px;
	flex: 1;
	min-width: 0;
	text-decoration: none;
}

.sidebar-brand a:hover,
.sidebar-brand a:focus {
	text-decoration: none;
}

.sidebar-brand-text {
	color: #fff;
	font-size: 19px;
	font-weight: 700;
	letter-spacing: 0.01em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.desktop-sidebar-toggle {
	flex-shrink: 0;
	margin-left: auto;
	padding: 5px;
	border: none;
	border-radius: 6px;
	background: none;
	color: var(--sidebar-text-muted);
	line-height: 0;
	cursor: pointer;
	transition: color 0.15s, background 0.15s, transform 0.25s;
}

.desktop-sidebar-toggle .app-icon {
	width: 17px;
	height: 17px;
}

.desktop-sidebar-toggle:hover,
.desktop-sidebar-toggle:focus-visible {
	color: var(--sidebar-hover-text);
	background: var(--sidebar-hover-bg);
	outline: none;
}

/* ---- Nav ---- */
.sidebar-nav {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 10px 0;
	overscroll-behavior: contain;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--sidebar-scroll-thumb); border-radius: 2px; }

.sidebar-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.sidebar-nav li {
	margin: 1px 0;
}

.sidebar-nav-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 0 10px;
	padding: 9px 12px;
	border-radius: 8px;
	color: var(--sidebar-text);
	font-size: 15px;
	line-height: 1.3;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-nav-link:hover,
.sidebar-nav-link:focus {
	background: var(--sidebar-hover-bg);
	color: var(--sidebar-hover-text);
	text-decoration: none;
}

.sidebar-nav-link:focus-visible,
.sidebar-submenu a:focus-visible,
#sidebar-mini-flyout a:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.55);
	outline-offset: -2px;
}

.sidebar-nav-link.active {
	background: var(--sidebar-active-bg);
	color: var(--sidebar-active-text);
	font-weight: 700;
}

.sidebar-nav-link.active:hover {
	background: var(--brand-primary-dark);
}

/* A group holding the current page: label lit, no fill (the page is). */
.has-submenu > .sidebar-nav-link:not(.collapsed) {
	color: var(--sidebar-hover-text);
}

.sidebar-nav-item-content {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 1;
	min-width: 0;
}

.sidebar-nav-icon {
	width: 19px;
	height: 19px;
	opacity: 0.78;
}

.sidebar-nav-link:hover .sidebar-nav-icon,
.sidebar-nav-link.active .sidebar-nav-icon,
.has-submenu > .sidebar-nav-link:not(.collapsed) .sidebar-nav-icon {
	opacity: 1;
}

.sidebar-nav-label {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.sidebar-caret {
	flex-shrink: 0;
	width: 15px;
	height: 15px;
	margin-left: 6px;
	opacity: 0.55;
	transition: transform 0.2s ease;
}

.sidebar-nav-link:not(.collapsed) .sidebar-caret {
	transform: rotate(180deg);
	opacity: 0.85;
}

/* ---- Submenu: indented under the group's icon, with a guide line ---- */
.sidebar-submenu {
	position: relative;
	list-style: none;
	margin: 2px 0 6px;
	padding: 0;
}

.sidebar-submenu::before {
	content: '';
	position: absolute;
	top: 4px;
	bottom: 4px;
	left: 31px;
	width: 1px;
	background: var(--sidebar-border);
}

.sidebar-nav .sidebar-submenu li {
	margin: 0;
}

.sidebar-submenu li a {
	display: block;
	margin: 1px 10px 1px 36px;
	padding: 7px 10px;
	border-radius: 7px;
	color: var(--sidebar-sub-text);
	font-size: 14px;
	line-height: 1.35;
	text-decoration: none;
	transition: color 0.12s ease, background 0.12s ease;
}

.sidebar-submenu li a:hover,
.sidebar-submenu li a:focus {
	background: var(--sidebar-hover-bg);
	color: var(--sidebar-hover-text);
	text-decoration: none;
}

.sidebar-submenu li a.active {
	background: var(--sidebar-sub-active-bg);
	color: var(--sidebar-sub-active-text);
	font-weight: 700;
}

.sidebar-submenu-divider {
	height: 1px;
	margin: 5px 18px 5px 46px;
	background: var(--sidebar-border);
}

/* ---- Footer: which jemaat's data this is ---- */
.sidebar-footer {
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	gap: 1px;
	padding: 12px 18px 14px;
	border-top: 1px solid var(--sidebar-border);
	line-height: 1.3;
	overflow: hidden;
}

.sidebar-footer-label {
	color: var(--sidebar-text-muted);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.sidebar-footer-value {
	color: var(--sidebar-text);
	font-size: 14px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ---- Desktop: collapsed to an icon strip ---- */
@media (min-width: 992px) {
	body.sidebar-collapsed #app-sidebar { width: var(--sidebar-strip); }
	body.sidebar-collapsed #main-wrapper { margin-left: var(--sidebar-strip); }
	body.sidebar-collapsed .app-topbar { left: var(--sidebar-strip); }

	body.sidebar-collapsed .sidebar-brand {
		justify-content: center;
		padding: 0;
	}

	body.sidebar-collapsed .sidebar-brand a,
	body.sidebar-collapsed .sidebar-footer,
	body.sidebar-collapsed .sidebar-nav-label,
	body.sidebar-collapsed .sidebar-caret {
		display: none;
	}

	body.sidebar-collapsed .desktop-sidebar-toggle {
		margin-left: 0;
		transform: rotate(180deg);
	}

	body.sidebar-collapsed .sidebar-nav-link {
		justify-content: center;
		margin: 0 8px;
		padding: 10px 0;
	}

	body.sidebar-collapsed .sidebar-nav-item-content { flex: none; }
	body.sidebar-collapsed .sidebar-nav-icon { width: 21px; height: 21px; }

	/* Groups open in the flyout instead */
	body.sidebar-collapsed .sidebar-submenu { display: none !important; }

	/* A group holding the current page gets the fill, as there is no list to show it */
	body.sidebar-collapsed .has-submenu > .sidebar-nav-link:not(.collapsed) {
		background: var(--sidebar-sub-active-bg);
	}

	/* The brand moves to the top bar */
	body.sidebar-collapsed .topbar-brand { display: flex; }
}

/* ---- Flyout for groups in the icon strip ---- */
#sidebar-mini-flyout {
	display: none;
	position: fixed;
	left: var(--sidebar-strip);
	z-index: 1050;
	flex-direction: column;
	min-width: 220px;
	max-width: 340px;
	max-height: calc(100vh - 16px);
	overflow: hidden;
	background: var(--sidebar-bg);
	border: 1px solid var(--sidebar-border);
	border-radius: 0 10px 10px 10px;
	box-shadow: 6px 4px 18px rgba(16, 24, 40, 0.24);
	font-family: var(--app-font);
}

#sidebar-mini-flyout.is-up { border-radius: 10px 10px 10px 0; }

#sidebar-mini-flyout .flyout-title {
	flex: none;
	padding: 10px 16px 8px;
	border-bottom: 1px solid var(--sidebar-border);
	color: var(--sidebar-text-muted);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

#sidebar-mini-flyout ul {
	list-style: none;
	min-height: 0;
	margin: 0;
	padding: 5px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

#sidebar-mini-flyout ul li a {
	display: block;
	padding: 7px 11px;
	border-radius: 7px;
	color: var(--sidebar-sub-text);
	font-size: 14px;
	line-height: 1.35;
	text-decoration: none;
}

#sidebar-mini-flyout ul li a:hover,
#sidebar-mini-flyout ul li a:focus {
	background: var(--sidebar-hover-bg);
	color: var(--sidebar-hover-text);
	text-decoration: none;
}

#sidebar-mini-flyout ul li a.active {
	background: var(--sidebar-sub-active-bg);
	color: var(--sidebar-sub-active-text);
}

#sidebar-mini-flyout .flyout-divider {
	height: 1px;
	margin: 4px 6px;
	background: var(--sidebar-border);
}

/* =====================================================================
   TOP BAR
   ===================================================================== */
.app-topbar {
	position: fixed;
	top: 0;
	left: var(--sidebar-width);
	right: 0;
	z-index: 998;
	display: flex;
	align-items: center;
	gap: 12px;
	height: var(--topbar-height);
	padding: 0 24px;
	background: var(--topbar-bg);
	border-bottom: 1px solid var(--topbar-border);
	box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
	transition: left 0.25s ease;
}

/* Hamburger: mobile only */
.sidebar-toggle-btn {
	display: none;
	flex-direction: column;
	gap: 5px;
	flex-shrink: 0;
	margin-left: -6px;
	padding: 9px 7px;
	border: none;
	border-radius: 8px;
	background: none;
	cursor: pointer;
}

.sidebar-toggle-btn .icon-bar {
	display: block;
	width: 20px;
	height: 2px;
	border-radius: 1px;
	background: #46536b;
}

.sidebar-toggle-btn:hover { background: var(--topbar-hover-bg); }

.topbar-brand {
	display: none;
	align-items: center;
	gap: 9px;
	min-width: 0;
	color: var(--topbar-text);
	font-size: 17px;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}

.topbar-brand:hover,
.topbar-brand:focus {
	color: var(--brand-primary);
	text-decoration: none;
}

.topbar-brand-text {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
}

.topbar-right {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
	margin-left: auto;
}

/* ---- Account ---- */
.topbar-account { position: relative; }

.topbar-account-toggle {
	display: flex;
	align-items: center;
	gap: 10px;
	max-width: 300px;
	padding: 4px 8px 4px 4px;
	border: none;
	border-radius: 10px;
	background: none;
	text-align: left;
	cursor: pointer;
	transition: background 0.15s ease;
}

.topbar-account-toggle:hover,
.topbar-account-toggle[aria-expanded="true"] {
	background: var(--topbar-hover-bg);
}

.topbar-account-toggle:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.25);
}

.topbar-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--brand-primary);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.03em;
	line-height: 1;
	padding-top: 2px; /* Mukta sits high in its line box */
}

.topbar-avatar--lg {
	width: 42px;
	height: 42px;
	font-size: 15px;
}

.topbar-account-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.25;
}

.topbar-account-name {
	color: var(--topbar-text);
	font-size: 14px;
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.topbar-account-org {
	color: var(--topbar-muted);
	font-size: 12.5px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.topbar-account-caret {
	width: 16px;
	height: 16px;
	color: var(--topbar-muted);
}

.topbar-account-menu {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	z-index: 1100;
	width: 280px;
	max-width: calc(100vw - 24px);
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--topbar-border);
	border-radius: 12px;
	box-shadow: 0 16px 40px rgba(16, 24, 40, 0.18);
}

.topbar-account-menu[hidden] { display: none; }

.topbar-account-menu__head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px;
	border-bottom: 1px solid #eef0f2;
}

.topbar-account-head-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.3;
}

.topbar-account-head-name {
	color: var(--topbar-text);
	font-size: 15px;
	font-weight: 700;
	overflow-wrap: anywhere;
}

.topbar-account-head-org {
	color: var(--topbar-muted);
	font-size: 13px;
}

.topbar-account-menu__links { padding: 6px; }

.topbar-menu-link {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 9px 10px;
	border-radius: 8px;
	color: #45536a;
	font-size: 14.5px;
	text-decoration: none;
	transition: background 0.12s ease, color 0.12s ease;
}

.topbar-menu-link .app-icon {
	width: 18px;
	height: 18px;
	color: var(--topbar-muted);
}

.topbar-menu-link:hover,
.topbar-menu-link:focus {
	background: var(--topbar-hover-bg);
	color: var(--topbar-text);
	text-decoration: none;
}

.topbar-menu-link.is-logout,
.topbar-menu-link.is-logout .app-icon { color: #c0392b; }

.topbar-menu-link.is-logout:hover,
.topbar-menu-link.is-logout:focus {
	background: #fdecea;
	color: #a5281b;
}

/* ---- Pindah jemaat (admin) ---- */
.topbar-switch { position: relative; }

.topbar-switch-toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	max-width: 260px;
	height: 38px;
	padding: 0 10px;
	border: 1px solid var(--topbar-border);
	border-radius: 10px;
	background: #fff;
	color: var(--topbar-text);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.topbar-switch-toggle .app-icon {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	color: var(--topbar-muted);
}

.topbar-switch-toggle:hover,
.topbar-switch-toggle[aria-expanded="true"] { background: var(--topbar-hover-bg); }

.topbar-switch-toggle:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.25);
}

/* Switched: tinted, so it is obvious this is not the admin's own jemaat */
.topbar-switch-toggle.is-switched {
	border-color: #f2c94c;
	background: #fff8e1;
	color: #7a5300;
}

.topbar-switch-toggle.is-switched .app-icon { color: #b07d00; }

.topbar-switch-label {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.topbar-switch-menu {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	z-index: 1100;
	width: 320px;
	max-width: calc(100vw - 24px);
	padding: 12px;
	background: #fff;
	border: 1px solid var(--topbar-border);
	border-radius: 12px;
	box-shadow: 0 16px 40px rgba(16, 24, 40, 0.18);
}

.topbar-switch-menu[hidden] { display: none; }

.topbar-switch-title {
	display: block;
	margin-bottom: 6px;
	color: var(--topbar-muted);
	font-size: 12.5px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.topbar-switch-menu select { width: 100%; }
.topbar-switch-menu .selectize-control { margin-bottom: 0; }
.topbar-switch-menu .selectize-dropdown-content { max-height: 320px; }

.topbar-switch-back {
	margin: 10px -6px -6px;
	padding-top: 6px;
	border-top: 1px solid #eef0f2;
}

.topbar-switch-back .topbar-menu-link {
	width: 100%;
	border: none;
	background: none;
	text-align: left;
}

.switch-group-banner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
	margin: 0 0 20px;
	padding: 10px 14px;
	border: 1px solid #f2c94c;
	border-radius: 10px;
	background: #fff8e1;
	color: #5c4000;
	font-size: 14px;
}

.switch-group-banner__text {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.switch-group-banner__text .app-icon {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	color: #b07d00;
}

.switch-group-banner form { margin: 0; }

/* ---- Sidebar overlay (mobile) ---- */
#sidebar-overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 999;
	background: rgba(15, 23, 42, 0.45);
}

/* ---- Mobile / tablet: sidebar becomes an off-canvas drawer ---- */
@media (max-width: 991px) {
	.app-topbar {
		left: 0;
		padding: 0 12px;
	}

	.sidebar-toggle-btn,
	.topbar-brand { display: flex; }

	.topbar-account-text,
	.topbar-account-caret { display: none; }

	.topbar-account-toggle { padding: 4px; }

	.topbar-switch-toggle { max-width: 160px; }

	#app-sidebar {
		z-index: 1001;
		transform: translateX(-100%);
		box-shadow: none;
	}

	body.sidebar-open #app-sidebar {
		transform: translateX(0);
		box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
	}

	body.sidebar-open #sidebar-overlay { display: block; }

	/* On the drawer, the chevron closes it */
	.desktop-sidebar-toggle .app-icon { width: 19px; height: 19px; }

	#main-wrapper {
		margin-left: 0;
		padding: calc(var(--topbar-height) + 16px) 16px 40px;
	}
}

@media (max-width: 480px) {
	.topbar-switch-label,
	.topbar-switch-toggle .topbar-account-caret { display: none; }
	.topbar-switch-toggle { padding: 0 9px; }
}

@media (max-width: 400px) {
	.topbar-switch-menu,
	.topbar-account-menu {
		position: fixed;
		top: calc(var(--topbar-height) + 8px);
		left: 12px;
		right: 12px;
		width: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	#app-sidebar,
	#main-wrapper,
	.app-topbar,
	.sidebar-caret,
	.desktop-sidebar-toggle { transition: none; }
}

@media print {
	#app-sidebar,
	.app-topbar,
	#sidebar-overlay,
	#sidebar-mini-flyout { display: none !important; }

	#main-wrapper {
		margin: 0 !important;
		padding: 0 !important;
	}

	body.app-modern { background: #fff; }
}

/* =====================================================================
   SIGN-IN PAGES (login, reset password, magic link, 2FA, ...)
   <body class="app-modern auth-page"> + .auth-shell > .auth-card
   ===================================================================== */
/* Logged-out pages only (login, reset password, magic link, 2FA, link
   request): faint Christian motifs (cross, dove, ichthys, church, Bible,
   candle, cup, star) tiled over a soft blue glow. Bump ?v= when
   img/bg_pattern.svg changes. */
body.auth-page--public {
	background-image:
		url('img/bg_pattern.svg?v=2'),
		radial-gradient(circle at 12% 8%, rgba(var(--brand-primary-rgb), 0.10), transparent 42%),
		radial-gradient(circle at 88% 92%, rgba(var(--brand-primary-rgb), 0.08), transparent 45%);
	background-size: 360px 360px, auto, auto;
	background-attachment: fixed;
}

body.auth-page {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	min-height: 100dvh;
	padding: 32px 16px;
}

.auth-brand {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: clamp(12px, 2.4vw, 16px);
	margin-bottom: clamp(22px, 4vw, 30px);
	color: var(--topbar-text);
	text-decoration: none;
}

.auth-brand:hover,
.auth-brand:focus {
	color: var(--topbar-text);
	text-decoration: none;
}

/* "DLP" is only three letters, so the mark can be big: it scales from about
   34px type on a phone to 44px on a desktop, the badge growing with it. */
.auth-brand .brand-badge {
	width: clamp(50px, 10vw, 62px);
	height: clamp(50px, 10vw, 62px);
	border-radius: clamp(14px, 2.8vw, 17px);
	box-shadow: 0 6px 16px rgba(var(--brand-primary-rgb), 0.28);
}

.auth-brand .brand-badge .app-icon {
	width: 58%;
	height: 58%;
	stroke-width: 1.8;
}

.auth-brand-name {
	font-size: clamp(34px, 7vw, 44px);
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.02em;
	padding-top: 0.12em; /* Mukta sits high in its line box */
}

.auth-card {
	width: 100%;
	max-width: 440px;
	padding: 32px 36px 30px;
	background: #fff;
	border: 1px solid #e6e8eb;
	border-radius: 16px;
	box-shadow: 0 4px 32px rgba(16, 24, 40, 0.08);
}

.auth-card--wide { max-width: 560px; }

.app-modern .auth-card .page-header {
	margin: 0 0 22px;
	text-align: center;
}

.app-modern .auth-card .page-header h1 {
	display: block;
	font-size: 26px;
}

.auth-card .btn-primary {
	width: 100%;
	padding: 11px 16px;
	font-size: 16px;
}

/* Bootstrap grid columns left in the markup should not shrink the card */
.auth-card > [class*="col-"] {
	float: none;
	width: auto;
	padding: 0;
}

.auth-footer {
	margin-top: 20px;
	color: var(--topbar-muted);
	font-size: 13px;
	text-align: center;
}

@media (max-width: 480px) {
	body.auth-page { justify-content: flex-start; padding-top: 28px; }
	.auth-card { padding: 24px 20px; border-radius: 14px; }
}

.auth-shell {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
}

/* "atau" between the main sign-in button and the alternative */
.auth-divider {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 20px 0 16px;
	color: var(--topbar-muted);
	font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: #e4e7ec;
}

/* Secondary sign-in option: full width; the icon sits in the text flow so it
   stays beside the first word when a long label wraps on a phone */
.app-modern .auth-alt-btn {
	display: block;
	width: 100%;
	padding: 10px 16px;
	font-size: 15px;
	text-align: center;
	white-space: normal;
}

.app-modern .auth-alt-btn .app-icon {
	display: inline-block;
	width: 19px;
	height: 19px;
	margin-right: 8px;
	vertical-align: -4px;
	color: var(--brand-primary);
}

.auth-links {
	margin: 18px 0 0;
	font-size: 14px;
	text-align: center;
}

/* "Kembali ke log masuk" (and other link buttons) under the main button:
   its own centred line, lined up with the button rather than indented by
   .btn padding beside it */
.app-modern .auth-card .btn-link {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	margin-top: 12px;
	padding: 6px 12px;
	color: var(--topbar-muted);
	font-size: 14px;
	font-weight: 400;
}

.app-modern .auth-card .btn-link::before {
	content: '\2190'; /* left arrow */
	font-size: 15px;
	line-height: 1;
}

.app-modern .auth-card .btn-link:hover,
.app-modern .auth-card .btn-link:focus {
	color: var(--brand-primary);
	text-decoration: none;
}

/* Secondary links under a form (e.g. "Kirim ulang kode" on 2FA) */
.auth-card form ~ p { text-align: center; font-size: 14px; }
