@import url('/css/shell.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@500;700&display=swap');

/* --- Variables --- */
:root {
	color-scheme: dark;
	--bg: #0f1419;
	--surface: #1a2332;
	--surface-hover: #243044;
	--border: #2d3a4f;
	--text: #e6edf3;
	--text-muted: #8b9cb3;
	--primary: #3b82f6;
	--primary-hover: #2563eb;
	--success: #22c55e;
	--error: #ef4444;
	--radius: 12px;
	--shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
	--font: 'Segoe UI', system-ui, -apple-system, sans-serif;
	/* Скроллбар в тон сайта */
	--scrollbar-track: var(--surface-hover);
	--scrollbar-thumb: #3d4d66;
	--scrollbar-thumb-hover: #4d6078;
	--header-bg: rgba(15, 20, 25, 0.9);
	--overlay-scrim: rgba(15, 20, 25, 0.55);
	--modal-overlay: rgba(0, 0, 0, 0.65);
	--modal-loading-scrim: rgba(26, 35, 50, 0.92);
	--lp-section-alt-bg: rgba(26, 35, 50, 0.55);
	--spot-toggle-checked-color: #93c5fd;
}

[data-theme="light"] {
	color-scheme: light;
	/* Vibrant cool-blue light theme: clear hierarchy, white surfaces, rich blue accent */
	--bg: #eef3fb;
	--surface: #ffffff;
	--surface-hover: #e5edf8;
	--border: #c8d5e8;
	--text: #0d1b2e;
	--text-muted: #4e6380;
	--primary: #1d4ed8;
	--primary-hover: #1e40af;
	--success: #059669;
	--error: #dc2626;
	--shadow: 0 1px 3px rgba(13, 27, 46, 0.07), 0 4px 16px rgba(13, 27, 46, 0.11);
	--scrollbar-track: #e5edf8;
	--scrollbar-thumb: #b0c4dc;
	--scrollbar-thumb-hover: #87a3c2;
	--header-bg: rgba(255, 255, 255, 0.96);
	--overlay-scrim: rgba(238, 243, 251, 0.90);
	--modal-overlay: rgba(13, 27, 46, 0.55);
	--modal-loading-scrim: rgba(255, 255, 255, 0.97);
	--lp-section-alt-bg: rgba(229, 237, 248, 0.96);
	--spot-toggle-checked-color: #1d4ed8;
}

/* --- Scrollbar (в тон сайта) --- */
.spot-exchanges-chips-wrap,
.spot-table-wrapper,
.view--spot .card {
	scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
	scrollbar-width: thin;
}
.spot-exchanges-chips-wrap::-webkit-scrollbar,
.spot-table-wrapper::-webkit-scrollbar,
.view--spot .card::-webkit-scrollbar {
	width: 10px;
	height: 10px;
}
.spot-exchanges-chips-wrap::-webkit-scrollbar-track,
.spot-table-wrapper::-webkit-scrollbar-track,
.view--spot .card::-webkit-scrollbar-track {
	background: var(--scrollbar-track);
	border-radius: 5px;
}
.spot-exchanges-chips-wrap::-webkit-scrollbar-thumb,
.spot-table-wrapper::-webkit-scrollbar-thumb,
.view--spot .card::-webkit-scrollbar-thumb {
	background: var(--scrollbar-thumb);
	border-radius: 5px;
}
.spot-exchanges-chips-wrap::-webkit-scrollbar-thumb:hover,
.spot-table-wrapper::-webkit-scrollbar-thumb:hover,
.view--spot .card::-webkit-scrollbar-thumb:hover {
	background: var(--scrollbar-thumb-hover);
}

/* --- Base --- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.5;
	color: var(--text);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
}

/* iOS Safari auto-zooms focused inputs with font-size < 16px */
@media (hover: none) and (pointer: coarse) {
	input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="file"]),
	select,
	textarea {
		font-size: 16px !important;
	}
}

.app {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

/* --- Header --- */
#app-header-container {
	overflow: visible;
}

.header:not(.app-topbar) {
	position: sticky;
	top: 0;
	z-index: 10;
	background: var(--header-bg);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid transparent;
	overflow: visible;
}

