/**
 * نموذج «انضم كتاجر» — ستايل بهوية سوق رؤية (RTL أولًا)
 * المرجع: docs/brand/BRAND.md — النص فوق التركواز دائمًا «ليل عميق»، المرجان للتأكيد فقط.
 *
 * Copyright © 2026 Roeia — roeia.com
 */

@font-face {
	font-family: 'Plex Arabic';
	src: url('../fonts/plex-arabic-400.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Plex Arabic';
	src: url('../fonts/plex-arabic-700.woff2') format('woff2');
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

.roeia-register {
	--roeia-night: #0E1B2C;
	--roeia-night-2: #16273C;
	--roeia-teal: #0CC0AE;
	--roeia-teal-dark: #0AA396;
	--roeia-teal-bright: #3FDCCB; /* تركواز مضيء للنص فوق الليل الداكن فقط */
	--roeia-coral: #FF6B57;
	--roeia-cloud: #F4F9F8;
	--roeia-mist: #8FA8B5;
	--roeia-stone: #5B6B74;
	--roeia-hairline: rgba(14, 27, 44, 0.09);
	--roeia-danger: #C23B3B;
	--roeia-amber: #B97A1E;

	--roeia-ease: cubic-bezier(0.22, 1, 0.36, 1);

	max-width: 1180px;
	margin: 8px auto 64px;
	direction: rtl;
	text-align: right;
	font-family: 'Plex Arabic', "Segoe UI", Tahoma, sans-serif;
	color: var(--roeia-night);
	font-variant-numeric: tabular-nums;
}

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

/* ============================================================
   البطاقة الكبرى — لوح القيمة (ليل) + لوح النموذج (أبيض)
   ============================================================ */
.roeia-register__card {
	display: grid;
	grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
	background: #fff;
	border-radius: 20px;
	overflow: hidden;
	box-shadow:
		0 1px 2px rgba(14, 27, 44, 0.05),
		0 28px 64px -28px rgba(14, 27, 44, 0.28);
}

/* ---------- اللوح الجانبي: بوابة التجّار ---------- */
.roeia-register__aside {
	position: relative;
	background:
		radial-gradient(120% 70% at 85% -10%, rgba(12, 192, 174, 0.18), transparent 58%),
		radial-gradient(90% 50% at 10% 110%, rgba(255, 107, 87, 0.10), transparent 60%),
		var(--roeia-night);
	color: var(--roeia-cloud);
	overflow: hidden;
}

/* قوس ضخم خافت — النمط البصري للبوابة */
.roeia-register__aside::before {
	content: "";
	position: absolute;
	inset-inline-end: -150px;
	top: 110px;
	width: 470px;
	height: 720px;
	border: 1.5px solid rgba(63, 220, 203, 0.10);
	border-bottom: none;
	border-radius: 235px 235px 0 0;
	pointer-events: none;
}

.roeia-aside__inner {
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: 100%;
	padding: 48px 44px 36px;
}

.roeia-aside__mark {
	display: inline-flex;
	width: 52px;
	margin-bottom: 28px;
}

.roeia-aside__mark svg {
	width: 100%;
	height: auto;
	display: block;
}

.roeia-aside__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	align-self: flex-start;
	margin: 0 0 14px;
	padding: 5px 14px;
	font-size: 12.5px;
	font-weight: 700;
	color: var(--roeia-teal-bright);
	background: rgba(12, 192, 174, 0.12);
	border: 1px solid rgba(12, 192, 174, 0.30);
	border-radius: 999px;
}

.roeia-aside__eyebrow::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--roeia-coral);
}

.roeia-register__title {
	margin: 0 0 12px;
	font-size: 34px;
	font-weight: 700;
	line-height: 1.45;
	color: #fff;
	text-wrap: balance;
}

.roeia-register__subtitle {
	margin: 0 0 30px;
	font-size: 15px;
	line-height: 1.9;
	color: var(--roeia-mist);
	max-width: 40ch;
}

