/**
 * tasfiya/auth.php — تسجيل دخول وإنشاء حساب (Mobile-first)
 */
:root {
	--auth-red: #e62117;
	--auth-red-dark: #c41c13;
	--auth-bg: #fcf8f9;
	--auth-surface: rgba(255, 254, 254, 0.98);
	--auth-text: #1a1a1a;
	--auth-muted: #6b7280;
	--auth-radius: 16px;
	--auth-shadow: 0 12px 28px rgba(17, 24, 39, 0.08);
	--auth-font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}

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

html {
	font-size: 14px;
}

body.auth-page {
	margin: 0;
	min-height: 100vh;
	font-family: var(--auth-font);
	background:
		radial-gradient(circle at top right, rgba(230, 33, 23, 0.05), transparent 0 28%),
		linear-gradient(180deg, #fcf8f9 0%, #f8f2f5 100%);
	color: var(--auth-text);
	line-height: 1.5;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	padding: 1rem 0.85rem 1.4rem;
}

.auth-langbar {
	width: 100%;
	max-width: 400px;
	display: flex;
	justify-content: center;
	gap: 0.45rem;
	margin-bottom: 0.7rem;
}

.auth-langbtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.5rem 0.8rem;
	border-radius: 999px;
	border: 1px solid rgba(17, 24, 39, 0.08);
	background: rgba(247, 243, 245, 0.92);
	color: var(--auth-text);
	text-decoration: none;
	font-size: 0.8rem;
	font-weight: 700;
}

.auth-langbtn.is-active {
	background: linear-gradient(135deg, rgba(225, 29, 72, 0.12), rgba(225, 29, 72, 0.04));
	border-color: rgba(225, 29, 72, 0.2);
	color: var(--auth-red);
}

.auth-card {
	width: 100%;
	max-width: 400px;
	background: var(--auth-surface);
	backdrop-filter: blur(10px);
	border-radius: var(--auth-radius);
	box-shadow: var(--auth-shadow);
	padding: 1.25rem 1.1rem 1.4rem;
	border: 1px solid rgba(17, 24, 39, 0.06);
}

.auth-title {
	margin: 0 0 0.2rem;
	font-size: 1.2rem;
	font-weight: 800;
	color: var(--auth-red);
	text-align: center;
}

.auth-sub {
	margin: 0 0 1rem;
	font-size: 0.8rem;
	color: var(--auth-muted);
	text-align: center;
}

.auth-tabs {
	display: flex;
	gap: 0.35rem;
	margin-bottom: 1rem;
	padding: 0.2rem;
	background: #f3f4f6;
	border-radius: 12px;
}

.auth-tab {
	flex: 1;
	border: none;
	padding: 0.58rem 0.45rem;
	font: inherit;
	font-weight: 700;
	font-size: 0.85rem;
	border-radius: 10px;
	cursor: pointer;
	background: transparent;
	color: var(--auth-muted);
	transition: background 0.15s ease, color 0.15s ease;
}

.auth-tab.is-active {
	background: #fff;
	color: var(--auth-red);
	box-shadow: 0 2px 8px rgba(225, 29, 72, 0.12);
}

.auth-panel {
	display: none;
}

.auth-panel.is-active {
	display: block;
}

.auth-field {
	margin-bottom: 0.75rem;
}

.auth-field label {
	display: block;
	font-size: 0.78rem;
	font-weight: 700;
	margin-bottom: 0.3rem;
	color: var(--auth-text);
}

.auth-field input {
	width: 100%;
	padding: 0.68rem 0.82rem;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	font: inherit;
	background: #fff;
	transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.auth-field input:focus {
	outline: none;
	border-color: var(--auth-red);
	background: #fff;
	box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.12);
}

.auth-btn {
	width: 100%;
	margin-top: 0.45rem;
	padding: 0.72rem 0.95rem;
	border: none;
	border-radius: 12px;
	font: inherit;
	font-weight: 800;
	font-size: 0.9rem;
	cursor: pointer;
	background: linear-gradient(135deg, var(--auth-red), var(--auth-red-dark));
	color: #fff;
	box-shadow: 0 8px 18px rgba(225, 29, 72, 0.24);
	transition: background 0.15s, transform 0.1s;
}

.auth-btn:hover {
	background: linear-gradient(135deg, var(--auth-red-dark), #9f1239);
}

.auth-btn:active {
	transform: scale(0.98);
}

.auth-msg {
	padding: 0.65rem 0.85rem;
	border-radius: 12px;
	font-size: 0.85rem;
	margin-bottom: 1rem;
	text-align: center;
}

.auth-msg--err {
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}

.auth-msg--ok {
	background: #ecfdf5;
	color: #047857;
	border: 1px solid #a7f3d0;
}

.auth-link {
	display: block;
	text-align: center;
	margin-top: 1rem;
	font-size: 0.85rem;
}

.auth-link a {
	color: var(--auth-red);
	font-weight: 600;
	text-decoration: none;
}

.auth-link a:hover {
	text-decoration: underline;
}

.auth-site-footer {
	display: none !important;
}

.auth-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* كابتشا Dolibarr داخل نموذج تسجيل الدخول */
.tasfiya-login-captcha {
	margin-top: 0.5rem;
	margin-bottom: 0.25rem;
}

.tasfiya-login-captcha .trinputlogin,
.tasfiya-login-captcha .tdinputlogin {
	display: block;
	width: 100%;
}

.tasfiya-login-captcha .input-icon-security,
.tasfiya-login-captcha input[name="code"] {
	max-width: 100%;
}

/* ========================================================================= */
/* ACCOUNT TYPE PICKER */
/* ========================================================================= */

.auth-role-picker {
	display: flex;
	gap: 0.45rem;
	margin-top: 0.2rem;
}

.auth-role-option {
	flex: 1;
	cursor: pointer;
	position: relative;
}

.auth-role-option input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.auth-role-label {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 0.65rem;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	background: #fff;
	transition: all 0.2s ease;
	gap: 0.2rem;
}

.auth-role-icon {
	font-size: 1.25rem;
}

.auth-role-text {
	font-weight: 700;
	font-size: 0.8rem;
	color: var(--auth-muted);
}

.auth-role-option input[type="radio"]:checked + .auth-role-label {
	border-color: var(--auth-red);
	background: #fffcfc;
	box-shadow: 0 6px 14px rgba(225, 29, 72, 0.1);
}

.auth-role-option input[type="radio"]:checked + .auth-role-label .auth-role-text {
	color: var(--auth-red);
}

.auth-role-option input[type="radio"]:focus-visible + .auth-role-label {
	outline: 2px solid var(--auth-red);
	outline-offset: 2px;
}