[data-theme="light"] .header:not(.app-topbar) {
	border-bottom-color: var(--border);
}

.nav {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 1rem;
	row-gap: 0.65rem;
	max-width: none;
	margin: 0;
	padding: 1.5rem 4rem 0.4rem;
	overflow: visible;
}

/* Левая колонка: лого и ссылки — один flex-элемент, чтобы правая колонка не сжималась в ноль */
.nav-start {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 1rem;
	flex: 1 1 auto;
	min-width: 0;
}

.nav-logo-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	margin-right: 2.4rem;
	border-radius: 6px;
	text-decoration: none;
	flex-shrink: 0;
}

.nav-logo-link:hover {
	cursor: pointer;
}

.nav-logo-img {
	display: block;
	width: 148px;
	height: auto;
	max-height: 32px;
	object-fit: contain;
	object-position: left center;
}

.nav-logo-img--light {
	display: none;
}

html[data-theme="light"] .nav-logo-img--dark {
	display: none;
}

html[data-theme="light"] .nav-logo-img--light {
	display: block;
}

@media (max-width: 900px) {
	.nav-logo-link:not(.app-sidebar-brand-link):not(.app-topbar-brand) .nav-logo-img {
		width: 132px;
		max-height: 28px;
	}

	.nav { padding-left: 1rem; padding-right: 1rem; }
}

/* Узкий экран: правая группа целиком на второй строке, выравнивание вправо */
@media (max-width: 640px) {
	.nav-end {
		flex-basis: 100%;
		justify-content: flex-end;
	}
}

.nav-link {
	color: var(--text-muted);
	text-decoration: none;
	padding: 0.35rem 0.5rem;
	font-size: 1.08rem;
	border-radius: 6px;
	transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
	color: var(--text);
	background: var(--surface-hover);
}

.nav-link-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.4rem;
}

.nav-products {
	position: relative;
}

.nav-products-toggle {
	border: none;
	background: none;
	padding: 0.35rem 1.65rem 0.35rem 0.5rem;
	font-size: 1.08rem;
	font-family: inherit;
	color: var(--text-muted);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	border-radius: 6px;
	line-height: 1.5;
	transition: color 0.15s, background 0.15s;
	position: relative;
}

.nav-products-toggle-chevron {
	position: absolute;
	right: 0.45rem;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	color: currentColor;
	pointer-events: none;
	transition: transform 0.18s ease;
}

.nav-products.nav-products--open .nav-products-toggle-chevron {
	transform: translateY(-50%) rotate(180deg);
}

.nav-products-toggle:hover,
.nav-products-toggle:focus-visible {
	color: var(--text);
	background: var(--surface-hover);
	outline: none;
}

.nav-products-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 220px;
	margin-top: 0.25rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 8px;
	box-shadow: var(--shadow);
	padding: 0.35rem 0;
	display: none;
	z-index: 100;
}

.nav-products.nav-products--open .nav-products-menu {
	display: block;
}

/* Показ меню управляется классом .nav-products--open (вешается JS) */

.nav-products-item {
	display: block;
	padding: 0.4rem 0.75rem;
	color: var(--text-muted);
	text-decoration: none;
	white-space: nowrap;
}

.nav-products-item:hover {
	color: var(--text);
	background: var(--surface-hover);
}

.nav-link-icon .icon-profile {
	color: var(--text-muted);
}

.nav-link-icon:hover .icon-profile {
	color: var(--text);
}

/* Правая колонка: тема, язык, вход, профиль… — второй flex-элемент у .nav (всегда видимый контент) */
.nav-end {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.65rem 1rem;
	margin-left: auto;
	flex: 0 0 auto;
	width: auto;
	max-width: none;
	min-width: 0;
}

.nav-end .theme-toggle,
.nav-end .lang-switch,
.nav-end .lang-select,
.nav-end .nav-link,
.nav-start .nav-social-link,
.nav-end .nav-social-link {
	flex-shrink: 0;
}

.nav-site-link {
	font-weight: 600;
	font-size: 0.875rem;
	text-decoration: none;
	color: var(--text);
}

