/**
 * Login form and login gate.
 *
 * Everything is scoped under .roghan-auth / .roghan-lock and sets its own
 * font stack and box-sizing, because themes vary wildly and this form has
 * to look the same on all of them.
 */

.roghan-auth,
.roghan-lock {
	--roghan-auth-main: #183661;
	--roghan-auth-accent: #f08c1e;
	--roghan-auth-radius: 10px;
	--roghan-auth-border: #d9dee7;
	--roghan-auth-muted: #6b7280;
	--roghan-auth-error: #dc2626;

	box-sizing: border-box;
	direction: rtl;
	font-family: "IRANYekanXFaNum", "IRANSans", "Vazirmatn", inherit, sans-serif;
	text-align: center;
}

.roghan-auth *,
.roghan-lock * {
	box-sizing: border-box;
}

/* ---------- login form ---------- */

.roghan-auth {
	max-width: 420px;
	margin: 0 auto;
	padding: 8px;
}

.roghan-auth__logo {
	margin-bottom: 26px;
}

.roghan-auth__logo img {
	display: block;
	width: auto;
	max-width: 120px;
	height: auto;
	margin: 0 auto;
}

.roghan-auth__step {
	position: relative;
}

.roghan-auth__step[hidden] {
	display: none;
}

.roghan-auth__title {
	margin: 0 0 8px;
	color: var(--roghan-auth-main);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.6;
}

.roghan-auth__subtitle {
	margin: 0 0 24px;
	color: var(--roghan-auth-muted);
	font-size: 14px;
	line-height: 1.9;
}

.roghan-auth__phone {
	direction: ltr;
	display: inline-block;
	unicode-bidi: isolate;
}

.roghan-auth__field {
	margin-bottom: 14px;
	text-align: right;
}

.roghan-auth__input {
	width: 100%;
	height: 48px;
	padding: 0 16px;
	border: 1px solid var(--roghan-auth-border);
	border-radius: var(--roghan-auth-radius);
	background: #fff;
	color: #111827;
	font: inherit;
	font-size: 15px;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.roghan-auth__input:focus {
	border-color: var(--roghan-auth-main);
	box-shadow: 0 0 0 3px rgba(24, 54, 97, .1);
	outline: none;
}

.roghan-auth__input.has-error {
	border-color: var(--roghan-auth-error);
}

.roghan-auth__input::placeholder {
	color: #9ca3af;
}

.roghan-auth__error {
	display: none;
	margin: 6px 2px 0;
	color: var(--roghan-auth-error);
	font-size: 12.5px;
	text-align: right;
}

.roghan-auth__error.is-visible {
	display: block;
}

.roghan-auth__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 48px;
	margin-top: 10px;
	padding: 0 20px;
	border: 1px solid var(--roghan-auth-main);
	border-radius: var(--roghan-auth-radius);
	background: var(--roghan-auth-main);
	color: #fff;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	transition: opacity .15s ease, transform .1s ease;
}

.roghan-auth__btn:hover {
	opacity: .92;
	color: #fff;
}

.roghan-auth__btn:active {
	transform: translateY(1px);
}

.roghan-auth__btn.is-busy,
.roghan-auth__btn:disabled {
	opacity: .65;
	cursor: default;
}

.roghan-auth__btn--ghost {
	background: transparent;
	color: var(--roghan-auth-main);
}

.roghan-auth__btn--ghost:hover {
	background: rgba(24, 54, 97, .06);
	color: var(--roghan-auth-main);
}

.roghan-auth__terms {
	margin: 16px 0 0;
	color: var(--roghan-auth-muted);
	font-size: 12px;
	line-height: 1.9;
}

.roghan-auth__back {
	position: absolute;
	top: -4px;
	right: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--roghan-auth-muted);
	cursor: pointer;
}

.roghan-auth__back:hover {
	background: rgba(0, 0, 0, .05);
	color: var(--roghan-auth-main);
}

/* ---------- code boxes ---------- */

.roghan-auth__code {
	display: flex;
	direction: ltr;
	justify-content: center;
	gap: 10px;
	margin-bottom: 6px;
}

