/*
 * Tadreep authentication UI styles.
 * RTL-first (the whole form is rendered with dir="rtl" in markup).
 * Mobile-first: base rules target small screens; a min-width breakpoint
 * widens the form for tablet/desktop rather than the reverse, per the
 * project's "mobile-first" requirement.
 * Uses CSS logical properties (margin-inline, padding-inline) instead of
 * left/right physical properties, so this same stylesheet works correctly
 * if a future page ever renders it in an LTR context without needing a
 * separate mirrored stylesheet (see the Eduma reference study's RTL
 * finding, section 16, for why this approach was chosen over a dual
 * rtl.css file).
 */

.tadreep-auth-form {
	font-family: 'Cairo', 'Tahoma', sans-serif;
	max-width: 100%;
	width: 100%;
	box-sizing: border-box;
	padding-inline: 1rem;
	padding-block: 1.5rem;
	margin-inline: auto;
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
}

@media (min-width: 640px) {
	.tadreep-auth-form {
		max-width: 420px;
		padding-inline: 2rem;
		padding-block: 2rem;
	}
}

.tadreep-auth-title {
	font-size: 1.25rem;
	font-weight: 700;
	margin-block-end: 1.25rem;
	color: #0f172a;
	text-align: center;
}

.tadreep-account-type-options {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

@media (min-width: 480px) {
	.tadreep-account-type-options {
		flex-direction: row;
	}
}

.tadreep-account-type-btn {
	flex: 1;
	padding-block: 0.85rem;
	padding-inline: 0.5rem;
	border: 2px solid #2563eb;
	border-radius: 10px;
	background: #ffffff;
	color: #2563eb;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.tadreep-account-type-btn:hover,
.tadreep-account-type-btn:focus-visible {
	background: #2563eb;
	color: #ffffff;
}

.tadreep-account-type-btn.is-selected {
	background: #2563eb;
	color: #ffffff;
}

.tadreep-step label {
	display: block;
	font-size: 0.9rem;
	font-weight: 600;
	color: #334155;
	margin-block: 0.75rem 0.35rem;
}

.tadreep-step input[type='text'],
.tadreep-step input[type='tel'],
.tadreep-step input[type='password'],
.tadreep-step textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 0.7rem 0.85rem;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	font-family: inherit;
	font-size: 1rem;
	background: #f8fafc;
}

.tadreep-step input:focus,
.tadreep-step textarea:focus {
	outline: 2px solid #2563eb;
	outline-offset: 1px;
	background: #ffffff;
}

.tadreep-step textarea {
	min-height: 5rem;
	resize: vertical;
}

.tadreep-btn-primary {
	width: 100%;
	margin-block-start: 1rem;
	padding-block: 0.85rem;
	border: none;
	border-radius: 8px;
	background: #2563eb;
	color: #ffffff;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
}

.tadreep-btn-primary:hover {
	background: #1d4ed8;
}

.tadreep-btn-primary:disabled {
	background: #94a3b8;
	cursor: not-allowed;
}

.tadreep-btn-link {
	display: block;
	width: 100%;
	margin-block-start: 0.6rem;
	padding-block: 0.4rem;
	border: none;
	background: none;
	color: #2563eb;
	font-family: inherit;
	font-size: 0.9rem;
	text-decoration: underline;
	cursor: pointer;
}

.tadreep-btn-link:disabled {
	color: #94a3b8;
	cursor: not-allowed;
	text-decoration: none;
}

.tadreep-error {
	color: #dc2626;
	font-size: 0.85rem;
	margin-block-start: 0.5rem;
}

.tadreep-success {
	color: #16a34a;
	font-size: 0.95rem;
	text-align: center;
	font-weight: 600;
}

.tadreep-auth-notice {
	font-family: 'Cairo', 'Tahoma', sans-serif;
	text-align: center;
	color: #334155;
}


/* Existing-account options shown before registration OTP is sent. */
.tadreep-existing-account-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-block-start: 0.75rem;
}
.tadreep-existing-account-actions a {
	min-block-size: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding-inline: 1rem;
	text-decoration: none;
}
@media (max-width: 479px) {
	.tadreep-existing-account-actions {
		flex-direction: column;
	}
}