/* شريط الثقة — يتوسّط المساحة المتبقية من اللوح */
.roeia-trust {
	list-style: none;
	margin: auto 0 0;
	padding: 30px 0 0;
	border-top: 1px solid rgba(244, 249, 248, 0.10);
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.roeia-trust__item {
	display: flex;
	align-items: flex-start;
	gap: 14px;
}

.roeia-trust__icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 12px;
	background: rgba(12, 192, 174, 0.12);
	border: 1px solid rgba(12, 192, 174, 0.22);
	color: var(--roeia-teal-bright);
}

.roeia-trust__icon svg {
	width: 21px;
	height: 21px;
}

.roeia-trust__copy {
	display: block;
}

.roeia-trust__copy strong {
	display: block;
	font-size: 15px;
	font-weight: 700;
	color: var(--roeia-cloud);
	margin-bottom: 2px;
}

.roeia-trust__copy span {
	display: block;
	font-size: 13px;
	line-height: 1.8;
	color: var(--roeia-mist);
}

/* صف البوابات — بوابة واحدة مضيئة بالمرجان */
.roeia-aside__gates {
	margin-top: auto;
	padding-top: 36px;
}

.roeia-aside__gates svg {
	display: block;
	width: 100%;
	max-width: 252px;
	height: auto;
	opacity: 0.9;
}

/* ---------- لوح النموذج ---------- */
.roeia-register__main {
	padding: 44px 48px 36px;
	min-width: 0;
}

/* ============================================================
   أقسام النموذج — ترقيم تلقائي بعدّاد CSS
   ============================================================ */
.roeia-register__form {
	counter-reset: roeia-sec;
}

.roeia-section {
	counter-increment: roeia-sec;
	border: none;
	margin: 0 0 8px;
	padding: 0 0 26px;
	min-width: 0;
}

.roeia-section__legend {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 0;
	margin-bottom: 20px;
	font-size: 16.5px;
	font-weight: 700;
	color: var(--roeia-night);
}

.roeia-section__legend::before {
	content: "٠" counter(roeia-sec, arabic-indic);
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 30px;
	height: 30px;
	padding: 0 4px;
	font-size: 13px;
	font-weight: 700;
	color: var(--roeia-teal-dark);
	background: rgba(12, 192, 174, 0.10);
	border: 1px solid rgba(12, 192, 174, 0.28);
	border-radius: 9px;
}

.roeia-section__legend::after {
	content: "";
	flex: 1 1 auto;
	height: 1px;
	background: var(--roeia-hairline);
	margin-inline-start: 4px;
}

/* ============================================================
   الحقول
   ============================================================ */
.roeia-register__form .roeia-field {
	margin-bottom: 18px;
	min-width: 0;
}

.roeia-register__form .roeia-section > .roeia-field:last-child,
.roeia-register__form .roeia-grid .roeia-field {
	margin-bottom: 0;
}

.roeia-register .roeia-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px 16px;
	margin-bottom: 18px;
}

.roeia-register .roeia-section > .roeia-grid:last-child {
	margin-bottom: 0;
}

.roeia-register label {
	display: block;
	margin-bottom: 7px;
	font-size: 13.5px;
	font-weight: 700;
	color: var(--roeia-night);
}

.roeia-register .roeia-req {
	color: var(--roeia-coral);
}

.roeia-register input[type="text"],
.roeia-register input[type="email"],
.roeia-register input[type="password"],
.roeia-register input[type="tel"],
.roeia-register select,
.roeia-register textarea {
	display: block;
	width: 100%;
	padding: 12px 14px;
	font-size: 15px;
	font-family: inherit;
	line-height: 1.6;
	color: var(--roeia-night);
	background: #FAFCFC;
	border: 1px solid rgba(14, 27, 44, 0.14);
	border-radius: 10px;
	transition:
		border-color 0.18s var(--roeia-ease),
		box-shadow 0.18s var(--roeia-ease),
		background-color 0.18s var(--roeia-ease);
}

.roeia-register input::placeholder,
.roeia-register textarea::placeholder {
	color: var(--roeia-stone);
	opacity: 1;
}

.roeia-register input:hover,
.roeia-register select:hover,
.roeia-register textarea:hover {
	border-color: rgba(14, 27, 44, 0.28);
}

