/* =====================================================================
   Планировщик — вход, регистрация и экран-гейт для гостей
   Файл самодостаточный: planner.css на этих страницах не подключается,
   поэтому фирменные токены объявлены здесь и ограничены нашими классами.
   ===================================================================== */

.pl-auth,
.pl-gate {
	--pl-primary: #198bb0;
	--pl-primary-2: #147493;
	--pl-grad: linear-gradient(135deg, #198bb0 0%, #37a9cc 100%);
	--pl-ink: #1e1b3a;
	--pl-mut: #6b7280;
	--pl-line: #ece9f4;
	--pl-bg: #f6f5fb;
	--pl-card: #ffffff;
	--pl-danger: #ef4444;
	--pl-ok: #10b981;
	--pl-warn: #f59e0b;
	--pl-r: 14px;
	--pl-r-sm: 10px;
	--pl-shadow: 0 2px 8px rgba(25, 139, 176, .06), 0 6px 20px rgba(16, 61, 76, .06);
	--pl-shadow-lg: 0 12px 40px -8px rgba(70, 60, 140, .16);
	--pl-font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
}

.pl-auth,
.pl-auth *,
.pl-gate,
.pl-gate * {
	box-sizing: border-box;
}

/* Нейтрализуем общий розовый hover/focus reset темы сайта внутри форм и кабинета. */
:where(.pl-auth, .pl-gate, .pl-cab) :is(button, [type="button"], [type="submit"]):is(:hover, :focus) {
	background-color: transparent;
	color: inherit;
	text-decoration: none;
}
:where(.pl-auth, .pl-gate, .pl-cab) a,
:where(.pl-auth, .pl-gate, .pl-cab) a:hover,
:where(.pl-auth, .pl-gate, .pl-cab) a:focus {
	color: inherit;
	text-decoration: none;
}
:where(.pl-auth, .pl-gate, .pl-cab) button:focus-visible,
:where(.pl-auth, .pl-gate, .pl-cab) [type="button"]:focus-visible,
:where(.pl-auth, .pl-gate, .pl-cab) [type="submit"]:focus-visible,
:where(.pl-auth, .pl-gate, .pl-cab) a:focus-visible {
	outline: 2px solid rgba(25, 139, 176, .6);
	outline-offset: 2px;
}

/* ======================= Кнопки ======================= */
.pl-auth .pl-btn,
.pl-gate .pl-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	border: 0; cursor: pointer;
	padding: 11px 22px;
	border-radius: 11px;
	font-family: var(--pl-font);
	font-size: 14px; font-weight: 650;
	text-decoration: none;
	transition: background .2s, box-shadow .2s, transform .12s;
}
.pl-auth .pl-btn:active,
.pl-gate .pl-btn:active { transform: translateY(1px) scale(.99); }

