/* The /app sign-in and no-access pages (Calm premium). Loaded after app-base.css, which brings the tokens and the font. */
.sg-page { min-height: 100vh; min-height: 100dvh; background: var(--page); }
.sg {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
	min-height: 100vh; min-height: 100dvh;
	padding: max(32px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.sg__card {
	width: min(100%, 400px); padding: 36px 32px 32px;
	background: var(--app-bg); border: 1px solid var(--line); border-radius: 16px;
	box-shadow: var(--sh-1), var(--sh-2);
	animation: sg-in var(--slow) var(--ease) both;
}
@keyframes sg-in { from { opacity: 0; transform: translateY(8px); } }

.sg__head { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.sg__head .logo { width: 40px; height: 40px; }
.sg__head .logo--img img { display: block; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.sg__site { min-width: 0; font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--ink); overflow-wrap: anywhere; }
.sg__title { font: var(--title); font-size: 28px; letter-spacing: var(--title-ls); color: var(--ink); }
.sg__lead { margin-top: 8px; font-size: 14.5px; color: var(--ink-2); }

.sg__form { display: flex; flex-direction: column; gap: 18px; margin-top: 28px; }
.sg__err {
	display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px;
	border-radius: var(--r-m); border: 1px solid color-mix(in srgb, var(--danger) 28%, transparent);
	background: color-mix(in srgb, var(--danger) 7%, var(--app-bg)); color: var(--danger);
	font-size: 13.5px; font-weight: 500; line-height: 1.45;
}
.sg__err .ico { margin-top: 1px; }
.sg__field { display: flex; flex-direction: column; gap: 8px; }
.sg__field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.sg__field input {
	width: 100%; min-height: 48px; padding: 0 14px;
	border: 1px solid var(--line); border-radius: var(--r-m); background: var(--field); color: var(--ink);
	font: 500 16px/1.2 var(--font); outline: none;
	transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.sg__field input:hover { border-color: var(--ink-3); }
.sg__field input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 12%, transparent); }
.sg__field input[aria-invalid="true"] { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }
.sg__field input[aria-invalid="true"]:focus { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 14%, transparent); }
.sg__pw { position: relative; }
.sg__pw input { padding-right: 52px; }
.sg__pw input::-ms-reveal { display: none; }
.sg__eye {
	position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 40px; height: 40px;
	border-radius: calc(var(--r-m) - 2px); color: var(--ink-3);
	transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.sg__eye:hover { background: var(--sheet-2); color: var(--ink); }
.sg__eye .sg__eye-shut { display: none; }
.sg__eye[aria-pressed="true"] .sg__eye-open { display: none; }
.sg__eye[aria-pressed="true"] .sg__eye-shut { display: inline; }

.sg__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: -2px; }
.sg__check { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 40px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); cursor: pointer; user-select: none; }
.sg__check input { position: absolute; opacity: 0; width: 20px; height: 20px; margin: 0; cursor: pointer; }
.sg__box {
	display: grid; place-items: center; width: 20px; height: 20px; flex: none;
	border: 1.5px solid var(--ink-3); border-radius: 6px; color: var(--on-btn);
	transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.sg__box .ico { width: 14px; height: 14px; stroke-width: 2.2; opacity: 0; transform: scale(.6); transition: opacity var(--fast) var(--ease), transform var(--mid) var(--ease); }
.sg__check input:checked + .sg__box { background: var(--btn); border-color: var(--btn); }
.sg__check input:checked + .sg__box .ico { opacity: 1; transform: none; }
.sg__check input:focus-visible + .sg__box { outline: 2px solid var(--focus); outline-offset: 2px; }
.sg__link {
	display: inline-flex; align-items: center; min-height: 40px; font-size: 13.5px; font-weight: 500; color: var(--ink-2);
	text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px;
}
.sg__link:hover { color: var(--ink); text-decoration-color: currentColor; }

.sg__submit { position: relative; width: 100%; min-height: 48px; font-size: 15px; border-radius: var(--r-m); }
.sg__card > .sg__submit, .sg__gap { margin-top: 28px; }
.sg__spin {
	position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
	border: 2px solid color-mix(in srgb, var(--on-btn) 30%, transparent); border-top-color: var(--on-btn); border-radius: 50%;
	opacity: 0; animation: sg-spin .7s linear infinite;
}
@keyframes sg-spin { to { transform: rotate(360deg); } }
.sg__form.is-busy .sg__submit { cursor: progress; }
.sg__form.is-busy .sg__submit > span:first-child { opacity: 0; }
.sg__form.is-busy .sg__spin { opacity: 1; }

.sg__foot { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; color: var(--ink-3); letter-spacing: .01em; }
.sg__star { display: inline-grid; width: 16px; height: 16px; color: var(--ink-3); }
.sg__star svg { width: 100%; height: 100%; }

@media (max-width: 480px) {
	.sg { justify-content: flex-start; padding-top: max(40px, calc(env(safe-area-inset-top) + 24px)); }
	.sg__card { padding: 28px 22px 24px; border-radius: 14px; }
	.sg__title { font: var(--ph-title); letter-spacing: var(--title-ls); }
}
@media (prefers-reduced-motion: reduce) {
	.sg__card { animation: none; }
}
/* The Kohal mark's dot: warm red, a touch lighter on dark. */
:root[data-theme="dark"] { --kohal-dot: #ee5a3c; }
/* forgot-password screens */
.sg__badge { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 18px; border-radius: 14px; background: var(--sheet-2); border: 1px solid var(--line); color: var(--ink); }
.sg__badge .ico { width: 22px; height: 22px; }
.sg__badge--warn { color: var(--warn); }
.sg__back {
	display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; margin-top: 14px;
	font-size: 13.5px; font-weight: 500; color: var(--ink-2); border-radius: var(--r-m);
}
.sg__back .ico { width: 16px; height: 16px; }
.sg__back:hover { color: var(--ink); background: var(--sheet-2); }
