/*
 * Default login (CRM login_template = "default"): auth/default/{login,restore,shell,restore-form}
 * and components/auth/*. Portal identity ("One Calm Column"): tokens come from tokens.css; the
 * accent (--cp-accent*) is emitted by the view from App\Http\Helpers\BrandTheme and is spent on the
 * primary button, the checkbox fills and the brand tile's tint. Template_2 and template_3 do not
 * load this file.
 *
 * Desktop: a brand tile (logo, intro headline, an abstract portal sketch, legal links) beside the
 * white form card on the portal ground. The tile's photo is img/default-tile.jpg - Shutterstock
 * #2468525227, "Two Adjoining Skyscrapers in Black and White" by Theodore Trimmer, licensed by the
 * account owner on 2026-11-23 (original 5328x8022); shipped as a 1280px greyscale JPEG so the accent
 * multiply tints it per brand. Phones drop the tile and keep the logo / card / legal links column.
 *
 * Contract kept: #kt_login + .login-*-on panel switching (login-general.js), every field inside a
 * .form-group (FormValidation / cpErrors), .toggle-password as the input's next sibling (guest.js).
 */

body.dl-page {
	background-color: var(--cp-ground);
	color: var(--cp-text);
	-webkit-font-smoothing: antialiased;
}

body.dl-page ::selection {
	background: rgba(var(--cp-a-rgb), 0.22);
	color: var(--cp-ink);
}

/* ---------- panel switching (replaces classic/login-3.css) ---------- */

.dl-login .login-signin,
.dl-login .login-signup,
.dl-login .login-forgot {
	display: none;
}

.dl-login.login-signin-on .login-signin,
.dl-login.login-signup-on .login-signup,
.dl-login.login-forgot-on .login-forgot {
	display: block;
	animation: dl-rise 0.32s var(--cp-ease) both;
}

@keyframes dl-rise {
	from {
		opacity: 0.4;
		transform: translateY(6px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

/* ---------- layout ---------- */

.dl-login {
	display: flex;
	min-height: 100vh;
}

.dl-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
	gap: 40px;
	align-items: stretch;
	width: 100%;
	max-width: 1440px;
	min-height: 100vh;
	margin: 0 auto;
	padding: 40px;
}

/* The brand tile. Background layers, top first: a white wash behind the logo and intro, a white wash
   behind the legal links, the brand accent multiplied into the photo, the greyscale photo itself.
   Without the photo (blocked or missing) the tile degrades to a light accent tint. The sketch bleeds
   off the inline-end edge, so that side has no padding and the text blocks carry it instead. */
.dl-brand {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 28px;
	min-width: 0;
	overflow: hidden;
	padding-block: 48px 36px;
	padding-inline: 48px 0;
	border-radius: var(--cp-radius-lg);
	background-color: var(--cp-surface);
	background-image:
		linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.55) 22%, rgba(255, 255, 255, 0) 48%),
		linear-gradient(0deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0) 16%),
		linear-gradient(rgba(var(--cp-a-rgb), 0.38), rgba(var(--cp-a-rgb), 0.38)),
		url("img/default-tile.jpg");
	background-position: center;
	background-size: cover;
	background-repeat: no-repeat;
	background-blend-mode: normal, normal, multiply, normal;
}

.dl-brand__logo {
	display: inline-flex;
	align-self: flex-start;
}

.dl-brand__logo img {
	display: block;
	width: auto;
	max-width: 220px;
	max-height: 44px;
}

.dl-brand__text,
.dl-brand__foot {
	padding-inline-end: 48px;
}

/* An eyebrow: several brands ship an icon-only logo, so the name stays in words. */
.dl-brand__name {
	margin: 0 0 10px;
	color: var(--cp-text);
	font-size: var(--cp-fs-sm);
	font-weight: 600;
	line-height: 1.4;
}

.dl-brand__intro {
	max-width: 22ch;
	margin: 0;
	color: var(--cp-ink);
	font-size: var(--cp-fs-5xl);
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: -0.015em;
	text-wrap: balance;
}

.dl-brand__foot {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin-top: auto;
	color: var(--cp-text);
	font-size: var(--cp-fs-xs);
}

.dl-main {
	display: flex;
	align-items: center;
	min-width: 0;
}