.pl-auth .pl-btn--primary,
.pl-gate .pl-btn--primary {
	background: var(--pl-grad); color: #fff;
	box-shadow: 0 6px 18px -6px rgba(25, 139, 176, .55);
}
.pl-auth .pl-btn--primary:hover,
.pl-gate .pl-btn--primary:hover {
	background: linear-gradient(135deg, #1a94b8 0%, #2ea3c6 100%);
	box-shadow: 0 8px 24px -6px rgba(25, 139, 176, .55);
	color: #fff;
}

.pl-auth .pl-btn--ghost,
.pl-gate .pl-btn--ghost {
	background: #fff; color: var(--pl-primary-2);
	box-shadow: inset 0 0 0 1.5px rgba(25, 139, 176, .35);
}
.pl-auth .pl-btn--ghost:hover,
.pl-gate .pl-btn--ghost:hover {
	background: #eef8fb; color: var(--pl-primary-2);
	box-shadow: inset 0 0 0 1.5px rgba(25, 139, 176, .5);
}

/* ======================= Гейт для гостей ======================= */
.pl-gate {
	display: flex; justify-content: center;
	margin: 2.5rem 0 3rem;
	font-family: var(--pl-font);
	color: var(--pl-ink);
	line-height: 1.5;
	text-align: center;
}
.pl-gate__card {
	width: 100%; max-width: 520px;
	padding: 38px 32px 34px;
	background: var(--pl-card);
	border: 1px solid var(--pl-line);
	border-radius: 20px;
	box-shadow: var(--pl-shadow-lg);
}
.pl-gate__icon {
	width: 66px; height: 66px; margin: 0 auto 18px;
	display: flex; align-items: center; justify-content: center;
	border-radius: 20px;
	background: var(--pl-grad);
	color: #fff;
	box-shadow: 0 10px 26px -10px rgba(25, 139, 176, .7);
}
.pl-gate__title {
	margin: 0 0 10px;
	font-size: 22px; font-weight: 700; letter-spacing: -.3px;
	color: var(--pl-ink);
}
.pl-gate__text {
	margin: 0 auto 22px;
	max-width: 420px;
	color: var(--pl-mut);
	font-size: 14.5px; line-height: 1.55;
}
.pl-gate__actions {
	display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
}
.pl-gate__card--warn .pl-gate__icon {
	background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
	box-shadow: 0 10px 26px -10px rgba(245, 158, 11, .7);
}

/* ======================= Вход и регистрация ======================= */
.pl-auth {
	display: flex; justify-content: center;
	margin: 2.5rem 0 3rem;
	font-family: var(--pl-font);
	color: var(--pl-ink);
	line-height: 1.5;
	text-align: left;
}

/*
 * Единожды узнаём: вкладки кабинета повторяют разметку auth-страниц,
 * поэтому общий фирменный охват расширен на .pl-cab
 * ( cabinet）。Файл planner-cabinet.css объявляет те же токены.
 */
.pl-cab {
	text-align: left;
}
.pl-auth--narrow .pl-auth__card { max-width: 440px; }
.pl-auth__card {
	width: 100%; max-width: 480px;
	padding: 32px 32px 26px;
	background: var(--pl-card);
	border: 1px solid var(--pl-line);
	border-radius: 20px;
	box-shadow: var(--pl-shadow-lg);
}
.pl-auth__brand {
	display: flex; align-items: center; gap: 12px;
	padding-bottom: 18px; margin-bottom: 22px;
	border-bottom: 1px solid var(--pl-line);
}
.pl-auth__logo {
	width: 42px; height: 42px; flex: 0 0 42px;
	display: flex; align-items: center; justify-content: center;
	border-radius: 13px;
	background: var(--pl-grad);
	color: #fff;
	box-shadow: 0 8px 20px -8px rgba(25, 139, 176, .7);
}
.pl-auth__brandtext { display: flex; flex-direction: column; }
.pl-auth__brandname { font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
.pl-auth__brandsub { font-size: 12.5px; color: var(--pl-mut); }

.pl-auth__title { margin: 0 0 8px; font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.pl-auth__sub { margin: 0 0 20px; color: var(--pl-mut); font-size: 14px; line-height: 1.5; }

.pl-auth__field { margin-top: 16px; }
.pl-auth__field:first-of-type { margin-top: 0; }

/* Фамилия и имя — в две колонки, чтобы форма не растягивалась */
.pl-auth__row { display: flex; gap: 14px; margin-top: 16px; }
.pl-auth__row .pl-auth__field { flex: 1 1 0; min-width: 0; margin-top: 0; }

/* Строка «Логин» + кнопка генерации */
.pl-auth__labelrow {
	display: flex; align-items: baseline; justify-content: space-between;
	gap: 12px; margin-bottom: 7px;
}
.pl-auth__labelrow .pl-auth__label { margin-bottom: 0; }
.pl-auth .pl-auth__gen {
	border: 0; background: transparent; padding: 0;
	color: var(--pl-primary-2); cursor: pointer;
	font-family: inherit; font-size: 12.5px; font-weight: 700;
	white-space: nowrap;
	text-decoration: underline; text-underline-offset: 2px;
}
.pl-auth .pl-auth__gen:hover { color: #0f5c76; }
.pl-auth .pl-auth__gen:active { transform: translateY(1px); }
.pl-auth .pl-auth__gen[disabled] { opacity: .55; cursor: wait; }
.pl-auth__label {
	display: block; margin-bottom: 7px;
	font-size: 12.5px; font-weight: 700;
	color: #4d4870;
	text-transform: uppercase; letter-spacing: .5px;
}

/* Поля ввода: !important, чтобы стили темы сайта не перекрашивали их (как в planner.css).
 * Охват расширен на .pl-cab — поля кабинета тоже фирменные. */
.pl-auth .pl-auth__input,
.pl-cab .pl-auth__input {
	width: 100% !important;
	padding: 12px 14px !important;
	border: 1.5px solid var(--pl-line) !important;
	border-radius: var(--pl-r-sm) !important;
	background: #fff !important;
	font-size: 14.5px !important;
	font-family: inherit !important;
	color: var(--pl-ink) !important;
	color-scheme: light;
	transition: border-color .2s, box-shadow .2s;
}
.pl-auth .pl-auth__input::placeholder, .pl-cab .pl-auth__input::placeholder { color: #a8a2c8 !important; opacity: 1; }
.pl-auth .pl-auth__input:hover, .pl-cab .pl-auth__input:hover { border-color: #d8d2ec !important; }
.pl-auth .pl-auth__input:focus,
.pl-cab .pl-auth__input:focus {
	outline: none;
	border-color: var(--pl-primary) !important;
	box-shadow: 0 0 0 3.5px rgba(25, 139, 176, .14) !important;
}
.pl-auth .pl-auth__input.is-invalid,
.pl-cab .pl-auth__input.is-invalid {
	border-color: var(--pl-danger) !important;
	box-shadow: 0 0 0 3.5px rgba(239, 68, 68, .12) !important;
}

.pl-auth__passwrap { position: relative; }
.pl-auth__passwrap .pl-auth__input { padding-right: 48px !important; }
.pl-auth .pl-auth__eye,
.pl-cab .pl-auth__eye {
	position: absolute; top: 50%; right: 8px;
	transform: translateY(-50%);
	width: 34px; height: 34px;
	padding: 0; /* темы часто задают button { padding: … } — иначе SVG сжимается в точку */
	display: inline-flex; align-items: center; justify-content: center;
	border: 0; border-radius: 9px;
	background: transparent; color: var(--pl-mut);
	cursor: pointer;
}
.pl-auth .pl-auth__eye:hover, .pl-cab .pl-auth__eye:hover { background: #eef8fb; color: var(--pl-primary-2); }
.pl-auth .pl-auth__eye[aria-pressed="true"], .pl-cab .pl-auth__eye[aria-pressed="true"] { color: var(--pl-primary-2); background: #eef8fb; }

.pl-auth__check {
	display: flex; align-items: center; gap: 9px;
	margin-top: 16px;
	font-size: 14px; color: var(--pl-ink);
	cursor: pointer;
}
.pl-auth__check input { width: 17px; height: 17px; accent-color: var(--pl-primary); cursor: pointer; }

/* Метки полей едины для auth-страниц и кабинета */
.pl-cab .pl-auth__label {
	display: block; margin-bottom: 7px;
	font-size: 12.5px; font-weight: 700;
	color: #4d4870;
	text-transform: uppercase; letter-spacing: .5px;
}

.pl-auth .pl-auth__submit,
.pl-cab .pl-auth__submit {
	display: flex; align-items: center; justify-content: center;
	width: 100% !important;
	margin-top: 20px;
	padding: 13px 22px !important;
	border: 0 !important;
	border-radius: 12px !important;
	background: var(--pl-grad) !important;
	color: #fff !important;
	font-family: inherit !important;
	font-size: 15px !important; font-weight: 650;
	text-decoration: none;
	cursor: pointer;
	box-shadow: 0 6px 18px -6px rgba(25, 139, 176, .55);
	transition: background .2s, box-shadow .2s, transform .12s;
}
.pl-auth .pl-auth__submit:hover,
.pl-cab .pl-auth__submit:hover {
	background: linear-gradient(135deg, #1a94b8 0%, #2ea3c6 100%) !important;
	color: #fff !important;
	box-shadow: 0 8px 24px -6px rgba(25, 139, 176, .55);
}
.pl-auth .pl-auth__submit:active, .pl-cab .pl-auth__submit:active { transform: translateY(1px) scale(.99); }
.pl-auth .pl-auth__submit[disabled], .pl-cab .pl-auth__submit[disabled] { opacity: .6 !important; cursor: wait; transform: none; }
.pl-auth__submit--link { max-width: 280px; margin-left: auto; margin-right: auto; }

.pl-auth__hint { margin: 8px 2px 0; color: #9d97b8; font-size: 12.5px; line-height: 1.45; }
.pl-auth__alt { margin: 20px 0 0; text-align: center; color: var(--pl-mut); font-size: 14px; }
.pl-auth__alt a { color: var(--pl-primary-2); font-weight: 650; text-decoration: none; }
.pl-auth__alt a:hover { text-decoration: underline; }
.pl-auth__dot { margin: 0 8px; color: #c9c4dd; }
.pl-auth__foot { margin: 14px 0 0; text-align: center; font-size: 13.5px; }
.pl-auth__foot a { color: var(--pl-mut); text-decoration: none; }
.pl-auth__foot a:hover { color: var(--pl-primary-2); text-decoration: underline; }

.pl-auth__note {
	margin: 0 0 6px; padding: 12px 14px;
	background: #f6f5fb; border: 1px solid var(--pl-line); border-radius: var(--pl-r-sm);
	color: var(--pl-mut); font-size: 13.5px; line-height: 1.5;
}
.pl-auth__note--warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }

/* Сообщения об ошибке и успехе */
.pl-auth__msg {
	margin-bottom: 16px; padding: 12px 14px;
	border-radius: var(--pl-r-sm);
	font-size: 13.5px; line-height: 1.5;
	border: 1px solid transparent;
}
.pl-auth__msg.is-err { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.pl-auth__msg.is-ok { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }

/* Ловушка для ботов — недоступна человеку, но видна ботам */
.pl-auth__honeypot {
	position: absolute !important;
	left: -9999px !important;
	width: 1px; height: 1px;
	overflow: hidden;
}

/* Иконки: тема сайта может перекрыть презентационные атрибуты SVG
 * (например, svg { fill: currentColor } — глаз и замок зальются в «квадрат с точкой»).
 * Закрепляем вид наших inline-SVG принудительно. */
.pl-auth svg,
.pl-auth svg :not([fill]),
.pl-gate svg,
.pl-gate svg :not([fill]),
.pl-cab svg,
.pl-cab svg :not([fill]) {
	fill: none !important;
	stroke: currentColor !important;
}
.pl-auth svg [fill],
.pl-gate svg [fill],
.pl-cab svg [fill] {
	fill: currentColor !important;
	stroke: none !important;
}

/* Мобильные экраны */
@media (max-width: 560px) {
	.pl-auth__card,
	.pl-gate__card { padding: 24px 20px 20px; border-radius: 16px; }
	.pl-auth__title,
	.pl-gate__title { font-size: 20px; }
	.pl-gate__actions { flex-direction: column; }
	.pl-gate__actions .pl-btn { width: 100%; }
	/* На узком экране фамилия и имя становятся друг под другом */
	.pl-auth__row { flex-direction: column; gap: 0; }
	.pl-auth__row .pl-auth__field + .pl-auth__field { margin-top: 16px; }
	.pl-auth__labelrow { flex-wrap: wrap; }
}