.nav-site-link:hover {
	color: var(--primary);
}

.nav-social-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	color: var(--text-muted);
	text-decoration: none;
}

.nav-social-link:hover {
	color: var(--primary);
	border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
}

.lang-switch {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.theme-toggle:not(.app-topbar-overflow-row) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--surface);
	color: var(--text-muted);
	cursor: pointer;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.theme-toggle:not(.app-topbar-overflow-row):hover {
	background: var(--surface-hover);
	color: var(--text);
	border-color: var(--text-muted);
}

.theme-toggle:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}

.theme-toggle-icon {
	display: block;
	flex-shrink: 0;
}

html:not([data-theme="light"]) .theme-toggle-icon--moon {
	display: none;
}

html[data-theme="light"] .theme-toggle-icon--sun {
	display: none;
}

.lang-select {
	padding: 0.25rem 0.75rem;
	font-size: 0.95rem;
	font-family: inherit;
	color: var(--text-muted);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 6px;
	cursor: pointer;
	min-width: 4.5rem;
	width: auto;
	max-width: none;
}

.user-state {
	margin: 0;
	color: var(--text-muted);
	font-size: 0.9rem;
}

/* --- Main --- */
.main {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem 1rem;
}

/* --- Views --- */
.view {
	width: 100%;
	max-width: 420px;
}

.view.hidden {
	display: none !important;
}

.hidden {
	display: none !important;
}

.view--wide {
	max-width: 960px;
}

.view--tariffs {
	max-width: 1320px;
}

.view--spot {
	width: 1320px;
	max-width: 100%;
}

.view--admin {
	max-width: 720px;
}

.view--admin .admin-links {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 0.85rem;
	margin-bottom: 0.25rem;
}

.view--admin .admin-links .btn {
	width: 100%;
	min-height: 3rem;
	padding: 0.7rem 1rem;
	border-radius: 10px;
	font-weight: 600;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
	transition: background 0.15s, color 0.15s, transform 0.15s ease, box-shadow 0.15s ease;
}