.dl-panel {
	width: 100%;
	padding: 40px;
	border: 1px solid var(--cp-line);
	border-radius: var(--cp-radius-lg);
	background-color: var(--cp-surface);
	box-shadow: var(--cp-shadow-panel);
}

/* ---------- portal sketch (decorative, aria-hidden: no text, numbers or claims) ---------- */

.dl-preview {
	position: relative;
	flex: 1 1 auto;
	min-height: 280px;
	max-height: 440px;
}

.dl-preview__window {
	position: absolute;
	inset: 0;
	display: grid;
	grid-template-columns: 150px minmax(0, 1fr);
	overflow: hidden;
	border: 1px solid var(--cp-line);
	border-inline-end: 0;
	border-start-start-radius: var(--cp-radius-lg);
	border-end-start-radius: var(--cp-radius-lg);
	background-color: var(--cp-surface);
	box-shadow: var(--cp-shadow-pop);
}

.dl-preview__side {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 18px 14px;
	border-inline-end: 1px solid var(--cp-line);
}

.dl-preview__mark,
.dl-preview__nav,
.dl-preview__title,
.dl-preview__card i,
.dl-preview__card b,
.dl-preview__row i,
.dl-preview__row em {
	display: block;
	border-radius: 4px;
}

.dl-preview__mark {
	width: 70%;
	height: 12px;
	margin-bottom: 10px;
	background-color: var(--cp-ink);
	opacity: 0.85;
}

.dl-preview__nav {
	height: 9px;
	background-color: var(--cp-line);
}

.dl-preview__nav--on {
	width: 80%;
	background-color: rgba(var(--cp-a-rgb), 0.9);
}

.dl-preview__nav--85 {
	width: 85%;
}

.dl-preview__nav--70 {
	width: 70%;
}

.dl-preview__nav--60 {
	width: 60%;
}

.dl-preview__body {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 18px 20px;
	background-color: var(--cp-ground-soft);
}

.dl-preview__title {
	width: 38%;
	height: 12px;
	background-color: var(--cp-ink);
	opacity: 0.8;
}

.dl-preview__cards {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
}

.dl-preview__card {
	display: flex;
	flex-direction: column;
	gap: 8px;
	height: 62px;
	padding: 12px;
	border: 1px solid var(--cp-line);
	border-radius: var(--cp-radius);
	background-color: var(--cp-surface);
}

.dl-preview__card i {
	width: 55%;
	height: 7px;
	background-color: var(--cp-line-strong);
}

.dl-preview__card b {
	width: 75%;
	height: 11px;
	background-color: var(--cp-ink);
	opacity: 0.7;
}

.dl-preview__card--on b {
	background-color: var(--cp-a);
	opacity: 1;
}

.dl-preview__rows {
	padding: 4px 14px;
	border: 1px solid var(--cp-line);
	border-radius: var(--cp-radius);
	background-color: var(--cp-surface);
}

.dl-preview__row {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr 70px;
	gap: 14px;
	align-items: center;
	height: 32px;
	border-bottom: 1px solid var(--cp-line);
}

.dl-preview__row:last-child {
	border-bottom: 0;
}

.dl-preview__row i {
	height: 7px;
	background-color: var(--cp-line-strong);
}

.dl-preview__row em {
	height: 18px;
	border-radius: 999px;
	background-color: rgba(var(--cp-a-rgb), 0.16);
}