.tadreep-login-brand {
	display: flex;
	justify-content: center;
	margin-bottom: 0.75rem;
}

.tadreep-login-brand-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 16px;
	background: #2563eb;
	color: #ffffff;
	font-size: 1.7rem;
	font-weight: 800;
}

.tadreep-auth-subtitle {
	margin: 0.45rem 0 1.5rem;
	color: #64748b;
	font-size: 0.92rem;
	line-height: 1.7;
	text-align: center;
}

.tadreep-field {
	margin-top: 1rem;
}

.tadreep-field label {
	margin: 0 0 0.45rem;
}

.tadreep-field input {
	background: #ffffff;
	min-height: 48px;
	border-radius: 10px;
}







/* -------------------------------------------------------------------------
 * Registration / password reset — consolidated rules.
 * One component definition, one responsive breakpoint. Avoids the legacy
 * cascade of repeated overrides that previously required !important.
 * ---------------------------------------------------------------------- */
#tadreep-register-root,
#tadreep-reset-root {
	width: min(calc(100% - 32px), 600px);
	margin: 40px auto;
	padding: 32px;
	box-sizing: border-box;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 22px;
	box-shadow: 0 18px 50px rgba(15,23,42,.09);
}

#tadreep-register-root .tadreep-auth-title,
#tadreep-reset-root h2 {
	margin: 0;
	text-align: center;
	font-size: 28px;
	line-height: 1.45;
	color: #08275e;
}

#tadreep-register-root .tadreep-auth-subtitle,
#tadreep-reset-root .tadreep-auth-subtitle {
	margin: 7px auto 24px;
	text-align: center;
	color: #64748b;
	font-size: 15px;
	line-height: 1.8;
}

#tadreep-register-root .tadreep-auth-brand,
#tadreep-reset-root .tadreep-auth-brand { display: none; }

#tadreep-register-root .tadreep-account-type-options {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 18px 0 0;
}

#tadreep-register-root .tadreep-account-type-btn {
	position: relative;
	inline-size: 100%;
	min-block-size: 74px;
	display: grid;
	grid-template-columns: 24px minmax(0,1fr) 24px;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	box-sizing: border-box;
	border: 1px solid #dbe3ee;
	border-radius: 12px;
	background: #fff;
	color: #0b2d68;
	text-align: start;
	font-family: inherit;
	cursor: pointer;
	transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

#tadreep-register-root .tadreep-account-type-btn:hover,
#tadreep-register-root .tadreep-account-type-btn:focus-visible {
	border-color: #9bb8ee;
	outline: none;
	transform: translateY(-1px);
}

#tadreep-register-root .tadreep-account-type-btn.is-active,
#tadreep-register-root .tadreep-account-type-btn[aria-pressed="true"] {
	border-color: #2563eb;
	background: #f7faff;
	box-shadow: 0 4px 14px rgba(37,99,235,.08);
}

#tadreep-register-root .tadreep-account-type-radio {
	inline-size: 19px;
	block-size: 19px;
	display: block;
	box-sizing: border-box;
	border: 1.7px solid #9aa7b8;
	border-radius: 50%;
	background: #fff;
}

#tadreep-register-root .tadreep-account-type-btn.is-active .tadreep-account-type-radio,
#tadreep-register-root .tadreep-account-type-btn[aria-pressed="true"] .tadreep-account-type-radio {
	border-color: #2563eb;
	box-shadow: inset 0 0 0 4px #fff;
	background: #2563eb;
}

#tadreep-register-root .tadreep-account-type-copy {
	min-inline-size: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

#tadreep-register-root .tadreep-account-type-label {
	display: block;
	font-size: 15px;
	font-weight: 800;
	line-height: 1.5;
	color: #08275e;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

#tadreep-register-root .tadreep-step[data-step="phone"],
#tadreep-register-root .tadreep-step[data-step="otp"],
#tadreep-register-root .tadreep-step[data-step="profile"],
#tadreep-reset-root .tadreep-auth-step {
	width: min(100%, 430px);
	margin-inline: auto;
}

