/**
 * Sadat Forms – front end styles.
 * Everything here is a sensible default; Elementor's style tab overrides it.
 */

.sf-form {
	position: relative;
	width: 100%;
}

.sf-fields {
	--sf-cgap: 12px;
	--sf-rgap: 16px;
	display: flex;
	flex-wrap: wrap;
	margin-inline: calc(var(--sf-cgap) / -2);
	margin-bottom: calc(var(--sf-rgap) * -1);
}

.sf-field {
	display: flex;
	flex-direction: column;
	flex: 0 0 var(--sf-width, 100%);
	max-width: var(--sf-width, 100%);
	min-width: 0;
	padding-inline: calc(var(--sf-cgap) / 2);
	margin-bottom: var(--sf-rgap);
	box-sizing: border-box;
}

.sf-label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	line-height: 1.5;
}

.sf-required-mark {
	margin-inline-start: 3px;
	color: #e02b2b;
}

.sf-input {
	width: 100%;
	max-width: 100%;
	padding: 10px 14px;
	border: 1px solid #d5d8dd;
	border-radius: 6px;
	background-color: #fff;
	color: inherit;
	font: inherit;
	line-height: 1.6;
	transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.sf-input:focus {
	outline: none;
	border-color: #6c7ae0;
	box-shadow: 0 0 0 3px rgba(108, 122, 224, .15);
}

.sf-input:disabled {
	opacity: .6;
	cursor: not-allowed;
}

textarea.sf-input {
	resize: vertical;
	min-height: 90px;
}

select.sf-input[multiple] {
	min-height: 120px;
}

/* Date and time pickers keep their native control visible in every theme. */
.sf-field--date .sf-input,
.sf-field--time .sf-input {
	min-height: 44px;
}

.sf-field--date .sf-input::-webkit-calendar-picker-indicator,
.sf-field--time .sf-input::-webkit-calendar-picker-indicator {
	cursor: pointer;
	opacity: .65;
}

/* Choices ------------------------------------------------------------- */

.sf-choices {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.sf-choices--inline {
	flex-direction: row;
	flex-wrap: wrap;
	gap: 18px;
}

.sf-choice {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	cursor: pointer;
	line-height: 1.5;
}

.sf-choice input {
	width: 18px;
	height: 18px;
	margin: 0;
	flex: 0 0 auto;
	accent-color: #6c7ae0;
	cursor: pointer;
}

.sf-choice span {
	flex: 1;
}

/* Password ------------------------------------------------------------ */

.sf-password {
	position: relative;
	display: flex;
}

.sf-password .sf-input {
	padding-inline-end: 44px;
}

.sf-password-toggle {
	position: absolute;
	inset-inline-end: 6px;
	top: 50%;
	transform: translateY(-50%);
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: transparent;
	cursor: pointer;
	opacity: .55;
}

.sf-password-toggle::before {
	content: "";
	display: block;
	width: 20px;
	height: 20px;
	margin: 0 auto;
	background-color: currentColor;
	-webkit-mask: no-repeat center / 20px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5c-7 0-10 7-10 7s3 7 10 7 10-7 10-7-3-7-10-7zm0 11a4 4 0 110-8 4 4 0 010 8z'/%3E%3C/svg%3E");
	mask: no-repeat center / 20px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5c-7 0-10 7-10 7s3 7 10 7 10-7 10-7-3-7-10-7zm0 11a4 4 0 110-8 4 4 0 010 8z'/%3E%3C/svg%3E");
}

.sf-password-toggle:hover {
	opacity: .9;
}

.sf-password-toggle.is-visible {
	opacity: 1;
}

/* File upload --------------------------------------------------------- */

.sf-file {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

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

.sf-file-button {
	display: inline-flex;
	align-items: center;
	padding: 9px 16px;
	border: 1px dashed #c3c7cf;
	border-radius: 6px;
	background-color: #f6f7f9;
	cursor: pointer;
	font-size: .95em;
	transition: border-color .18s ease, background-color .18s ease;
}

.sf-file-button:hover {
	border-color: #6c7ae0;
	background-color: #eef0fb;
}

.sf-file-input:focus-visible + .sf-file-button {
	outline: 2px solid #6c7ae0;
	outline-offset: 2px;
}

.sf-file-name {
	font-size: .9em;
	opacity: .75;
	word-break: break-all;
}

/* OTP send button ----------------------------------------------------- */

.sf-field--with-button {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.sf-field--with-button .sf-label,
.sf-field--with-button .sf-field-error {
	flex: 0 0 100%;
	width: 100%;
}

.sf-field--with-button .sf-input {
	flex: 1 1 auto;
	width: auto;
}

.sf-otp-send {
	flex: 0 0 auto;
	padding: 10px 16px;
	border: 1px solid #d5d8dd;
	border-radius: 6px;
	background: #f6f7f9;
	font: inherit;
	font-size: .92em;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color .18s ease, opacity .18s ease;
}

.sf-otp-send:hover:not(:disabled) {
	background: #eef0fb;
}

.sf-otp-send:disabled {
	opacity: .55;
	cursor: default;
}

/* Actions ------------------------------------------------------------- */

.sf-actions {
	display: flex;
	margin-top: 18px;
}

.sf-submit {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 26px;
	border: 0;
	border-radius: 6px;
	background-color: #6c7ae0;
	color: #fff;
	font: inherit;
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.sf-submit:hover {
	background-color: #5867cf;
}

.sf-submit:disabled {
	opacity: .7;
	cursor: default;
}

.sf-submit-icon {
	display: inline-flex;
	align-items: center;
}

.sf-submit-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.sf-spinner {
	display: none;
	width: 15px;
	height: 15px;
	border: 2px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	animation: sf-spin .7s linear infinite;
}

.sf-form.is-loading .sf-spinner {
	display: inline-block;
}

@keyframes sf-spin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.sf-spinner { animation-duration: 2s; }
	.sf-input, .sf-submit, .sf-file-button { transition: none; }
}

/* Messages ------------------------------------------------------------ */

.sf-field-error {
	display: none;
	margin-top: 5px;
	font-size: .86em;
	line-height: 1.5;
	color: #e02b2b;
}

.sf-field.sf-has-error .sf-field-error {
	display: block;
}

.sf-field.sf-has-error .sf-input {
	border-color: #e02b2b;
}

.sf-message {
	display: none;
	margin-top: 14px;
	padding: 12px 16px;
	border-radius: 6px;
	line-height: 1.7;
}

.sf-message.is-visible {
	display: block;
}

.sf-message.is-success {
	background-color: #e8f6ed;
	color: #1c7c43;
}

.sf-message.is-error {
	background-color: #fdeaea;
	color: #b32020;
}

.sf-notice {
	padding: 14px 18px;
	border-radius: 6px;
	background-color: #f2f4f8;
	line-height: 1.7;
}

.sf-lost-password {
	margin-top: 10px;
	font-size: .9em;
}

.sf-footer-text {
	margin-top: 14px;
	font-size: .92em;
	line-height: 1.8;
}

/* Honeypot ------------------------------------------------------------ */

.sf-hp {
	position: absolute !important;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Direction ----------------------------------------------------------- */

.sf-form[dir="rtl"],
.sf-notice[dir="rtl"],
.sf-dir-rtl {
	direction: rtl;
	text-align: right;
}

.sf-form[dir="ltr"],
.sf-notice[dir="ltr"],
.sf-dir-ltr {
	direction: ltr;
	text-align: left;
}

/*
 * Phone numbers, emails, URLs and dates stay left to right so the digits
 * read correctly, while text-align: inherit keeps them hugging the same
 * edge as the rest of the form.
 */
.sf-inputs-ltr .sf-field--tel .sf-input,
.sf-inputs-ltr .sf-field--email .sf-input,
.sf-inputs-ltr .sf-field--number .sf-input,
.sf-inputs-ltr .sf-field--url .sf-input,
.sf-inputs-ltr .sf-field--date .sf-input,
.sf-inputs-ltr .sf-field--time .sf-input,
.sf-inputs-ltr .sf-field--password .sf-input {
	direction: ltr;
	text-align: inherit;
}

/* Staged sign-in -------------------------------------------------------
 *
 * The form opens as a single phone box. Once a code is on its way the
 * code field appears, and the profile fields only join in when the number
 * turns out to be new.
 */

.sf-otp-steps [data-otp-step="code"],
.sf-otp-steps [data-otp-step="profile"],
.sf-otp-steps .sf-actions,
.sf-otp-steps .sf-footer-text {
	display: none;
}

.sf-otp-steps.sf-otp-sent [data-otp-step="code"] {
	display: flex;
}

.sf-otp-steps.sf-otp-sent .sf-actions {
	display: flex;
}

.sf-otp-steps.sf-otp-sent .sf-footer-text {
	display: block;
}

.sf-otp-steps.sf-otp-sent.sf-otp-new [data-otp-step="profile"] {
	display: flex;
}

/* Fade the revealed fields in rather than snapping them into place. */
.sf-otp-steps.sf-otp-sent [data-otp-step="code"],
.sf-otp-steps.sf-otp-sent.sf-otp-new [data-otp-step="profile"] {
	animation: sf-reveal .22s ease both;
}

@keyframes sf-reveal {
	from { opacity: 0; transform: translateY(-4px); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.sf-otp-steps.sf-otp-sent [data-otp-step="code"],
	.sf-otp-steps.sf-otp-sent.sf-otp-new [data-otp-step="profile"] {
		animation: none;
	}
}

/* Inside the Elementor editor every field stays visible, so the form can
   actually be built and styled. */
body.elementor-editor-active .sf-otp-steps [data-otp-step],
body.elementor-editor-active .sf-otp-steps .sf-actions {
	display: flex;
}

body.elementor-editor-active .sf-otp-steps .sf-footer-text {
	display: block;
}

/* The verification code reads better centred and spaced out. */
.sf-form [data-field="otp"] .sf-input,
.sf-form [data-field="code"] .sf-input {
	direction: ltr;
	text-align: center;
	letter-spacing: .35em;
	text-indent: .35em;
	font-variant-numeric: tabular-nums;
}

/* Small screens ------------------------------------------------------- */

@media (max-width: 767px) {
	.sf-field {
		flex-basis: 100%;
		max-width: 100%;
	}

	.sf-field--with-button {
		flex-wrap: wrap;
	}

	.sf-field--with-button .sf-input,
	.sf-otp-send {
		flex: 1 1 100%;
		width: 100%;
	}
}