/* Small desktops: the tile narrows to ~420px, so the sketch sheds its sidebar and third card. */
@media (min-width: 992px) and (max-width: 1199.98px) {
	.dl-layout {
		grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
		gap: 28px;
		padding: 28px;
	}

	.dl-brand {
		padding-block: 40px 32px;
		padding-inline-start: 36px;
	}

	.dl-brand__text,
	.dl-brand__foot {
		padding-inline-end: 36px;
	}

	.dl-brand__intro {
		font-size: var(--cp-fs-4xl);
	}

	.dl-preview__window {
		grid-template-columns: minmax(0, 1fr);
	}

	.dl-preview__side,
	.dl-preview__card:nth-child(3) {
		display: none;
	}

	.dl-preview__cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Phones/tablets: the tile dissolves (display: contents drops its background with it), rows hug their
   content, the logo sits above the panel and the © / legal links follow it at the very end. */
@media (max-width: 991.98px) {
	.dl-layout {
		grid-template-columns: minmax(0, 560px);
		justify-content: center;
		align-content: start;
		align-items: start;
		gap: 24px;
		min-height: 0;
		padding: 72px 20px 32px;
	}

	.dl-brand {
		display: contents;
	}

	.dl-brand__logo {
		order: 0;
	}

	.dl-brand__logo img {
		max-height: 36px;
	}

	.dl-brand__text,
	.dl-preview {
		display: none;
	}

	.dl-main {
		order: 1;
	}

	.dl-brand__foot {
		order: 2;
		justify-content: center;
		width: 100%;
		margin-top: 0;
		padding-inline-end: 0;
		color: var(--cp-muted);
		text-align: center;
	}
}

@media (max-width: 575.98px) {
	.dl-layout {
		padding: 64px 14px 24px;
	}

	.dl-panel {
		padding: 24px 18px;
	}
}

/* ---------- panel content ---------- */

.dl-head {
	margin-bottom: 28px;
}

.dl-title {
	margin: 0 0 6px;
	color: var(--cp-ink);
	font-size: var(--cp-fs-3xl);
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.01em;
}

.dl-sub {
	margin: 0;
	color: var(--cp-muted);
	font-size: var(--cp-fs-base);
	line-height: 1.55;
}

.dl-form .form-group {
	margin-bottom: 18px;
}

.dl-label {
	display: block;
	margin-bottom: 6px;
	color: var(--cp-ink);
	font-size: var(--cp-fs-sm);
	font-weight: 500;
}

.dl-login .form-control.dl-input {
	height: 44px;
	padding: 0 14px;
	border: 1px solid var(--cp-line-strong);
	border-radius: var(--cp-radius);
	background-color: var(--cp-surface);
	color: var(--cp-ink);
	font-size: var(--cp-fs-base);
	opacity: 1;
	box-shadow: none;
	transition: border-color 0.2s var(--cp-ease), box-shadow 0.2s var(--cp-ease);
}

.dl-login .form-control.dl-input::placeholder {
	color: var(--cp-placeholder) !important;
}

.dl-login .form-control.dl-input:hover {
	border-color: var(--cp-line-hover);
}

.dl-login .form-control.dl-input:focus {
	border-color: var(--cp-ink);
	box-shadow: 0 0 0 3px rgba(var(--cp-a-rgb), 0.22);
}

.dl-login .form-control.dl-input.is-invalid {
	border-color: var(--cp-bad-mark);
	background-image: none;
}

.dl-login .form-control.dl-input.is-invalid:focus {
	box-shadow: 0 0 0 3px var(--cp-bad-ring);
}

.dl-login .fv-plugins-message-container,
.dl-login .invalid-feedback {
	margin-top: 6px;
	color: var(--cp-bad);
	font-size: var(--cp-fs-xs);
}

.dl-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 16px;
}

.dl-grid--phone {
	grid-template-columns: 112px minmax(0, 1fr);
}