.roghan-auth__digit {
	width: 56px;
	height: 56px;
	padding: 0;
	border: 1px solid var(--roghan-auth-border);
	border-radius: var(--roghan-auth-radius);
	background: #fff;
	color: #111827;
	font: inherit;
	font-size: 22px;
	font-weight: 700;
	text-align: center;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.roghan-auth__digit:focus {
	border-color: var(--roghan-auth-main);
	box-shadow: 0 0 0 3px rgba(24, 54, 97, .1);
	outline: none;
}

.roghan-auth__digit.has-error {
	border-color: var(--roghan-auth-error);
}

.roghan-auth__resend {
	min-height: 22px;
	margin: 14px 0 18px;
	color: var(--roghan-auth-muted);
	font-size: 13px;
}

.roghan-auth__link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--roghan-auth-accent);
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	text-decoration: underline;
	cursor: pointer;
}

.roghan-auth__notice {
	margin: 16px 0 0;
	padding: 10px 14px;
	border-radius: var(--roghan-auth-radius);
	background: #f3f4f6;
	color: #374151;
	font-size: 13px;
}

.roghan-auth__notice.is-success {
	background: #ecfdf5;
	color: #047857;
}

.roghan-auth--done {
	padding: 24px;
}

@media (max-width: 420px) {
	.roghan-auth__digit {
		width: 48px;
		height: 48px;
		font-size: 19px;
	}

	.roghan-auth__code {
		gap: 8px;
	}
}

/* ---------- login gate ---------- */

.roghan-lock {
	text-align: right;
}

.roghan-lock--card {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 18px 20px;
	border: 1px solid var(--roghan-auth-border);
	border-radius: 14px;
	background: #f9fafb;
}

.roghan-lock--inline {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0;
	border: 0;
	background: none;
}

.roghan-lock__icon {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: rgba(24, 54, 97, .08);
	color: var(--roghan-auth-main);
}

.roghan-lock--inline .roghan-lock__icon {
	width: 32px;
	height: 32px;
	border-radius: 9px;
}

.roghan-lock__body {
	flex: 1 1 auto;
	min-width: 0;
}

.roghan-lock__title {
	margin: 0 0 4px;
	color: var(--roghan-auth-main);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.7;
}

.roghan-lock__text {
	margin: 0;
	color: var(--roghan-auth-muted);
	font-size: 13px;
	line-height: 1.9;
}

.roghan-lock--inline .roghan-lock__text {
	display: none;
}

.roghan-lock__btn {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 42px;
	padding: 0 20px;
	border: 1px solid var(--roghan-auth-main);
	border-radius: var(--roghan-auth-radius);
	background: var(--roghan-auth-main);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	transition: opacity .15s ease;
}

.roghan-lock__btn:hover {
	opacity: .92;
	color: #fff;
	text-decoration: none;
}

.roghan-lock--button .roghan-lock__btn {
	width: auto;
}

@media (max-width: 560px) {
	.roghan-lock--card {
		flex-direction: column;
		align-items: stretch;
		text-align: center;
	}

	.roghan-lock--card .roghan-lock__icon {
		margin: 0 auto;
	}

	.roghan-lock--card .roghan-lock__btn {
		width: 100%;
	}
}

/* ---------- standalone login page ---------- */

body.roghan-login-standalone {
	margin: 0;
	background: #f4f6f9;
}

body.roghan-login-standalone .roghan-login-stage {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	padding: 32px 16px;
}

body.roghan-login-standalone .roghan-auth {
	width: 100%;
	padding: 36px 28px;
	border: 1px solid var(--roghan-auth-border);
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 14px 44px rgba(15, 23, 42, .08);
}

body.roghan-login-standalone .site-header,
body.roghan-login-standalone .site-footer {
	display: none;
}

/* Hint under a field, printed only when the form asks for it. */
.roghan-auth__help {
	margin: 6px 2px 0;
	color: var(--roghan-auth-muted);
	font-size: 12px;
	line-height: 1.8;
	text-align: right;
}

.roghan-auth__code + .roghan-auth__help { text-align: center; }
