/**
 * Psy Core — global auth UI: 2-step register modal + logged-in profile chip.
 *
 * Loaded on every front-end page by AuthUI service. Matches the dark
 * psytrance palette used across the site.
 */

/* Brand tokens (--psy-pink, --psy-violet, etc.) live in theme tokens.css. */
:root {
	--psy-pink-2: rgba(229, 74, 218, 0.55);
	--psy-grad: linear-gradient(135deg, var(--psy-pink) 0%, #b328ff 100%);
}

/* ---------------- Modal ---------------- */

.psy-auth-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	font-family: 'Inter', system-ui, sans-serif;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: auto;
}

.psy-auth-modal[hidden] { display: none; }

.psy-auth-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(8, 3, 24, 0.78);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	pointer-events: auto;
	cursor: pointer;
}

.psy-auth-modal__dialog {
	pointer-events: auto;
	position: relative !important;
	top: auto !important;
	right: auto !important;
	left: auto !important;
	bottom: auto !important;
	transform: none;
	width: min(420px, calc(100% - 32px));
	max-width: calc(100vw - 24px);
	max-height: 90vh;
	overflow-x: hidden;
	overflow-y: auto;
	padding: 28px 26px 24px;
	border-radius: 18px;
	background: #050033;
	border: 1px solid rgba(255, 67, 200, 0.35);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 67, 200, 0.18) inset;
	color: #fff;
	animation: psy-auth-pop 0.18s ease;
	box-sizing: border-box;
}
.psy-auth-modal__dialog *,
.psy-auth-modal__dialog *::before,
.psy-auth-modal__dialog *::after { box-sizing: border-box; }

@keyframes psy-auth-pop {
	from { transform: scale(0.96); opacity: 0; }
	to   { transform: scale(1); opacity: 1; }
}

.psy-auth-modal__close,
.psy-auth-modal__close:hover,
.psy-auth-modal__close:focus,
.psy-auth-modal__close:focus-visible,
.psy-auth-modal__close:active {
	position: absolute;
	top: 12px;
	right: 14px;
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent !important;
	background-color: transparent !important;
	border: 0 !important;
	outline: none !important;
	box-shadow: none !important;
	padding: 0 !important;
	margin: 0 !important;
	font-size: 28px;
	line-height: 1;
	color: #fff !important;
	opacity: 1 !important;
	cursor: pointer;
	transition: none !important;
	transform: none !important;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}

.psy-auth-modal__title {
	font-family: 'Audiowide', sans-serif;
	font-size: clamp(18px, 3vw, 22px);
	letter-spacing: 0.04em;
	margin: 0 0 4px;
}

.psy-auth-modal__subtitle {
	margin: 0 0 22px;
	font-size: 13px;
	color: rgba(255, 255, 255, 0.6);
}

.psy-auth-modal__back,
.psy-auth-modal__back:hover,
.psy-auth-modal__back:focus,
.psy-auth-modal__back:focus-visible,
.psy-auth-modal__back:active {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: transparent !important;
	background-color: transparent !important;
	border: 0 !important;
	outline: none !important;
	box-shadow: none !important;
	padding: 0 !important;
	margin: 0 0 12px;
	color: #fff !important;
	font-size: 13px;
	cursor: pointer;
	opacity: 1 !important;
	transition: none !important;
	transform: none !important;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}

.psy-auth-modal__footer {
	text-align: center;
	font-size: 13px;
	color: rgba(255, 255, 255, 0.6);
	margin: 18px 0 0;
}
.psy-auth-modal__footer a {
	color: var(--psy-pink);
	font-weight: 600;
	text-decoration: none;
}
.psy-auth-modal__footer a:hover { text-decoration: underline; }