.roeia-register input:focus,
.roeia-register select:focus,
.roeia-register textarea:focus {
	outline: none;
	border-color: var(--roeia-teal);
	box-shadow: 0 0 0 3px rgba(12, 192, 174, 0.20);
	background: #fff;
}

.roeia-register textarea {
	resize: vertical;
	min-height: 92px;
}

/* القائمة المنسدلة — سهم مخصص جهة اليسار (RTL) */
.roeia-register select {
	appearance: none;
	-webkit-appearance: none;
	padding-inline-start: 38px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9.5 L12 15.5 L18 9.5' stroke='%235B6B74' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: left 14px center;
	background-size: 16px;
	cursor: pointer;
}

/* ============================================================
   منطقة رفع مستندات التوثيق
   ============================================================ */
.roeia-upload {
	position: relative;
	padding: 30px 22px 26px;
	text-align: center;
	background: var(--roeia-cloud);
	border: 1.5px dashed rgba(12, 192, 174, 0.55);
	border-radius: 14px;
	transition:
		border-color 0.2s var(--roeia-ease),
		background-color 0.2s var(--roeia-ease),
		box-shadow 0.2s var(--roeia-ease);
}

.roeia-upload:hover,
.roeia-upload:focus-within,
.roeia-upload.is-dragover {
	border-color: var(--roeia-teal);
	background: #EDFAF8;
}

.roeia-upload:focus-within {
	box-shadow: 0 0 0 3px rgba(12, 192, 174, 0.20);
}

.roeia-upload__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin-bottom: 12px;
	border-radius: 50%;
	background: #fff;
	border: 1px solid rgba(12, 192, 174, 0.30);
	color: var(--roeia-teal-dark);
	transition: transform 0.25s var(--roeia-ease);
}

.roeia-upload:hover .roeia-upload__icon,
.roeia-upload.is-dragover .roeia-upload__icon {
	transform: translateY(-3px);
}

.roeia-upload__icon svg {
	width: 25px;
	height: 25px;
}

.roeia-upload__title {
	margin: 0 0 4px;
	font-size: 15px;
	font-weight: 700;
	color: var(--roeia-night);
}

.roeia-upload__meta {
	margin: 0;
	font-size: 13px;
	line-height: 1.8;
	color: var(--roeia-stone);
}

.roeia-upload__files {
	display: none;
	margin: 12px auto 0;
	padding: 7px 14px;
	max-width: 100%;
	font-size: 13px;
	font-weight: 700;
	color: var(--roeia-teal-dark);
	background: rgba(12, 192, 174, 0.12);
	border: 1px solid rgba(12, 192, 174, 0.30);
	border-radius: 999px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.roeia-upload__files.has-files {
	display: inline-block;
}

/* حقل الملفات يغطي المنطقة كلها — يبقى فعّالًا بالكامل */
.roeia-register .roeia-upload input[type="file"] {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.roeia-register .roeia-hint {
	margin: 6px 0 0;
	font-size: 13px;
	color: var(--roeia-stone);
}

/* ============================================================
   الشروط والإرسال
   ============================================================ */
.roeia-register .roeia-field--terms {
	margin: 4px 0 22px;
	padding: 14px 16px;
	background: var(--roeia-cloud);
	border: 1px solid var(--roeia-hairline);
	border-radius: 12px;
}

.roeia-register .roeia-check {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 0;
	font-weight: 400;
	font-size: 14px;
	line-height: 1.8;
	color: var(--roeia-night);
	cursor: pointer;
}

.roeia-register .roeia-check input[type="checkbox"] {
	margin-top: 3px;
	width: 19px;
	height: 19px;
	flex: 0 0 auto;
	accent-color: var(--roeia-teal);
	cursor: pointer;
}

.roeia-register .roeia-check input[type="checkbox"]:focus-visible {
	outline: 2px solid var(--roeia-teal-dark);
	outline-offset: 2px;
	border-radius: 4px;
}

/* الأزرار — النص فوق التركواز «ليل عميق» دائمًا، ليس أبيض */
.roeia-register .roeia-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 14px 28px;
	font-size: 16px;
	font-weight: 700;
	font-family: inherit;
	line-height: 1;
	border: none;
	border-radius: 12px;
	cursor: pointer;
	text-decoration: none;
	transition:
		background-color 0.2s var(--roeia-ease),
		transform 0.2s var(--roeia-ease),
		box-shadow 0.2s var(--roeia-ease);
}

.roeia-register .roeia-btn--primary {
	background: var(--roeia-teal);
	color: var(--roeia-night);
	box-shadow: 0 6px 14px -6px rgba(12, 192, 174, 0.65);
}

.roeia-register .roeia-btn--primary:hover,
.roeia-register .roeia-btn--primary:focus {
	background: var(--roeia-teal-dark);
	color: var(--roeia-night);
	transform: translateY(-1px);
	box-shadow: 0 8px 18px -6px rgba(12, 192, 174, 0.75);
}

.roeia-register .roeia-btn:active {
	transform: translateY(0) scale(0.985);
}

.roeia-register .roeia-btn:focus-visible {
	outline: 2px solid var(--roeia-night);
	outline-offset: 3px;
}

.roeia-register .roeia-btn__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	margin-inline-end: -8px;
	border-radius: 50%;
	background: rgba(14, 27, 44, 0.14);
	transition: transform 0.25s var(--roeia-ease);
}

