*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	background-color: #e4e2dc;
}

body {
	font-family: "Segoe UI", "Trebuchet MS", sans-serif;
	color: #2f2f2f;
	background-color: #e4e2dc;
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* ── Layout: panel + background ── */

.page-layout {
	display: flex;
	min-height: 100vh;
}

.sign-in-panel {
	width: 500px;
	min-height: 100vh;
	background: #e4e2dc;
	overflow-x: hidden;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	position: relative;
	z-index: 1;
}

.splash {
	position: fixed;
	right: 0;
	top: 0;
	width: calc(100% - 500px);
	height: 100%;
	background-image: url("https://cdn.tradeareasystems.net/Images/Rebrand2026/Background.png");
	background-size: cover;
	border-left: 1px solid #ccc;
	overflow: hidden;
	animation: fadeIn 1s;
}

.splash img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-left: 1px solid #ccc;
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

/* ── Panel sections ── */

.panel-header {
	margin: 20px 20px 20px 20px;
}

.logo {
	width: 150px;
	margin-inline-start: -10px;
}

.product-name {
	font-size: 22px;
	font-weight: 400;
	line-height: 1.4;
	color: #1a1a1a;
	margin: 8px 0 0 0;
}

.panel-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	margin: 5px 20px 20px 20px;
}

.panel-footer {
	margin-top: auto;
	width: 100%;
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 16px 20px;
	font-size: 0.9em;
}

/*
 * Keep footer text on a single line so we can measure real content width
 * and shrink to fit (see fitFooterText in app.js). Long translations such
 * as `Politique de confidentialité` or `Политика конфиденциальности` would
 * otherwise wrap into the copyright line above them.
 */
.panel-footer-left,
.panel-footer-right,
.panel-footer a {
	white-space: nowrap;
}

.panel-footer a {
	color: #000;
	font-size: 12px;
	font-weight: 400;
	letter-spacing: 0.25px;
	text-decoration: none;
	margin-left: 8px;
}

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

.panel-footer .panel-footer-left {
	text-align: left;
}

.panel-footer .panel-footer-right {
	text-align: right;
}

#app_version {
	font-size: 12px;
	margin-top: 5px;
}

/* ── Utility ── */

/*
 * Used in place of `style="display: none"` on initial page markup so the
 * CSP style-src directive can stay strict (no 'unsafe-inline').
 * `!important` ensures this utility wins over element-specific class rules
 * (e.g. `.button-container { display: flex }`) regardless of file order.
 * app.js toggles this class via `classList.add`/`classList.remove` for
 * show/hide instead of touching `element.style.display`.
 */
.is-hidden {
	display: none !important;
}

/* ── Banner ── */

.banner {
	/*background: #f7f6f4;*/
	background: #aa91f0;
	border: 1px solid #e1e1e1;
	border-radius: 3px;
	color: #fff;
	padding: 10px 16px;
	font-size: 12px;
	line-height: 1.5;
	margin-top: 16px;
	text-align: left;
}

.banner a,
.banner a:link,
.banner a:visited,
.banner a:active {
	color: #fff;
	text-decoration: none;
}

.banner a:hover,
.banner a:focus {
	text-decoration: underline;
}

/* ── Typography ── */

h1 {
	font-size: 26px;
	font-weight: 400;
	margin-bottom: 20px;
	color: #000;
}

.subtitle {
	color: #000;
	font-size: 14px;
	font-weight: 400;
	letter-spacing: 0.1px;
	margin-bottom: 7px;
	line-height: 1.5;
	text-align: left;
}

/* ── Form controls ── */

form {
	display: flex;
	flex-direction: column;
}

.form-group {
	padding-top: 8px;
	text-align: left;
}

label {
	display: block;
	font-size: 16px;
	margin-bottom: 5px;
	color: #000;
}

input[type="email"],
input[type="password"],
input[type="text"] {
	width: 458px;
	max-width: 100%;
	height: 50px;
	padding: 10px;
	font-size: 16px;
	font-family: "Segoe UI", "Trebuchet MS", sans-serif;
	border: 1px solid #000;
	border-radius: 3px;
	outline: none;
	color: #000;
	margin-top: 10px;
	margin-bottom: 20px;
	box-shadow: none;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
	outline: #000 solid 1px;
}

input::placeholder {
	color: #767676;
}

/* ── Buttons ── */

.button-container {
	display: flex;
	gap: 12px;
	max-width: 458px;
	margin-top: 2px;
	text-align: left;
}

button[type="submit"],
#forgot-ok-btn,
#reset-cancel-btn,
#forgot-cancel-btn {
	flex: 1;
	height: 59px;
	max-width: 100%;
	padding: 6px 12px;
	font-size: 15px;
	font-family: "Segoe UI", "Trebuchet MS", sans-serif;
	color: #2f2f2f;
	background-color: #33cb92;
	border: 0;
	border-radius: 3px;
	cursor: pointer;
	transition:
		background 0.2s,
		box-shadow 0.2s;
	user-select: none;
}