/* Binary choice cards — force-override theme button styling. */
.psy-auth-modal .psy-choice,
.psy-auth-modal button.psy-choice {
	display: grid !important;
	grid-template-columns: 48px minmax(0, 1fr) 20px !important;
	align-items: center !important;
	gap: 12px !important;
	width: 100% !important;
	padding: 14px 16px !important;
	margin: 0 0 14px 0 !important;
	background: rgba(0, 0, 0, 0.35) !important;
	background-image: none !important;
	border: 1px solid rgba(255, 67, 200, 0.35) !important;
	border-radius: 16px !important;
	color: #fff !important;
	text-align: left !important;
	cursor: pointer !important;
	transition: border-color 0.15s, transform 0.15s, background-color 0.15s, box-shadow 0.15s !important;
	font: inherit !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	box-shadow: none !important;
}

.psy-auth-modal .psy-choice:hover,
.psy-auth-modal .psy-choice:focus {
	transform: translateY(-1px) !important;
	outline: none !important;
}

.psy-auth-modal .psy-choice:focus-visible {
	outline: 2px solid var(--psy-pink, #E54ADA) !important;
	outline-offset: 3px;
	transform: translateY(-1px) !important;
}

/* Artist card: pink/magenta accent */
.psy-auth-modal .psy-choice--artist {
	border-color: rgba(255, 67, 200, 0.45) !important;
}
.psy-auth-modal .psy-choice--artist:hover,
.psy-auth-modal .psy-choice--artist:focus {
	border-color: var(--psy-pink) !important;
	background: rgba(255, 67, 200, 0.08) !important;
	box-shadow: 0 6px 26px rgba(255, 67, 200, 0.25) !important;
}
.psy-auth-modal .psy-choice--artist .psy-choice__icon {
	background: rgba(255, 67, 200, 0.18);
	color: var(--psy-pink);
}
.psy-auth-modal .psy-choice--artist .psy-choice__body strong {
	color: var(--psy-pink);
}

/* Organizer card: lime/yellow-green accent (matches Figma) */
.psy-auth-modal .psy-choice--listener {
	border-color: rgba(208, 255, 76, 0.4) !important;
}
.psy-auth-modal .psy-choice--listener:hover,
.psy-auth-modal .psy-choice--listener:focus {
	border-color: #d0ff4c !important;
	background: rgba(208, 255, 76, 0.06) !important;
	box-shadow: 0 6px 26px rgba(208, 255, 76, 0.2) !important;
}
.psy-auth-modal .psy-choice--listener .psy-choice__icon {
	background: rgba(208, 255, 76, 0.15);
	color: #d0ff4c;
}
.psy-auth-modal .psy-choice--listener .psy-choice__body strong {
	color: #d0ff4c;
}

.psy-choice__icon {
	width: 40px;
	height: 40px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.psy-choice__icon svg { width: 18px; height: 18px; }

.psy-choice__body {
	display: block;
	min-width: 0;
	overflow: hidden;
}
.psy-choice__body strong {
	display: block;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.04em;
	margin-bottom: 4px;
	line-height: 1.2;
	white-space: normal;
	overflow-wrap: break-word;
}
.psy-choice__body span {
	display: block;
	font-size: 11.5px;
	color: rgba(255, 255, 255, 0.7);
	line-height: 1.45;
	font-weight: 400;
	white-space: normal;
	overflow-wrap: break-word;
	word-wrap: break-word;
}

.psy-choice__arrow {
	font-size: 22px;
	color: rgba(255, 255, 255, 0.55);
	text-align: right;
	line-height: 1;
}

/* Category grid (step 1) */
.psy-cat-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
}

.psy-cat,
.psy-cat:hover,
.psy-cat:focus,
.psy-cat:focus-visible,
.psy-cat:active,
.psy-cat:visited {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 18px 18px;
	background: rgba(0, 0, 0, 0.35);
	border: 1px solid rgba(229, 74, 218, 0.15);
	border-radius: 16px;
	color: #fff !important;
	text-decoration: none !important;
	font-weight: 700;
	font-size: 15px;
	transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.psy-cat:hover,
.psy-cat:focus-visible {
	border-color: rgba(229, 74, 218, 0.45);
	background: rgba(229, 74, 218, 0.06);
	transform: translateY(-1px);
}

.psy-cat .psy-cat__label {
	color: #fff !important;
}

.psy-cat__icon {
	width: 48px;
	height: 48px;
	border-radius: 12px;
	background: #1A0F5C;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.psy-cat__icon img {
	width: 28px;
	height: 28px;
	object-fit: contain;
	display: block;
}

@media (max-width: 480px) {
	.psy-cat-grid { grid-template-columns: 1fr; }
}

/* Lock body scroll while modal open */
/* Lock background scroll while the modal is open WITHOUT killing the sticky
   header. Locking only the <html> element preserves `position: sticky` on
   header (sticky requires the nearest scrolling ancestor to remain
   scrollable). `scrollbar-gutter: stable` is already set on <html> in the
   theme header.css so the scrollbar reservation absorbs the gap — no extra
   "blue padding" appears on the right when the scrollbar disappears. */
html.psy-auth-modal-open { overflow: hidden; }

/* ---------------- Header profile chip ---------------- */

.psy-auth-chip {
	position: relative;
	display: inline-flex;
	align-items: center;
	font-family: 'Inter', system-ui, sans-serif;
}

.psy-auth-chip__btn,
.psy-auth-chip__btn:hover,
.psy-auth-chip__btn:focus,
.psy-auth-chip__btn:focus-visible,
.psy-auth-chip__btn:active {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 0 !important;
	margin: 0 !important;
	line-height: 1 !important;
	border: 0 !important;
	background: transparent !important;
	background-color: transparent !important;
	outline: none !important;
	box-shadow: none !important;
	transition: none !important;
	transform: none !important;
	color: #fff;
	cursor: pointer;
	font: inherit;
}

.psy-auth-chip__btn > * {
	transition: none !important;
	transform: none !important;
}

.psy-auth-chip__avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #E54ADA;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-weight: 700;
	font-size: 16px;
	overflow: hidden;
	flex-shrink: 0;
}

.psy-auth-chip__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.psy-auth-chip__caret {
	display: inline-block;
	width: 12px;
	height: 12px;
	background: url('https://psytranceartist.com/wp-content/uploads/2026/06/freccia.png') no-repeat center / contain;
	font-size: 0;
	color: transparent;
	line-height: 0;
	vertical-align: middle;
	flex-shrink: 0;
}

.psy-auth-chip__menu {
	position: absolute;
	top: calc(100% + 14px);
	right: 0;
	min-width: 240px;
	margin: 0;
	padding: 18px;
	background: #050033;
	background-clip: padding-box;
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 10px;
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.15s, visibility 0.15s;
	z-index: 999999;
}

.psy-auth-chip__menu::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -14px;
	height: 14px;
	background: transparent;
}