.roeia-register .roeia-btn__icon svg {
	width: 15px;
	height: 15px;
}

.roeia-register .roeia-btn--primary:hover .roeia-btn__icon {
	transform: translateX(-3px);
}

.roeia-register .roeia-field--submit {
	margin-top: 2px;
	margin-bottom: 0;
}

.roeia-register .roeia-field--submit .roeia-btn {
	width: 100%;
}

/* سطر الخصوصية */
.roeia-register__footnote {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 18px 0 0;
	font-size: 12.5px;
	color: var(--roeia-stone);
}

.roeia-register__footnote svg {
	flex: 0 0 auto;
	width: 15px;
	height: 15px;
}

/* ============================================================
   التنبيهات — ألوان الحالات منفصلة عن ألوان الهوية
   ============================================================ */
.roeia-register .roeia-notice {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 15px 16px;
	margin-bottom: 22px;
	border-radius: 12px;
	font-size: 14px;
	line-height: 1.8;
	border: 1px solid transparent;
	color: var(--roeia-night);
}

.roeia-register .roeia-notice__icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 10px;
}

.roeia-register .roeia-notice__icon svg {
	width: 18px;
	height: 18px;
}

.roeia-register .roeia-notice__body {
	min-width: 0;
	padding-top: 4px;
}

.roeia-register .roeia-notice p {
	margin: 0 0 6px;
}

.roeia-register .roeia-notice p:last-child {
	margin-bottom: 0;
}

.roeia-register .roeia-notice ul {
	margin: 6px 0 0;
	padding: 0;
	padding-inline-start: 18px;
	list-style: disc;
}

.roeia-register .roeia-notice--success {
	background: rgba(12, 192, 174, 0.08);
	border-color: rgba(12, 192, 174, 0.30);
}

.roeia-register .roeia-notice--success .roeia-notice__icon {
	background: rgba(12, 192, 174, 0.14);
	color: var(--roeia-teal-dark);
}

.roeia-register .roeia-notice--error {
	background: rgba(214, 69, 69, 0.06);
	border-color: rgba(214, 69, 69, 0.28);
}

.roeia-register .roeia-notice--error .roeia-notice__icon {
	background: rgba(214, 69, 69, 0.10);
	color: var(--roeia-danger);
}

.roeia-register .roeia-notice--warning {
	background: rgba(233, 162, 59, 0.09);
	border-color: rgba(233, 162, 59, 0.32);
}

.roeia-register .roeia-notice--warning .roeia-notice__icon {
	background: rgba(233, 162, 59, 0.14);
	color: var(--roeia-amber);
}

.roeia-register .roeia-notice--info {
	background: rgba(143, 168, 181, 0.10);
	border-color: rgba(143, 168, 181, 0.38);
}

.roeia-register .roeia-notice--info .roeia-notice__icon {
	background: rgba(143, 168, 181, 0.16);
	color: var(--roeia-stone);
}

/* ============================================================
   حالة النجاح — لحظة الاحتفاء
   ============================================================ */