button[type="submit"]:hover,
#forgot-ok-btn:hover,
#reset-cancel-btn:hover,
#forgot-cancel-btn:hover {
	box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.25);
}

button[type="submit"]:focus,
#forgot-ok-btn:focus,
#reset-cancel-btn:focus,
#forgot-cancel-btn:focus {
	box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.25);
}

button[type="submit"]:disabled,
#forgot-ok-btn:disabled,
#reset-cancel-btn:disabled,
#forgot-cancel-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ── Requirements checklist ── */

.requirements {
	margin-bottom: 16px;
	padding: 14px 16px;
	background: #f7f6f4;
	border-radius: 3px;
	border: 1px solid #e1e1e1;
	text-align: left;
}

.requirements-title {
	font-size: 13px;
	font-weight: 700;
	margin-bottom: 8px;
	color: #565656;
}

.requirements ul {
	list-style: none;
	font-size: 12px;
	line-height: 1.8;
}

.requirements li {
	color: #898989;
	transition: color 0.15s;
}

.requirements li.met {
	color: #33cb92;
}

.requirements li.met .indicator {
	color: #33cb92;
}

.requirements li .indicator {
	display: inline-block;
	width: 18px;
	font-weight: bold;
	color: #a61e0c;
}

/* ── Messages ── */

.message {
	margin-top: 16px;
	margin-bottom: 16px;
	padding: 12px 16px;
	border-radius: 3px;
	font-size: 14px;
	line-height: 1.5;
	text-align: left;
}

.message.info {
	background: #e6f6fa;
	border: 1px solid #cdedf6;
	color: #2f2f2f;
}

.errors {
	margin-top: 16px;
	padding: 12px 16px;
	border-radius: 3px;
	font-size: 0.9em;
	font-weight: 700;
	color: #a61e0c;
	text-align: left;
}

.errors ul {
	margin: 0;
	padding-left: 20px;
}

.errors li {
	margin-bottom: 4px;
}

/* ── Success section ── */

#success-section {
	text-align: center;
}

.success-heading {
	color: #33cb92;
}

#success-section p {
	margin-top: 16px;
	font-size: 14px;
	color: #565656;
	line-height: 1.6;
}

#success-section a {
	color: #000;
	font-size: 14px;
	letter-spacing: 0.25px;
	text-decoration: none;
}

#success-section a:hover {
	text-decoration: underline;
}

/* ── Responsive ── */

/*
 * At <= 900px the splash image gets uncomfortably narrow (aerial photo
 * clipped to a tall strip), so we hide it and let the sign-in panel take
 * the full width. Covers both mobile and tablet-portrait.
 */
@media only screen and (max-width: 900px), (max-device-width: 900px) {
	.page-layout {
		flex-direction: column;
	}

	.sign-in-panel {
		width: 100%;
		min-height: 100vh;
		min-width: 220px;
		margin: 0;
		overflow: visible;
	}

	.splash {
		display: none;
	}

	input[type="email"],
	input[type="password"],
	input[type="text"] {
		width: 100% !important;
	}

	.button-container {
		max-width: 100%;
	}
}

/*
 * At very narrow widths (small phones in portrait), stack the footer
 * vertically instead of shrinking the links into unreadability.
 */
@media only screen and (max-width: 420px) {
	.panel-footer {
		flex-direction: column;
		gap: 6px;
		align-items: flex-start;
	}

	.panel-footer a {
		margin-left: 0;
		margin-right: 12px;
	}
}

/* ── RTL (Arabic) ── */

/*
 * With `direction: rtl` inherited from <html dir="rtl">, the default
 * `flex-direction: row` already runs right-to-left, so the sign-in
 * panel is placed at the visual right edge. Adding `row-reverse` on
 * top of that would flip *back* to left-to-right — the exact bug this
 * comment is here to prevent from being reintroduced.
 */
[dir="rtl"] .sign-in-panel {
	direction: rtl;
}

[dir="rtl"] .splash {
	right: auto;
	left: 0;
	border-left: none;
	border-right: 1px solid #ccc;
}

[dir="rtl"] .banner,
[dir="rtl"] .subtitle,
[dir="rtl"] .form-group,
[dir="rtl"] .requirements,
[dir="rtl"] .message,
[dir="rtl"] .errors,
[dir="rtl"] .button-container {
	text-align: right;
}

[dir="rtl"] .subtitle {
	margin-left: 0;
	margin-right: 5px;
}

[dir="rtl"] .panel-footer a {
	margin-left: 0;
	margin-right: 8px;
}

[dir="rtl"] .errors ul {
	padding-left: 0;
	padding-right: 20px;
}