@media (max-width: 479.98px) {
	.dl-grid:not(.dl-grid--phone) {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Password field + show/hide toggle (guest.js toggles the input right before the toggle) */
.dl-pass {
	position: relative;
}

.dl-pass .form-control.dl-input {
	padding-inline-end: 48px;
}

.dl-login .dl-pass .toggle-password {
	position: absolute;
	top: 50%;
	right: auto;
	inset-inline-end: 4px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: var(--cp-radius);
	color: var(--cp-icon);
	cursor: pointer;
	transform: translateY(-50%);
	transition: background-color 0.2s var(--cp-ease), color 0.2s var(--cp-ease);
}

.dl-login .dl-pass .toggle-password i {
	color: inherit;
	font-size: var(--cp-fs-md);
}

.dl-login .dl-pass .toggle-password:hover {
	background-color: var(--cp-ground);
	color: var(--cp-ink);
}

/* select2 (country) */
.dl-login .select2-container {
	width: 100% !important;
}

.dl-login .select2-container--default .select2-selection--single,
.dl-login .select2-selection.select2-selection--single {
	display: flex;
	align-items: center;
	height: 44px;
	padding-block: 0;
	padding-inline: 14px 18px;
	border: 1px solid var(--cp-line-strong);
	border-radius: var(--cp-radius) !important;
	background-color: var(--cp-surface);
}

.dl-login .select2-container--default .select2-selection--single .select2-selection__rendered,
.dl-login .select2-container--default .select2-selection--single .select2-selection__placeholder {
	padding: 0;
	color: var(--cp-ink);
	font-size: var(--cp-fs-base);
	line-height: 1.4;
}

/* The value fills the row and truncates before the arrow. style.bundle makes it a flex box, which
   cannot ellipsize its text; there is no clear button (no allowClear) for that flex layout to place. */
.dl-login .select2-container--default .select2-selection--single .select2-selection__rendered {
	display: block;
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-align: start;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* style.bundle makes the arrow a static flex item, so the row's align-items centres it; an offset or
   transform here would push it off centre. Logical margins keep it ~21px in from the end in LTR and RTL,
   in line with the password field's eye. */
.dl-login .select2-container--default .select2-selection--single .select2-selection__arrow {
	height: 20px;
	margin: 0;
	margin-inline-start: 8px;
}

.dl-login .select2-container--default.select2-container--focus .select2-selection--single,
.dl-login .select2-container--default.select2-container--open .select2-selection--single {
	border-color: var(--cp-ink);
	box-shadow: 0 0 0 3px rgba(var(--cp-a-rgb), 0.22);
}

body.dl-page .select2-container--default .select2-dropdown {
	border: 1px solid var(--cp-line);
	border-radius: var(--cp-radius);
	box-shadow: var(--cp-shadow-pop);
}

body.dl-page .select2-results__option {
	border-radius: var(--cp-radius);
	font-size: var(--cp-fs-base);
}

body.dl-page .select2-container--default .select2-results__option--highlighted[aria-selected] {
	background-color: var(--cp-ground);
	color: var(--cp-ink);
}

body.dl-page .select2-container--default .select2-results__option[aria-selected="true"] {
	background-color: rgba(var(--cp-a-rgb), 0.12);
	color: var(--cp-ink);
}

/* ---------- checkboxes (consents, restore) ---------- */

.dl-consents {
	margin: 4px 0 6px;
	padding-top: 18px;
	border-top: 1px solid var(--cp-line);
}

.dl-consents .form-group {
	margin-bottom: 14px;
}

.dl-check {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	color: var(--cp-text);
	font-size: var(--cp-fs-sm);
	font-weight: 400;
	line-height: 1.55;
	cursor: pointer;
}

.dl-check input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.dl-check__box {
	position: relative;
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	margin-top: 1px;
	border: 1px solid var(--cp-line-hover);
	border-radius: var(--cp-radius);
	background-color: var(--cp-surface);
	transition: background-color 0.2s var(--cp-ease), border-color 0.2s var(--cp-ease);
}

.dl-check__box::after {
	position: absolute;
	top: 2px;
	left: 5.5px;
	width: 5px;
	height: 9px;
	border: solid var(--cp-on-a);
	border-width: 0 2px 2px 0;
	content: "";
	opacity: 0;
	transform: rotate(45deg);
}

.dl-check input:checked + .dl-check__box {
	border-color: var(--cp-a);
	background-color: var(--cp-a);
}

.dl-check input:checked + .dl-check__box::after {
	opacity: 1;
}

.dl-check input:focus-visible + .dl-check__box {
	box-shadow: var(--cp-ring);
}

.dl-check input.is-invalid + .dl-check__box,
.dl-check input[aria-invalid="true"] + .dl-check__box {
	border-color: var(--cp-bad-mark);
}

.dl-check__text a {
	white-space: nowrap;
}

/* ---------- links, rows, buttons ---------- */

.dl-login .dl-link {
	color: var(--cp-ink);
	font-weight: 500;
	text-decoration: underline;
	text-decoration-color: var(--cp-ink-a28);
	text-underline-offset: 3px;
	transition: text-decoration-color 0.2s var(--cp-ease);
}

.dl-login .dl-link:hover,
.dl-login .dl-link:focus {
	color: var(--cp-ink);
	text-decoration-color: currentColor;
}

.dl-link--strong {
	font-weight: 600;
}

.dl-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
	margin: -2px 0 22px;
	font-size: var(--cp-fs-sm);
}

.dl-secure {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--cp-muted);
	font-size: var(--cp-fs-xs);
}

.dl-secure svg {
	width: 14px;
	height: 14px;
}

.dl-login .btn.dl-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 46px;
	padding: 0 20px;
	border-radius: var(--cp-radius);
	font-size: var(--cp-fs-md);
	font-weight: 600;
	line-height: 1.2;
	opacity: 1;
	transition: filter 0.2s var(--cp-ease), background-color 0.2s var(--cp-ease), border-color 0.2s var(--cp-ease), transform 0.12s var(--cp-ease);
}