#tadreep-register-root textarea {
	min-block-size: 100px;
	padding-block: 12px;
}

#tadreep-reset-root .tadreep-auth-step > * { max-inline-size: 100%; }

#tadreep-reset-root .tadreep-auth-step label {
	display: block;
	margin: 0 0 7px;
	font-weight: 700;
	line-height: 1.5;
}

#tadreep-reset-root .tadreep-auth-step input {
	display: block;
	inline-size: 100%;
	max-inline-size: none;
	box-sizing: border-box;
	min-block-size: 50px;
	margin: 0 0 14px;
	padding: 0 14px;
	border: 1px solid #cbd5e1;
	border-radius: 11px;
	background: #f8fafc;
	font-family: inherit;
	font-size: 16px;
	direction: rtl;
}

#tadreep-reset-root .tadreep-auth-step input:focus {
	border-color: #2563eb;
	outline: 3px solid rgba(37,99,235,.12);
	background: #fff;
}

#tadreep-reset-root .tadreep-btn {
	display: flex;
	inline-size: 100%;
	min-block-size: 50px;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	margin-block-start: 8px;
	border-radius: 11px;
	font-family: inherit;
	font-weight: 800;
}

#tadreep-reset-root .tadreep-btn-link {
	background: transparent;
	border: 0;
	box-shadow: none;
	color: #2563eb;
}

@media (min-width: 768px) {
	#tadreep-register-root,
	#tadreep-reset-root {
		width: min(calc(100% - 32px), 620px);
		padding: 34px 36px;
	}
}

@media (max-width: 767px) {
	#tadreep-register-root,
	#tadreep-reset-root {
		width: calc(100% - 24px);
		margin: 14px auto;
		padding: 20px 14px;
	}

	#tadreep-register-root .tadreep-account-type-btn {
		min-block-size: 68px;
		grid-template-columns: 22px minmax(0,1fr) 20px;
		padding: 10px 11px;
		gap: 10px;
	}

	#tadreep-register-root .tadreep-account-type-label { font-size: 14px; }
}


/* =====================================================================
 * LOGIN — single component. Replaces 62 previously conflicting rules.
 *
 * Earlier builds stacked new CSS on old CSS for the same elements: 11
 * rules on .tadreep-field, 9 on .tadreep-input-shell, 14 on input, 10 on
 * label, across 8 overlapping media queries. Competing `display` and
 * `min-height` declarations are why icons drifted below their field and
 * heights kept inflating.
 *
 * Written once, in one place, with NO !important. Nothing else in this
 * file targets these elements now, so the specificity war cannot resume.
 *
 * Markup (unchanged):
 *   .tadreep-field
 *     label                  above the control
 *     .tadreep-input-shell   flex row = the control itself
 *       .tadreep-field-icon  start edge
 *       input                flexes to fill
 *       .tadreep-field-toggle end edge (password only)
 * ================================================================== */

#tadreep-login-root {
	max-inline-size: 420px;
	margin-inline: auto;
	padding: 1.5rem 1.25rem;
	border-radius: 16px;
	background: #fff;
}

#tadreep-login-root .tadreep-auth-title {
	margin: 0 0 0.35rem;
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1.4;
	color: #0f172a;
	text-align: center;
}

#tadreep-login-root .tadreep-auth-subtitle {
	margin: 0 0 1.2rem;
	font-size: 0.875rem;
	line-height: 1.6;
	color: #64748b;
	text-align: center;
}

#tadreep-login-root .tadreep-field {
	margin-block-end: 0.75rem;
}

#tadreep-login-root .tadreep-field label {
	display: block;
	margin: 0 0 0.35rem;
	font-size: 0.8125rem;
	font-weight: 600;
	color: #475569;
	text-align: start;
	cursor: pointer;
}

