/* Locals Guide AUTH unit: login / sign-up modal, account-page panel, header account links.
 * Uses the theme tokens (--ggt-*) with fallbacks. Selectors are scoped under .ggt-auth and prefixed with
 * "body" where they must beat the theme's site-wide form/button rules. */

.ggt-auth {
	--ga-accent: var(--ggt-accent, #0B5FFF);
	--ga-accent-hover: var(--ggt-accent-hover, #0047D9);
	--ga-accent-soft: var(--ggt-accent-soft, #EAF1FF);
	--ga-ink: var(--ggt-ink, #0F172A);
	--ga-ink-2: var(--ggt-ink-2, #334155);
	--ga-muted: var(--ggt-muted, #64748B);
	--ga-line: var(--ggt-line, #E2E8F0);
	--ga-line-strong: var(--ggt-line-strong, #CBD5E1);
	--ga-paper: var(--ggt-paper, #FFFFFF);
	--ga-canvas: var(--ggt-canvas, #F8FAFC);
	--ga-danger: var(--ggt-danger, #F04438);
	--ga-danger-ink: var(--ggt-danger-ink, #B42318);
	--ga-success: var(--ggt-success, #12B76A);
	--ga-warning: var(--ggt-warning, #F79009);
	--ga-font: var(--ggt-font, "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
	--ga-display: var(--ggt-font-display, "Manrope", "Inter", system-ui, sans-serif);
	--ga-focus: var(--ggt-focus, 0 0 0 3px rgba(11, 95, 255, .28));
	font-family: var(--ga-font);
	color: var(--ga-ink);
}
.ggt-auth[hidden], .ggt-auth [hidden] { display: none !important; }
.ggt-auth *, .ggt-auth *::before, .ggt-auth *::after { box-sizing: border-box; }

/* ---------- Modal shell ---------- */
.ggt-auth--modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}
.ggt-auth__overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, .6);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	opacity: 0;
	transition: opacity .2s ease;
}
.ggt-auth__dialog {
	position: relative;
	width: 100%;
	max-width: 960px;
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	display: flex;
	border-radius: 24px;
	background: var(--ga-paper);
	overflow: hidden;
	box-shadow: 0 30px 80px -20px rgba(15, 23, 42, .45);
	opacity: 0;
	transform: translateY(8px);
	transition: opacity .2s ease, transform .2s ease;
}
.ggt-auth__dialog:focus { outline: none; }
.ggt-auth--modal.is-open .ggt-auth__overlay { opacity: 1; }
.ggt-auth--modal.is-open .ggt-auth__dialog { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
	.ggt-auth__overlay, .ggt-auth__dialog { transition: none; }
}
html.ggt-auth-lock, html.ggt-auth-lock body { overflow: hidden; }

body .ggt-auth .ggt-auth__close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 3;
	width: 40px;
	height: 40px;
	min-height: 0;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--ga-muted);
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease;
}
body .ggt-auth .ggt-auth__close:hover { background: var(--ga-canvas); color: var(--ga-ink); }
body .ggt-auth .ggt-auth__close:focus-visible { outline: none; box-shadow: var(--ga-focus); }

/* ---------- Card: two panels ---------- */
.ggt-auth__card {
	display: grid;
	grid-template-columns: 400px minmax(0, 1fr);
	grid-template-rows: minmax(0, 1fr);
	width: 100%;
	min-height: 0;
}
.ggt-auth--inline .ggt-auth__card {
	max-width: 960px;
	margin: 0 auto;
	border: 1px solid var(--ga-line);
	border-radius: 24px;
	overflow: hidden;
	background: var(--ga-paper);
}

/* Left: blue visual panel */
.ggt-auth__visual {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 28px;
	padding: 36px 36px 36px;
	background: var(--ga-accent);
	color: #fff;
	overflow: hidden;
}
.ggt-auth__brand {
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: var(--ga-display);
	font-weight: 800;
	font-size: 20px;
	letter-spacing: -.01em;
}
.ggt-auth__compass {
	display: block;
	width: 168px;
	height: 168px;
	margin-top: 8px;
}
.ggt-auth .ggt-auth__promise {
	margin: auto 0 0;
	font-family: var(--ga-display);
	font-weight: 800;
	font-size: 30px;
	line-height: 1.12;
	letter-spacing: -.025em;
	color: #fff;
}
.ggt-auth__promise span { display: block; }
.ggt-auth__promise .ggt-auth__promise-soft { color: rgba(255, 255, 255, .72); text-wrap: balance; }
.ggt-auth .ggt-auth__chips {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.ggt-auth__chips li {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 6px 12px 6px 8px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .14);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	color: #fff;
}
.ggt-auth__chips svg {
	flex: none;
	width: 18px;
	height: 18px;
	padding: 3px;
	border-radius: 999px;
	background: #fff;
	color: var(--ga-accent);
}

/* Right: form panel */
.ggt-auth__main {
	min-width: 0;
	padding: 32px 48px 24px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	background: var(--ga-paper);
}
.ggt-auth--inline .ggt-auth__main { overflow: visible; }

/* Segmented tabs with sliding underline */
.ggt-auth__tabs {
	position: relative;
	display: grid;
	grid-template-columns: 1fr 1fr;
	max-width: 340px;
	margin: 0 0 24px;
	border-bottom: 1px solid var(--ga-line);
}
body .ggt-auth .ggt-auth__tab {
	appearance: none;
	-webkit-appearance: none;
	min-height: 48px;
	margin: 0;
	padding: 12px 8px;
	border: 0;
	border-radius: 10px 10px 0 0;
	background: transparent;
	color: var(--ga-muted);
	font-family: var(--ga-font);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
	transition: color .2s ease, background-color .2s ease;
}
body .ggt-auth .ggt-auth__tab:hover { color: var(--ga-ink); background: var(--ga-canvas); }
body .ggt-auth .ggt-auth__tab[aria-selected="true"] { color: var(--ga-ink); }
body .ggt-auth .ggt-auth__tab:focus-visible { outline: none; box-shadow: inset var(--ga-focus); }
.ggt-auth__ink {
	position: absolute;
	left: 0;
	bottom: -1px;
	width: 50%;
	height: 3px;
	border-radius: 3px;
	background: var(--ga-accent);
	transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
[data-mode="register"] > .ggt-auth__tabs .ggt-auth__ink { transform: translateX(100%); }

.ggt-auth .ggt-auth__title {
	margin: 0 0 4px;
	font-family: var(--ga-display);
	font-size: 28px;
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -.02em;
	color: var(--ga-ink);
}
.ggt-auth .ggt-auth__lead {
	margin: 0 0 20px;
	font-size: 15px;
	line-height: 1.5;
	color: var(--ga-muted);
}

/* Notice (reuses ggt-notice look, own fallback) */
body .ggt-auth .ggt-auth__notice {
	margin: 0 0 16px;
	padding: 12px 14px 12px 16px;
	border: 1px solid var(--ga-line);
	border-left-width: 4px;
	border-radius: 12px;
	background: var(--ga-canvas);
	font-size: 14px;
	line-height: 1.45;
	color: var(--ga-ink);
}
body .ggt-auth .ggt-auth__notice::before { content: none; }
body .ggt-auth .ggt-auth__notice.ggt-notice--error { background: #FEEEEC; border-color: #FDC4BE; border-left-color: var(--ga-danger); }
body .ggt-auth .ggt-auth__notice.ggt-notice--success { background: #E7F8EF; border-color: #A6E9C8; border-left-color: var(--ga-success); }
body .ggt-auth .ggt-auth__notice.ggt-notice--info { background: var(--ga-accent-soft); border-color: #C7D9FF; border-left-color: var(--ga-accent); }
body .ggt-auth .ggt-auth__notice.ggt-notice--warning { background: #FEF4E6; border-color: #FDD9A8; border-left-color: var(--ga-warning); }

/* Google button */
body .ggt-auth .ggt-auth__google {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	width: 100%;
	min-height: 52px;
	padding: 12px 20px;
	border: 1px solid var(--ga-line-strong);
	border-radius: 12px;
	background: #fff;
	color: var(--ga-ink);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color .15s ease, border-color .15s ease;
}
body .ggt-auth .ggt-auth__google:hover { background: var(--ga-canvas); border-color: var(--ga-ink); color: var(--ga-ink); }
body .ggt-auth .ggt-auth__google:focus-visible { outline: none; box-shadow: var(--ga-focus); border-color: var(--ga-accent); }
.ggt-auth__g { flex: none; width: 20px; height: 20px; }

.ggt-auth__or {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 18px 0;
	font-size: 13px;
	font-weight: 500;
	color: var(--ga-muted);
	text-transform: lowercase;
}
.ggt-auth__or::before, .ggt-auth__or::after { content: ""; flex: 1; height: 1px; background: var(--ga-line); }

/* Fields */
.ggt-auth__form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.ggt-auth__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ggt-auth__field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ggt-auth .ggt-auth__label { font-size: 14px; font-weight: 600; color: var(--ga-ink); line-height: 1.3; }
body .ggt-auth .ggt-auth__input {
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 11px 14px;
	border: 1px solid var(--ga-line-strong);
	border-radius: 12px;
	background: var(--ga-paper);
	color: var(--ga-ink);
	font: inherit;
	font-size: 16px;
	line-height: 1.4;
	box-shadow: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}
body .ggt-auth .ggt-auth__input:hover { border-color: #94A3B8; }
body .ggt-auth .ggt-auth__input:focus { outline: none; border-color: var(--ga-accent); box-shadow: var(--ga-focus); }
body .ggt-auth .ggt-auth__input::placeholder { color: #94A3B8; }
body .ggt-auth .is-error .ggt-auth__input { border-color: var(--ga-danger); background: #FFFBFA; }
body .ggt-auth .is-error .ggt-auth__input:focus { box-shadow: 0 0 0 3px rgba(240, 68, 56, .2); }
.ggt-auth .ggt-auth__error { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--ga-danger-ink); }
.ggt-auth .ggt-auth__error:empty { display: none; }

/* Password + eye */
.ggt-auth__pw { position: relative; }
body .ggt-auth .ggt-auth__pw .ggt-auth__input { padding-right: 52px; }
body .ggt-auth .ggt-auth__eye {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 40px;
	height: 40px;
	min-height: 0;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 9px;
	background: transparent;
	color: var(--ga-muted);
	cursor: pointer;
}
body .ggt-auth .ggt-auth__eye:hover { color: var(--ga-ink); background: var(--ga-canvas); }
body .ggt-auth .ggt-auth__eye:focus-visible { outline: none; box-shadow: var(--ga-focus); }
.ggt-auth__eye-off { display: none; }
.ggt-auth__eye[aria-pressed="true"] .ggt-auth__eye-on { display: none; }
.ggt-auth__eye[aria-pressed="true"] .ggt-auth__eye-off { display: block; }

/* Strength bar */
.ggt-auth__strength { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; color: var(--ga-muted); }
.ggt-auth__bars { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; max-width: 200px; }
.ggt-auth__bars i { display: block; height: 4px; border-radius: 4px; background: var(--ga-line); transition: background-color .2s ease; }
.ggt-auth__strength[data-score="1"] .ggt-auth__bars i:nth-child(-n+1) { background: var(--ga-danger); }
.ggt-auth__strength[data-score="2"] .ggt-auth__bars i:nth-child(-n+2) { background: var(--ga-warning); }
.ggt-auth__strength[data-score="3"] .ggt-auth__bars i:nth-child(-n+3) { background: var(--ga-accent); }
.ggt-auth__strength[data-score="4"] .ggt-auth__bars i { background: var(--ga-success); }
.ggt-auth__strength[data-score="1"] { color: var(--ga-danger-ink); }
.ggt-auth__strength[data-score="4"] { color: #067647; }

/* Remember + forgot */
.ggt-auth__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: -2px; }
.ggt-auth .ggt-auth__check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--ga-ink-2); cursor: pointer; }
.ggt-auth .ggt-auth__check input { width: 18px; height: 18px; margin: 0; accent-color: var(--ga-accent); }
.ggt-auth .ggt-auth__link { font-size: 14px; font-weight: 600; color: var(--ga-accent); text-decoration: none; }
.ggt-auth .ggt-auth__link:hover { color: var(--ga-accent-hover); text-decoration: underline; text-underline-offset: 2px; }
.ggt-auth .ggt-auth__terms { margin: -2px 0 0; font-size: 13px; line-height: 1.5; color: var(--ga-muted); }
.ggt-auth .ggt-auth__terms a { color: var(--ga-ink-2); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* Submit with spinner */
body .ggt-auth .ggt-auth__submit {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-height: 52px;
	margin: 4px 0 0;
	padding: 12px 22px;
	border: 1px solid var(--ga-accent);
	border-radius: 12px;
	background: var(--ga-accent);
	color: #fff;
	font-family: var(--ga-font);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease;
}
body .ggt-auth .ggt-auth__submit:hover { background: var(--ga-accent-hover); border-color: var(--ga-accent-hover); }
body .ggt-auth .ggt-auth__submit:focus-visible { outline: none; box-shadow: var(--ga-focus); }
body .ggt-auth .ggt-auth__submit[disabled] { cursor: progress; opacity: .92; }
.ggt-auth__spinner {
	display: none;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, .4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: ggt-auth-spin .7s linear infinite;
}
.ggt-auth__submit.is-loading .ggt-auth__spinner { display: inline-block; }
@keyframes ggt-auth-spin { to { transform: rotate(360deg); } }

/* Honeypot */
.ggt-auth__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Footer */
.ggt-auth__foot {
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid var(--ga-line);
	font-size: 14px;
	line-height: 1.45;
	color: var(--ga-ink-2);
}
.ggt-auth .ggt-auth__foot p { margin: 0; }
.ggt-auth .ggt-auth__foot a { font-weight: 700; color: var(--ga-accent); text-decoration: none; }
.ggt-auth .ggt-auth__foot a:hover { text-decoration: underline; text-underline-offset: 2px; }
.ggt-auth .ggt-auth__foot .ggt-auth__foot-sub { margin-top: 2px; font-size: 13px; color: var(--ga-muted); }

/* ---------- Phones: full-screen sheet, slim blue strip ---------- */
@media (max-width: 720px) {
	.ggt-auth--modal { padding: 0; align-items: stretch; }
	.ggt-auth__dialog {
		max-width: none;
		max-height: none;
		height: 100vh;
		height: 100dvh;
		border-radius: 0;
		box-shadow: none;
	}
	.ggt-auth__card { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
	.ggt-auth__visual {
		flex-direction: row;
		align-items: center;
		gap: 10px;
		min-height: 60px;
		padding: 12px 64px 12px 16px;
	}
	.ggt-auth__brand { font-size: 18px; }
	.ggt-auth__brand svg { width: 26px; height: 26px; }
	.ggt-auth__compass {
		position: absolute;
		right: 52px;
		top: 50%;
		width: 96px;
		height: 96px;
		margin: -48px 0 0;
		opacity: .35;
	}
	.ggt-auth .ggt-auth__promise, .ggt-auth .ggt-auth__chips { display: none; }
	body .ggt-auth .ggt-auth__close { top: 10px; right: 8px; color: #fff; }
	body .ggt-auth .ggt-auth__close:hover { background: rgba(255, 255, 255, .16); color: #fff; }
	.ggt-auth__main { padding: 20px 16px 28px; }
	.ggt-auth__tabs { max-width: none; margin-bottom: 20px; }
	.ggt-auth .ggt-auth__title { font-size: 24px; }
	.ggt-auth .ggt-auth__lead { margin-bottom: 16px; }
	.ggt-auth--inline .ggt-auth__card { border-radius: 20px; }
	.ggt-auth--inline .ggt-auth__visual { padding-right: 16px; }
	.ggt-auth--inline .ggt-auth__compass { right: -12px; }
}
@media (max-width: 360px) {
	.ggt-auth__cols { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Header account links ---------- */
body .ggt-auth-signup { display: none; }
.ggt-auth-avatar {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 999px;
	overflow: hidden;
	background: var(--ggt-accent-soft, #EAF1FF);
	color: var(--ggt-accent, #0B5FFF);
	font-family: var(--ggt-font-display, "Manrope", sans-serif);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .02em;
	line-height: 1;
}
.ggt-auth-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 1024px) {
	body.ggt-theme .ggt-header__actions .ggt-auth-signup {
		display: inline-flex;
		min-height: 42px;
		padding: 10px 18px;
		margin-left: 4px;
	}
}