[data-theme="dark"] .view--admin .admin-links .btn {
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .view--admin .admin-links .btn {
	box-shadow: 0 2px 14px rgba(79, 70, 229, 0.2);
}

.view--admin .admin-links .btn:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

[data-theme="light"] .view--admin .admin-links .btn:hover:not(:disabled) {
	box-shadow: 0 6px 22px rgba(79, 70, 229, 0.38);
}

.view--profile {
	max-width: 640px;
}

.view--pricings {
	max-width: 1280px;
}

.admin-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.plans-list--horizontal {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	justify-content: flex-start;
}

.plans-list--create {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1rem;
	margin-bottom: 1rem;
}

@media (max-width: 1100px) {
	.plans-list--create {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 560px) {
	.plans-list--create {
		grid-template-columns: 1fr;
	}
}

.plan-pricings-row {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	width: 100%;
	margin-bottom: 1.25rem;
	justify-content: center;
}

.plan-pricings-row:last-child {
	margin-bottom: 0;
}

.plan-pricings-row .plan-card {
	width: 260px;
	min-width: 260px;
	flex: 0 1 260px;
	max-width: 260px;
}

.price-row {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0.25rem 0;
}

.price-original {
	text-decoration: line-through;
	color: var(--text-muted);
	font-size: 0.95rem;
}

.price-current {
	font-weight: 600;
	color: var(--primary);
	font-size: 1.1rem;
}

.discount-badge {
	font-size: 0.8rem;
	padding: 0.2rem 0.5rem;
	border-radius: 6px;
	background: rgba(34, 197, 94, 0.2);
	color: var(--success);
}

.plan-card-meta {
	font-size: 0.85rem;
	color: var(--text-muted);
}

.plan-card .btn-plan-edit,
.plan-card .btn-pricing-edit {
	margin-top: 0.5rem;
	align-self: flex-start;
}

.plan-card-features,
.plan-card-limits {
	font-size: 0.8rem;
	line-height: 1.45;
	white-space: pre-wrap;
	word-break: break-word;
	overflow-wrap: anywhere;
	max-height: min(42vh, 22rem);
	overflow-y: auto;
	overflow-x: hidden;
	overscroll-behavior: contain;
	margin-top: 0.35rem;
	padding: 0.5rem 0.6rem;
	border-radius: 8px;
	border: 1px solid var(--border);
	background: var(--surface);
	font-family: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
	scrollbar-width: thin;
	scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* --- Card --- */
.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 2rem;
	position: relative;
}

.auth-card-loading-overlay {
	position: absolute;
	inset: 0;
	z-index: 30;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--overlay-scrim);
	border-radius: var(--radius);
}

.card h1,
.card h2 {
	margin: 0 0 0.5rem;
	font-size: 1.5rem;
	font-weight: 600;
}

.card > p {
	margin: 0 0 1.5rem;
	color: var(--text-muted);
	font-size: 0.95rem;
}

.card .hint {
	margin-bottom: 1rem;
	font-size: 0.9rem;
	color: var(--text-muted);
}

.card .hint-cooldown {
	margin-top: 0.25rem;
	margin-bottom: 0.5rem;
}

.card .hint-resend-limit {
	margin-bottom: 0.5rem;
}


/* --- Form --- */
.form {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.field {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.field.password-field {
	position: relative;
}

/* Обёртка input + кнопки (используется, например, на login.html) */
.password-field {
	position: relative;
}

.field label {
	font-size: 0.9rem;
	font-weight: 500;
	color: var(--text-muted);
}

.field input {
	width: 100%;
	padding: 0.6rem 0.75rem;
	font-size: 1rem;
	font-family: inherit;
	color: var(--text);
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 8px;
	transition: border-color 0.15s;
}

.field input::placeholder {
	color: var(--text-muted);
	opacity: 0.8;
}

.field input:focus {
	outline: none;
	border-color: var(--primary);
}

.field.field-invalid input,
.field.field-invalid select,
.field.field-invalid textarea {
	border-color: var(--error);
}

.page-profile-figma .profile-figma-field:not(.field-invalid) .profile-figma-input:invalid,
.page-auth-figma .profile-figma-field:not(.field-invalid) .profile-figma-input:invalid {
	border-color: var(--pf-input-border, var(--border));
	box-shadow: none;
}

.field textarea {
	width: 100%;
	padding: 0.6rem 0.75rem;
	font-size: 1rem;
	font-family: inherit;
	color: var(--text);
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 8px;
	transition: border-color 0.15s;
	resize: vertical;
	min-height: 4rem;
}

.field textarea:focus {
	outline: none;
	border-color: var(--primary);
}

.field select {
	width: 100%;
	padding: 0.6rem 0.75rem;
	font-size: 1rem;
	font-family: inherit;
	color: var(--text);
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 8px;
	cursor: pointer;
	transition: border-color 0.15s;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b9cb3' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
	padding-right: 2rem;
}

.field select:focus {
	outline: none;
	border-color: var(--primary);
}

[data-theme="light"] .field select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%232563eb' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
}

.field.field--disabled label,
.field.field--disabled input {
	opacity: 0.65;
	color: var(--text-muted);
	background: var(--surface-hover);
	cursor: not-allowed;
}

.field.field--disabled input {
	pointer-events: none;
}

.field.field-invalid input,
.field.field-invalid select,
.field.field-invalid textarea {
	border-color: var(--error);
	box-shadow: 0 0 0 1px var(--error);
}

.plan-card.selectable-plan {
	cursor: pointer;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.plan-card.selectable-plan:hover {
	border-color: var(--text-muted);
}

.plan-card.selectable-plan.active {
	border-color: var(--primary);
	box-shadow: 0 0 0 2px var(--primary);
	background: var(--surface);
}

.plans-list.plans-list--invalid {
	border: 2px solid var(--error);
	border-radius: 8px;
	padding: 0.5rem;
}

.password-toggle {
	position: absolute;
	right: 0.5rem;
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border: none;
	border-radius: 999px;
	background: transparent;
	color: var(--text-muted);
	cursor: pointer;
	font-size: 0.9rem;
	padding: 0;
	transition: background 0.15s, color 0.15s;
}

/* Когда кнопка лежит в .field.password-field вместе с label, центрируем по самому input */
.field.password-field > .password-toggle {
	top: calc(100% - 1.3rem);
	transform: translateY(-50%);
}

/* Правый отступ под кнопку, чтобы текст не наезжал */
.password-field input,
.field.password-field > input {
	padding-right: 2.85rem;
}

.password-toggle--shown {
	text-decoration: line-through;
	color: var(--primary);
}

.password-toggle:hover {
	background: var(--surface-hover);
	color: var(--text);
}

/* --- Buttons --- */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.6rem 1.25rem;
	font-size: 1rem;
	font-family: inherit;
	font-weight: 500;
	line-height: 1.25;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s, color 0.15s;
}

.btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.btn-primary {
	background: var(--primary);
	color: #fff;
}

.btn-primary:hover:not(:disabled) {
	background: var(--primary-hover);
}

.btn-secondary {
	background: var(--surface-hover);
	color: var(--text);
	border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
	background: var(--border);
}

.btn-ghost {
	background: transparent;
	color: var(--text-muted);
	margin-top: 0.75rem;
}

.btn-ghost:hover:not(:disabled) {
	color: var(--text);
	background: var(--surface-hover);
}

/* Состояние загрузки кнопки (Проверить платёж, Отменить платёж и т.д.) — спиннер рядом с текстом */
.btn--loading {
	pointer-events: none;
}

.btn--loading .btn-loading-spinner {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: load-spin 0.72s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.btn--loading.btn-secondary .btn-loading-spinner {
	border-color: var(--border);
	border-top-color: var(--text);
}

/* В шапке кнопка выхода без отступа сверху */
.header .btn-ghost {
	margin-top: 0;
}

/* Кнопка выхода — красный акцент */
.btn-danger {
	background: #b91c1c;
	color: #fff;
}

.btn-danger:hover:not(:disabled) {
	background: #991b1b;
}

/* --- Подтверждение действия (модальное окно) --- */
.confirm-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.25rem;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(10px);
	animation: confirm-overlay-in 0.2s ease-out;
}

@keyframes confirm-overlay-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

.confirm-modal-overlay.hidden {
	display: none !important;
}

.confirm-modal {
	position: relative;
	width: 100%;
	max-width: 420px;
	padding: 1.5rem 1.5rem 1.35rem;
	border-radius: 14px;
	box-shadow:
		0 4px 6px rgba(0, 0, 0, 0.07),
		0 24px 48px rgba(0, 0, 0, 0.18);
	animation: confirm-modal-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
	border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
}

@keyframes confirm-modal-in {
	from {
		opacity: 0;
		transform: scale(0.96) translateY(12px);
	}
	to {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

.confirm-modal-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3.5rem;
	height: 3.5rem;
	margin: 0 auto 1rem;
	border-radius: 50%;
	background: color-mix(in srgb, #f59e0b 18%, var(--surface-hover));
	color: #d97706;
}

.confirm-modal-icon--muted {
	background: color-mix(in srgb, var(--primary) 14%, var(--surface-hover));
	color: var(--primary);
}

[data-theme='light'] .confirm-modal-icon {
	background: color-mix(in srgb, #f59e0b 22%, #fff);
}

[data-theme='light'] .confirm-modal-icon--muted {
	background: color-mix(in srgb, var(--primary) 16%, #fff);
}

.confirm-modal-title {
	margin: 0 0 0.65rem;
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.3;
	text-align: center;
	letter-spacing: -0.02em;
	color: var(--text);
}

.confirm-modal-message {
	margin: 0 0 1rem;
	font-size: 0.98rem;
	line-height: 1.55;
	text-align: center;
	color: var(--text-muted);
}

.confirm-modal-warning {
	margin: 0 0 1.1rem;
	padding: 0.75rem 0.95rem;
	border-radius: 10px;
	font-size: 0.9rem;
	line-height: 1.5;
	text-align: center;
	font-weight: 500;
	color: var(--text);
	background: color-mix(in srgb, #ef4444 12%, var(--surface-hover));
	border: 1px solid color-mix(in srgb, #ef4444 35%, var(--border));
}

.confirm-modal-warning.hidden {
	display: none !important;
}

.confirm-modal-actions {
	display: flex;
	flex-direction: row-reverse;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.6rem;
	margin-top: 0.25rem;
}

.confirm-modal-actions .btn {
	min-width: 7.5rem;
}

@media (max-width: 420px) {
	.confirm-modal-actions {
		flex-direction: column-reverse;
	}
	.confirm-modal-actions .btn {
		width: 100%;
	}
}

/* --- Actions (home) --- */
.actions {
	display: flex;
	gap: 0.75rem;
	margin-top: 1.5rem;
}


.load-loading-block {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	padding: 2rem 1.5rem;
	animation: load-block-in 0.22s ease both;
}

.load-loading-block.hidden {
	display: none !important;
}

.load-loading-spinner {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 3px solid transparent;
	border-top-color: var(--primary);
	border-right-color: color-mix(in srgb, var(--primary) 45%, transparent);
	border-bottom-color: color-mix(in srgb, var(--primary) 15%, transparent);
	animation: load-spin 0.72s cubic-bezier(0.5, 0, 0.5, 1) infinite;
	flex-shrink: 0;
}

.load-loading-text {
	font-size: 0.95rem;
	color: var(--text-muted);
	animation: load-text-in 0.35s ease 0.1s both;
}

@keyframes load-block-in {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}

@keyframes load-spin {
	to { transform: rotate(360deg); }
}

@keyframes load-text-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.load-error-block {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.65rem 0.85rem;
	padding: 0.875rem 1rem;
	border-radius: 0.75rem;
	background: rgba(239, 68, 68, 0.08);
	border: 1px solid rgba(239, 68, 68, 0.22);
}

.load-error-block.hidden {
	display: none !important;
}

.load-error-message {
	display: inline;
	margin: 0;
	color: rgb(252, 165, 165);
	font-size: 0.875rem;
	line-height: 1.45;
	flex: 1 1 12rem;
	min-width: 0;
}

.load-error-retry,
.load-error-block .btn-primary.load-error-retry {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 7px 16px;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.25;
	border-radius: 10px;
	border: 1px solid transparent;
	background: rgb(79, 108, 246);
	color: #fff;
	cursor: pointer;
	text-decoration: none;
	transition: opacity 0.15s ease, background 0.15s ease;
	flex-shrink: 0;
}

.load-error-retry:hover,
.load-error-block .btn-primary.load-error-retry:hover {
	opacity: 0.92;
}

.payment-modal--alert .payment-modal-title {
	margin-bottom: 0.75rem;
}

.payment-modal-message {
	margin: 0 0 1.25rem;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--text-muted);
}

.payment-login-hint {
	margin: 0 0 1rem;
	color: var(--text-muted);
	font-size: 0.95rem;
}

/* --- Form footer --- */
.form-footer {
	margin: 1.25rem 0 0;
	padding-top: 1rem;
	border-top: 1px solid var(--border);
	font-size: 0.9rem;
	color: var(--text-muted);
}

.form-footer--no-divider {
	border-top: none;
	padding-top: 0.85rem;
}

.form-footer a {
	color: var(--primary);
	text-decoration: none;
}

.form-footer a:hover {
	text-decoration: underline;
}

.form-footer a.btn-primary,
.form-footer a.btn-primary:hover {
	color: #fff;
}

.form-footer--centered {
	text-align: center;
	margin-top: 1rem;
}

/* --- Toast --- */
.toast {
	position: fixed;
	bottom: 1.5rem;
	left: 50%;
	transform: translateX(-50%);
	padding: 0.75rem 1.25rem;
	border-radius: 8px;
	font-size: 0.9rem;
	font-weight: 500;
	box-shadow: var(--shadow);
	z-index: 10100;
	transition: opacity 0.2s, transform 0.2s;
}

.toast.hidden {
	opacity: 0;
	transform: translateX(-50%) translateY(0.5rem);
	pointer-events: none;
}

.toast.success {
	background: var(--success);
	color: #fff;
}

.toast.error {
	background: var(--error);
	color: #fff;
}

.toast.info {
	background: var(--primary);
	color: #fff;
}

/* Spinner keyframe — used by .load-loading-spinner and .btn--loading */
@keyframes load-spin {
	from { transform: rotate(0deg); }
	to   { transform: rotate(360deg); }
}
/* Backward-compat alias */
@keyframes payment-spin {
	from { transform: rotate(0deg); }
	to   { transform: rotate(360deg); }
}

/* Generic link-button (text-only clickable element) */
.link-button {
	border: none;
	background: none;
	padding: 0;
	font-size: 0.8rem;
	color: var(--primary);
	cursor: pointer;
	text-decoration: none;
	font-family: inherit;
}

.link-button:hover {
	text-decoration: underline;
	color: var(--primary-hover);
}

/* ============================================================
   === Global design polish & responsive ===
   ============================================================ */

/* Subtle gradient accent on card top edge */
.card::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: var(--radius);
	pointer-events: none;
	border-top: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .card::before {
	border-top-color: rgba(255, 255, 255, 0.9);
}

/* Profile nav card no underline for h2 */
.profile-nav-card h2::after,
.security-panel h3::after {
	display: none;
}

/* Inputs focus ring */
.field input:focus,
.field textarea:focus,
.field select:focus {
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

[data-theme="dark"] .field input:focus,
[data-theme="dark"] .field textarea:focus,
[data-theme="dark"] .field select:focus {
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

/* Password toggle SVG buttons */
.password-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.2rem;
	height: 2.2rem;
	padding: 0;
	border-radius: 6px;
}

/* === Responsive: main content padding === */
@media (max-width: 768px) {
	.main {
		padding: 1.25rem 0.75rem;
	}

	.card {
		padding: 1.5rem;
	}
}

@media (max-width: 480px) {
	.main {
		padding: 1rem 0.5rem;
	}

	.card {
		padding: 1.25rem 1rem;
		border-radius: 10px;
	}

	.nav {
		padding: 1rem 0.75rem 0.4rem;
	}
}

/* === Responsive: views === */
@media (max-width: 640px) {
	.view {
		max-width: 100%;
	}

	.view--wide {
		max-width: 100%;
	}
}

/* === Profile nav responsive === */
@media (max-width: 600px) {
	.profile-nav-toolbar.admin-user-toolbar {
		flex-wrap: wrap;
	}

	.profile-nav-toolbar .admin-user-toolbar-left {
		flex-wrap: wrap;
		gap: 0.35rem;
	}

	.profile-nav-card .profile-nav-link {
		font-size: 0.85rem;
		padding: 0.4rem 0.65rem;
	}
}

/* === Admin links responsive === */
@media (max-width: 480px) {
	.view--admin .admin-links {
		grid-template-columns: 1fr 1fr;
	}
}

/* === load-error-block border highlight === */
.load-error-block {
	background: rgba(239, 68, 68, 0.08);
	border: 1px solid rgba(239, 68, 68, 0.22);
}

[data-theme="light"] .load-error-block {
	background: rgba(225, 29, 72, 0.06);
	border-color: rgba(225, 29, 72, 0.2);
}

[data-theme="light"] .load-error-message {
	color: rgb(190, 24, 93);
}

/* === Improved form submit buttons === */
.form > .btn-primary,
.form > button[type="submit"].btn-primary {
	align-self: flex-start;
	padding: 0.65rem 2rem;
	font-weight: 600;
	letter-spacing: 0.01em;
}

/* === Section titles inside cards === */
.profile-section-title {
	font-size: 1rem;
	font-weight: 600;
	color: var(--text);
	margin: 0 0 1rem;
}

.auth-refresh-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: color-mix(in srgb, var(--bg, #0f1419) 55%, transparent);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	pointer-events: all;
}

.auth-refresh-overlay.hidden {
	display: none !important;
}

.auth-refresh-overlay__inner {
	display: flex;
	align-items: center;
	justify-content: center;
}

body.auth-refresh-busy {
	overflow: hidden;
}

body.auth-refresh-busy .nav-link,
body.auth-refresh-busy button,
body.auth-refresh-busy a,
body.auth-refresh-busy input,
body.auth-refresh-busy select,
body.auth-refresh-busy textarea {
	pointer-events: none;
}