.dl-form > .btn.dl-btn--primary {
	width: 100%;
}

.dl-login .btn.dl-btn--primary,
.dl-login .btn.dl-btn--primary:hover,
.dl-login .btn.dl-btn--primary:focus,
.dl-login .btn.dl-btn--primary:disabled {
	border: 1px solid var(--cp-a);
	background-color: var(--cp-a);
	color: var(--cp-on-a);
}

.dl-login .btn.dl-btn--primary {
	box-shadow: 0 6px 16px rgba(var(--cp-a-rgb), 0.26);
}

.dl-login .btn.dl-btn--primary:hover:not(:disabled) {
	filter: brightness(0.95);
}

.dl-login .btn.dl-btn--secondary,
.dl-login .btn.dl-btn--secondary:hover,
.dl-login .btn.dl-btn--secondary:focus {
	border: 1px solid var(--cp-line-strong);
	background-color: var(--cp-surface);
	color: var(--cp-ink);
	box-shadow: none;
}

.dl-login .btn.dl-btn--secondary:hover {
	border-color: var(--cp-muted);
	background-color: var(--cp-ground);
	text-decoration: none;
}

.dl-login .btn.dl-btn:active:not(:disabled) {
	transform: translateY(1px);
}

.dl-login .btn.dl-btn:disabled {
	opacity: 0.7;
	cursor: progress;
}

.dl-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 8px;
}

.dl-actions .dl-btn--primary {
	flex: 1 1 200px;
}

.dl-actions .dl-btn--secondary {
	flex: 0 1 auto;
}

.dl-switch {
	margin: 24px 0 0;
	padding-top: 20px;
	border-top: 1px solid var(--cp-line);
	color: var(--cp-muted);
	font-size: var(--cp-fs-sm);
}

/* ---------- focus (the bundle forces outline:0 on links and buttons) ---------- */

.dl-login a:focus-visible,
.dl-login button:focus-visible,
.dl-login .toggle-password:focus-visible,
body.dl-page .guest-language-switcher .btn:focus-visible {
	outline: 0;
	box-shadow: var(--cp-ring) !important;
}

/* ---------- language switcher (guest layout, fixed top end) ---------- */

body.dl-page .guest-language-switcher .btn {
	display: inline-flex;
	align-items: center;
	height: 36px;
	padding: 0 12px;
	border: 1px solid var(--cp-line-strong);
	border-radius: var(--cp-radius);
	background-color: var(--cp-surface);
	color: var(--cp-ink);
	font-size: var(--cp-fs-sm);
	font-weight: 500;
	box-shadow: none;
}

body.dl-page .guest-language-switcher .btn:hover {
	background-color: var(--cp-ground);
}

body.dl-page .guest-language-switcher .dropdown-menu {
	padding: 6px;
	border: 1px solid var(--cp-line);
	border-radius: var(--cp-radius);
	box-shadow: var(--cp-shadow-pop);
}

body.dl-page .guest-language-switcher .dropdown-item {
	border-radius: var(--cp-radius);
	font-size: var(--cp-fs-sm);
}

body.dl-page .guest-language-switcher .dropdown-item.active {
	background-color: rgba(var(--cp-a-rgb), 0.12);
	color: var(--cp-ink);
}

/* ---------- SweetAlert2 (reset link sent / password updated) ---------- */

body.dl-page .swal2-popup {
	border-radius: var(--cp-radius-lg);
	font-family: inherit;
}

body.dl-page .swal2-popup .btn {
	min-height: 40px;
	padding: 0 18px;
	border: 1px solid var(--cp-a) !important;
	border-radius: var(--cp-radius);
	background: var(--cp-a) !important;
	color: var(--cp-on-a) !important;
	font-weight: 600;
	transition: filter 0.2s var(--cp-ease), transform 0.12s var(--cp-ease);
}

body.dl-page .swal2-popup .btn:hover {
	filter: brightness(0.95);
}

body.dl-page .swal2-popup .btn:active {
	transform: translateY(1px);
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
	.dl-login *,
	.dl-login *::before,
	.dl-login *::after,
	body.dl-page .swal2-popup .btn {
		animation: none !important;
		transition: none !important;
	}
}