.psy-auth-chip:hover .psy-auth-chip__menu,
.psy-auth-chip:focus-within .psy-auth-chip__menu,
.psy-auth-chip.is-open .psy-auth-chip__menu {
	opacity: 1;
	visibility: visible;
}

.psy-auth-chip__header {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding-bottom: 12px;
}

.psy-auth-chip__hname {
	font-weight: 700;
	font-size: 16px;
	color: #fff;
}

.psy-auth-chip__hrole {
	font-size: 13px;
	color: rgba(255, 255, 255, 0.55);
}

.psy-auth-chip__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.psy-auth-chip__list li { margin: 0; }

.psy-auth-chip__list a {
	display: block;
	padding: 10px 0;
	color: #fff;
	text-decoration: none;
	font-size: 15px;
	transition: color 0.15s;
}

.psy-auth-chip__list a:hover {
	color: var(--psy-pink);
}

.psy-auth-chip__sep {
	height: 1px;
	background: rgba(255, 255, 255, 0.08);
	margin: 8px 0;
}

.psy-auth-chip__logout {
	display: block;
	padding: 8px 0 2px;
	color: var(--psy-pink);
	text-decoration: none;
	font-size: 15px;
	font-weight: 600;
	transition: opacity 0.15s;
}

.psy-auth-chip__logout:hover {
	opacity: 0.8;
}

@media (max-width: 640px) {
	.psy-auth-chip__name { display: none; }
	.psy-auth-chip__btn { padding-right: 8px; }
}
