/**
 * Страница restore_user.php — визуально в стиле модалок лендинга (тёмная тема, золотая кайма).
 * Адаптив: телефоны, планшеты, safe-area, крупные тач-цели.
 */
html.restore-user-html {
	height: 100%;
	overflow-x: hidden;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

.restore-user-page {
	margin: 0;
	min-height: 100vh;
	min-height: 100dvh;
	min-height: -webkit-fill-available;
	width: 100%;
	overflow-x: hidden;
	font-family: "PT Sans", "Segoe UI", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.45;
	color: #e8dcc8;
	background: #080605;
	background-image: radial-gradient(ellipse 120% 80% at 50% 0%, rgba(45, 35, 28, 0.65) 0%, transparent 55%),
		linear-gradient(180deg, #14110e 0%, #0a0907 100%);
	-webkit-tap-highlight-color: transparent;
}

.restore-user-page__wrap {
	min-height: 100vh;
	min-height: 100dvh;
	min-height: -webkit-fill-available;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
	padding: max(24px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
		max(24px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
	box-sizing: border-box;
}

.restore-user-card {
	width: min(520px, 100%);
	max-width: 100%;
	max-height: min(92vh, 900px);
	max-height: min(92dvh, 900px);
	overflow: auto;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;
	position: relative;
	border-radius: 8px;
	border: 1px solid rgba(200, 160, 90, 0.5);
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.06);
	background: #0f0d0b;
	display: flex;
	flex-direction: column;
}

.restore-user-card__header {
	flex-shrink: 0;
	padding: 12px 16px;
	text-align: center;
	background: linear-gradient(180deg, rgba(42, 32, 24, 0.98) 0%, rgba(22, 17, 13, 0.98) 100%);
	border-bottom: 1px solid rgba(200, 160, 90, 0.5);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.restore-user-card__title {
	margin: 0;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #ffd89a;
}

.restore-user-card__lead {
	margin: 8px 0 0;
	font-size: 0.85rem;
	font-weight: 400;
	color: #c4b8a4;
	line-height: 1.35;
}

.restore-user-card__body {
	flex: 1;
	min-height: 0;
	padding: 16px 18px 20px;
	background: linear-gradient(180deg, #1a1612 0%, #100e0c 100%);
}

.restore-user-card__alert {
	margin: 0 0 14px;
	padding: 12px 14px;
	border-radius: 8px;
	border: 1px solid rgba(200, 100, 80, 0.45);
	background: rgba(60, 28, 22, 0.45);
	color: #ffd4c8;
	font-size: 0.9rem;
	text-align: center;
}

.restore-user-card__cooldown {
	margin: 0 0 14px;
	padding: 10px 12px;
	border-radius: 8px;
	border: 1px solid rgba(160, 130, 90, 0.35);
	background: rgba(35, 28, 22, 0.65);
	color: #f0c878;
	font-size: 0.9rem;
	text-align: center;
}

.restore-user-form__row {
	display: flex;
	flex-direction: column;
	gap: 0;
	margin-bottom: 14px;
}

.restore-user-form__row input {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	min-height: 48px;
	padding: 12px 14px;
	border-radius: 8px;
	border: 1px solid #9f7a45;
	background: linear-gradient(180deg, rgba(26, 21, 16, 0.98) 0%, rgba(13, 10, 8, 0.98) 100%);
	color: #f6f0e3;
	font-family: inherit;
	font-size: 1rem;
	box-shadow: inset 0 1px 0 rgba(255, 229, 178, 0.06);
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.restore-user-form__row input::placeholder {
	color: rgba(232, 220, 200, 0.55);
	opacity: 1;
}

.restore-user-form__row input:hover {
	border-color: #b58a50;
}

.restore-user-form__row input:focus {
	outline: none;
	border-color: #d0a15f;
	box-shadow: inset 0 1px 0 rgba(255, 235, 196, 0.1), 0 0 10px rgba(220, 172, 98, 0.12);
}

.restore-user-form__actions {
	margin-top: 8px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	text-align: center;
}

.restore-user-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 420px;
	min-height: 48px;
	padding: 12px 18px;
	margin: 4px 0;
	box-sizing: border-box;
	cursor: pointer;
	font-family: inherit;
	font-weight: 700;
	font-size: 1rem;
	color: #ffd89a;
	text-align: center;
	border-radius: 8px;
	border: 1px solid rgba(220, 160, 80, 0.45);
	background: linear-gradient(180deg, rgba(90, 55, 35, 0.9) 0%, rgba(45, 32, 22, 0.95) 100%);
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
	touch-action: manipulation;
}

.restore-user-btn:hover {
	background: rgba(60, 48, 36, 0.85);
	border-color: rgba(200, 160, 100, 0.55);
	color: #fff;
}

/* Вторичная кнопка — как основная по форме, но приглушённее */
.restore-user-btn--secondary {
	text-decoration: none;
	font-weight: 600;
	color: rgba(200, 175, 145, 0.82);
	border-color: rgba(130, 105, 70, 0.42);
	background: linear-gradient(180deg, rgba(42, 34, 28, 0.88) 0%, rgba(22, 18, 15, 0.94) 100%);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.restore-user-btn--secondary:hover {
	background: rgba(48, 40, 34, 0.92);
	border-color: rgba(150, 125, 85, 0.45);
	color: #e8dcc8;
}

.restore-user-btn--secondary:focus-visible {
	outline: none;
	border-color: rgba(180, 145, 95, 0.55);
	box-shadow: 0 0 0 2px rgba(120, 95, 55, 0.35);
}

/* Планшеты и узкие ноутбуки */
@media (max-width: 900px) {
	.restore-user-page__wrap {
		align-items: flex-start;
		padding-top: max(20px, env(safe-area-inset-top, 0px));
	}

	.restore-user-card {
		max-height: none;
		margin-top: 0;
	}

	.restore-user-card__title {
		font-size: clamp(0.9rem, 2.5vw, 1rem);
	}

	.restore-user-card__lead {
		font-size: clamp(0.8rem, 2.2vw, 0.85rem);
	}
}

/* Планшеты портрет */
@media (max-width: 900px) and (min-width: 481px) {
	.restore-user-page__wrap {
		padding-left: max(20px, env(safe-area-inset-left, 0px));
		padding-right: max(20px, env(safe-area-inset-right, 0px));
	}

	.restore-user-card {
		width: min(560px, 100%);
	}

	.restore-user-card__body {
		padding: 18px 22px 22px;
	}
}

/* Телефоны */
@media (max-width: 480px) {
	.restore-user-page {
		font-size: 15px;
	}

	.restore-user-page__wrap {
		align-items: stretch;
		padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px))
			max(16px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
	}

	.restore-user-card {
		border-radius: 6px;
		max-height: none;
		min-height: 0;
		flex: 1;
	}

	.restore-user-card__header {
		padding: 14px 12px 12px;
	}

	.restore-user-card__title {
		font-size: 0.92rem;
		line-height: 1.25;
		letter-spacing: 0.04em;
	}

	.restore-user-card__lead {
		font-size: 0.82rem;
		margin-top: 10px;
	}

	.restore-user-card__body {
		padding: 14px 14px max(18px, env(safe-area-inset-bottom, 0px));
	}

	.restore-user-card__alert,
	.restore-user-card__cooldown {
		font-size: 0.88rem;
		padding: 12px;
	}

	.restore-user-form__row {
		margin-bottom: 12px;
		gap: 0;
	}

	.restore-user-form__row input {
		min-height: 48px;
		padding: 14px 14px;
		font-size: 16px; /* предотвращает авто-зум iOS при фокусе */
	}

	.restore-user-form__actions {
		margin-top: 12px;
	}

	.restore-user-btn {
		min-height: 48px;
		max-width: none;
		width: 100%;
		font-size: 0.95rem;
		padding: 14px 16px;
	}

	.restore-user-form__actions {
		gap: 12px;
	}
}

/* Очень узкие экраны */
@media (max-width: 360px) {
	.restore-user-card__title {
		font-size: 0.85rem;
	}

	.restore-user-card__body {
		padding-left: 12px;
		padding-right: 12px;
	}
}

/* Низкая высота (ландшафт на телефоне) */
@media (max-height: 520px) and (orientation: landscape) {
	.restore-user-page__wrap {
		align-items: flex-start;
		padding-top: max(8px, env(safe-area-inset-top, 0px));
		padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
	}

	.restore-user-card {
		max-height: min(92vh, 92dvh);
	}

	.restore-user-card__lead {
		display: none;
	}

	.restore-user-form__row {
		margin-bottom: 10px;
	}
}

/* Крупный палец / hover без мыши — усиливаем активное состояние кнопки */
@media (hover: none) {
	.restore-user-btn:active {
		background: rgba(75, 58, 42, 0.95);
		border-color: rgba(210, 175, 120, 0.55);
		color: #fff;
	}

	.restore-user-btn--secondary:active {
		background: rgba(40, 34, 28, 0.98);
		border-color: rgba(130, 110, 75, 0.5);
		color: #f0e4d4;
	}
}