/* The shell is the control: it carries the border, height and focus ring. */
#tadreep-login-root .tadreep-input-shell {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	inline-size: 100%;
	box-sizing: border-box;
	block-size: 48px;
	padding-inline: 0.75rem;
	border: 1px solid #dbe3ee;
	border-radius: 10px;
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#tadreep-login-root .tadreep-input-shell:focus-within {
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* The input has no chrome of its own - the shell provides it. */
#tadreep-login-root .tadreep-input-shell input {
	flex: 1 1 auto;
	min-inline-size: 0;
	inline-size: 100%;
	block-size: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	font-family: inherit;
	font-size: 16px; /* 16px stops iOS zooming the page on focus */
	color: #0f172a;
	text-align: start;
}

#tadreep-login-root .tadreep-input-shell input:focus {
	outline: 0;
	border: 0;
	box-shadow: none;
}

#tadreep-login-root .tadreep-input-shell input::placeholder {
	color: #a3aec0;
	font-size: 0.9375rem;
}

/* Phone digits stay left-to-right inside the RTL form. */
#tadreep-login-root .tadreep-input-shell input[type="tel"] {
	direction: ltr;
	text-align: start;
}

#tadreep-login-root .tadreep-field-icon {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	inline-size: 18px;
	block-size: 18px;
	color: #a3aec0;
	pointer-events: none;
}

#tadreep-login-root .tadreep-field-toggle {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	inline-size: 30px;
	block-size: 30px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: #a3aec0;
	cursor: pointer;
}

#tadreep-login-root .tadreep-field-toggle:hover,
#tadreep-login-root .tadreep-field-toggle[aria-pressed="true"] {
	color: #2563eb;
}

#tadreep-login-root .tadreep-field-toggle:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: 1px;
}

/* Caps any icon regardless of its own attributes. */
#tadreep-login-root svg {
	inline-size: 18px;
	block-size: 18px;
	flex: 0 0 auto;
}

#tadreep-login-root .tadreep-login-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-block: 0.6rem 0.9rem;
	font-size: 0.8125rem;
}

#tadreep-login-root .tadreep-check {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	inline-size: auto;
	margin: 0;
	font-weight: 500;
	color: #475569;
	cursor: pointer;
}

/* Small native checkbox - never stretched by an input rule. */
#tadreep-login-root .tadreep-check input[type="checkbox"] {
	flex: 0 0 auto;
	inline-size: 16px;
	block-size: 16px;
	min-inline-size: 16px;
	margin: 0;
	padding: 0;
	accent-color: #2563eb;
}

#tadreep-login-root .tadreep-login-row a {
	color: #2563eb;
	font-weight: 600;
	text-decoration: none;
}

#tadreep-login-root .tadreep-login-row a:hover {
	text-decoration: underline;
}

#tadreep-login-root .tadreep-login-submit {
	display: block;
	inline-size: 100%;
	box-sizing: border-box;
	block-size: 48px;
	margin: 0;
	padding: 0 1rem;
	border: 0;
	border-radius: 10px;
	background: #2563eb;
	color: #fff;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s ease;
}

#tadreep-login-root .tadreep-login-submit:hover {
	background: #1d4ed8;
}

#tadreep-login-root .tadreep-login-register {
	margin-block-start: 1rem;
	padding-block-start: 0.9rem;
	border-block-start: 1px solid #eef2f7;
	font-size: 0.8125rem;
	color: #64748b;
	text-align: center;
}

#tadreep-login-root .tadreep-login-register a {
	color: #2563eb;
	font-weight: 700;
	text-decoration: none;
}

@media (max-width: 480px) {
	#tadreep-login-root {
		padding: 1.25rem 1rem;
	}

	#tadreep-login-root .tadreep-auth-title {
		font-size: 1.2rem;
	}

	#tadreep-login-root .tadreep-input-shell {
		block-size: 46px;
	}

	#tadreep-login-root .tadreep-field {
		margin-block-end: 0.6rem;
	}
}

/* RC74: keep company/center name and business field clearly separated. */
.tadreep-auth-form .tadreep-field-help {
	display: block;
	margin: -2px 2px 10px;
	font-size: 12px;
	line-height: 1.7;
	color: #73819a;
}