.roeia-success {
	max-width: 620px;
	margin: 0 auto;
	padding: 60px 40px 56px;
	text-align: center;
	background: #fff;
	border-radius: 20px;
	box-shadow:
		0 1px 2px rgba(14, 27, 44, 0.05),
		0 28px 64px -28px rgba(14, 27, 44, 0.28);
}

.roeia-success__mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 108px;
	height: 108px;
	margin-bottom: 22px;
	border-radius: 50%;
	background:
		radial-gradient(80% 80% at 50% 20%, rgba(12, 192, 174, 0.14), transparent 70%),
		var(--roeia-cloud);
	border: 1px solid rgba(12, 192, 174, 0.30);
}

.roeia-success__mark svg {
	width: 58px;
	height: 58px;
}

.roeia-success__title {
	margin: 0 0 10px;
	font-size: 26px;
	font-weight: 700;
	color: var(--roeia-night);
}

.roeia-success__text {
	margin: 0 auto;
	max-width: 44ch;
	font-size: 15px;
	line-height: 1.9;
	color: var(--roeia-stone);
}

/* ============================================================
   Honeypot — مخفي عن البشر ومقروء للروبوتات
   ============================================================ */
.roeia-register .roeia-hp {
	position: absolute !important;
	inset-inline-end: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
	opacity: 0;
}

/* ============================================================
   حركة الدخول — فقط لمن لا يفضّل تقليل الحركة
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {

	.roeia-register__card,
	.roeia-success {
		animation: roeia-rise 0.65s var(--roeia-ease) both;
	}

	.roeia-trust__item {
		animation: roeia-rise 0.6s var(--roeia-ease) both;
	}

	.roeia-trust__item:nth-child(1) { animation-delay: 0.12s; }
	.roeia-trust__item:nth-child(2) { animation-delay: 0.2s; }
	.roeia-trust__item:nth-child(3) { animation-delay: 0.28s; }

	.roeia-success__mark {
		animation: roeia-pop 0.55s 0.15s var(--roeia-ease) both;
	}

	.roeia-success__mark path:last-child {
		stroke-dasharray: 42;
		stroke-dashoffset: 42;
		animation: roeia-draw 0.5s 0.55s var(--roeia-ease) forwards;
	}

	@keyframes roeia-rise {
		from {
			opacity: 0;
			transform: translateY(16px);
		}
		to {
			opacity: 1;
			transform: translateY(0);
		}
	}

	@keyframes roeia-pop {
		from {
			opacity: 0;
			transform: scale(0.85);
		}
		to {
			opacity: 1;
			transform: scale(1);
		}
	}

	@keyframes roeia-draw {
		to {
			stroke-dashoffset: 0;
		}
	}
}

@media (prefers-reduced-motion: reduce) {
	.roeia-register *,
	.roeia-register *::before,
	.roeia-register *::after {
		transition: none !important;
		animation: none !important;
	}
}

/* ============================================================
   الاستجابة
   ============================================================ */
@media (max-width: 960px) {
	.roeia-register__card {
		grid-template-columns: 1fr;
	}

	.roeia-aside__inner {
		padding: 36px 28px 24px;
	}

	.roeia-register__title {
		font-size: 26px;
	}

	.roeia-trust {
		margin-top: 26px;
		padding-top: 22px;
		gap: 16px;
	}

	.roeia-aside__gates {
		padding-top: 26px;
	}

	.roeia-aside__gates svg {
		max-width: 200px;
	}

	.roeia-register__main {
		padding: 32px 26px 28px;
	}
}

@media (max-width: 600px) {
	.roeia-register {
		margin-block: 0 40px;
	}

	.roeia-register .roeia-grid {
		grid-template-columns: 1fr;
	}

	.roeia-register__card,
	.roeia-success {
		border-radius: 16px;
	}

	.roeia-aside__inner {
		padding: 30px 22px 20px;
	}

	.roeia-register__main {
		padding: 26px 18px 24px;
	}

	.roeia-register__footnote {
		align-items: flex-start;
		text-align: right;
	}

	.roeia-register__footnote svg {
		margin-top: 3px;
	}

	.roeia-success {
		padding: 44px 24px 40px;
	}
}
