/**
 * Registration form.
 *
 * Carries over the purple/pink identity of the original app, but with contrast
 * that passes on real screens -- the old form used purple-300 placeholder text
 * on a purple-900 field, which is close to unreadable in daylight.
 */

.bdf {
	--bdf-ink: #fff;
	--bdf-ink-soft: #d9cdea;
	--bdf-bg: linear-gradient(160deg, #2b1055 0%, #4a1e6d 55%, #7b2b62 100%);
	--bdf-surface: rgba(255, 255, 255, 0.07);
	--bdf-border: rgba(255, 255, 255, 0.22);
	--bdf-border-strong: rgba(255, 255, 255, 0.45);
	--bdf-accent: #ffc94d;
	--bdf-danger: #ffb3b3;
	--bdf-radius: 14px;

	background: var(--bdf-bg);
	border-radius: var(--bdf-radius);
	box-sizing: border-box;
	color: var(--bdf-ink);
	margin: 0 auto;
	max-width: 640px;
	padding: 28px;
	width: 100%;
}

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

.bdf__noscript,
.bdf--closed p {
	background: rgba(0, 0, 0, 0.25);
	border-radius: 8px;
	margin: 0;
	padding: 16px;
	text-align: center;
}

/* --- top bar ------------------------------------------------------------- */

.bdf__topbar {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: space-between;
	margin-bottom: 14px;
}

.bdf__langs {
	display: flex;
	gap: 6px;
}

.bdf__lang {
	background: transparent;
	border: 1px solid var(--bdf-border);
	border-radius: 999px;
	color: var(--bdf-ink-soft);
	cursor: pointer;
	font: inherit;
	font-size: 13px;
	line-height: 1.6;
	padding: 2px 14px;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.bdf__lang:hover {
	border-color: var(--bdf-border-strong);
	color: var(--bdf-ink);
}

.bdf__lang.is-active {
	background: var(--bdf-accent);
	border-color: var(--bdf-accent);
	color: #2b1055;
	font-weight: 600;
}

.bdf__progress-label {
	color: var(--bdf-ink-soft);
	font-size: 13px;
	margin: 0;
}

.bdf__progress {
	background: rgba(0, 0, 0, 0.25);
	border-radius: 999px;
	height: 5px;
	margin-bottom: 24px;
	overflow: hidden;
}

.bdf__progress-bar {
	background: linear-gradient(90deg, #ff6ec7, var(--bdf-accent));
	border-radius: 999px;
	height: 100%;
	transition: width 0.3s ease;
	width: 0;
}

/* --- content --------------------------------------------------------------- */

.bdf__title {
	color: var(--bdf-ink);
	font-size: 22px;
	line-height: 1.35;
	margin: 0 0 6px;
}

.bdf__subtitle {
	color: var(--bdf-ink-soft);
	margin: 0 0 20px;
}

.bdf__field {
	margin-bottom: 18px;
}

.bdf__field > label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 6px;
}

.bdf__input {
	background: var(--bdf-surface);
	border: 1px solid var(--bdf-border);
	border-radius: 8px;
	color: var(--bdf-ink);
	font: inherit;
	padding: 12px 14px;
	transition: border-color 0.15s, box-shadow 0.15s;
	width: 100%;
}

.bdf__input::placeholder {
	color: rgba(255, 255, 255, 0.55);
}

.bdf__input:focus {
	border-color: var(--bdf-accent);
	box-shadow: 0 0 0 3px rgba(255, 201, 77, 0.25);
	outline: none;
}

.bdf__textarea {
	resize: vertical;
}

.bdf__hint,
.bdf__privacy {
	color: var(--bdf-ink-soft);
	font-size: 13px;
	line-height: 1.5;
	margin: 8px 0 0;
}

.bdf__privacy {
	background: rgba(0, 0, 0, 0.2);
	border-radius: 8px;
	padding: 10px 12px;
}

/* --- photo picker ------------------------------------------------------------ */

.bdf__picker {
	align-items: center;
	display: flex;
	gap: 16px;
}

.bdf__preview {
	border-radius: 50%;
	flex-shrink: 0;
	height: 84px;
	overflow: hidden;
	width: 84px;
}

.bdf__preview img {
	display: block;
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.bdf__preview.is-empty {
	background: rgba(0, 0, 0, 0.2);
	border: 2px dashed var(--bdf-border);
}

/* Visually hidden, still reachable by keyboard through its label. */
.bdf__file {
	height: 1px;
	opacity: 0;
	position: absolute;
	width: 1px;
}

.bdf__file:focus-visible + .bdf__file-label,
.bdf__file-label:hover {
	border-color: var(--bdf-accent);
}

/* --- choices -------------------------------------------------------------------- */

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

.bdf__choices--pair {
	flex-direction: row;
}

.bdf__choices--pair .bdf__choice {
	flex: 1;
	justify-content: center;
}

.bdf__choice {
	align-items: center;
	background: var(--bdf-surface);
	border: 1px solid var(--bdf-border);
	border-radius: 10px;
	cursor: pointer;
	display: flex;
	gap: 10px;
	padding: 14px 16px;
	transition: border-color 0.15s, background 0.15s;
}

.bdf__choice:hover {
	border-color: var(--bdf-border-strong);
}

.bdf__choice.is-selected {
	background: rgba(255, 201, 77, 0.16);
	border-color: var(--bdf-accent);
}

.bdf__choice input {
	accent-color: var(--bdf-accent);
	flex-shrink: 0;
	height: 18px;
	margin: 0;
	width: 18px;
}

/* --- actions ---------------------------------------------------------------------- */

.bdf__actions {
	display: flex;
	gap: 10px;
	margin-top: 24px;
}

.bdf__btn {
	border: 1px solid transparent;
	border-radius: 999px;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	padding: 13px 26px;
	transition: transform 0.12s, box-shadow 0.15s, background 0.15s;
}

.bdf__btn:active {
	transform: scale(0.98);
}

.bdf__btn:disabled {
	cursor: default;
	opacity: 0.6;
	transform: none;
}

.bdf__btn--primary {
	background: linear-gradient(90deg, #ff6ec7, var(--bdf-accent));
	color: #2b1055;
	flex: 1;
}

.bdf__btn--primary:hover:not(:disabled) {
	box-shadow: 0 6px 20px rgba(255, 110, 199, 0.35);
}

.bdf__btn--ghost {
	background: transparent;
	border-color: var(--bdf-border);
	color: var(--bdf-ink);
}

.bdf__btn--ghost:hover {
	border-color: var(--bdf-border-strong);
}

.bdf__file-label {
	display: inline-block;
	font-size: 14px;
	padding: 10px 20px;
}

/* --- error & success ----------------------------------------------------------------- */

.bdf__error {
	background: rgba(180, 30, 50, 0.35);
	border: 1px solid rgba(255, 140, 140, 0.5);
	border-radius: 8px;
	color: #ffe3e3;
	margin-top: 16px;
	padding: 12px 14px;
}

.bdf__done {
	padding: 20px 0;
	text-align: center;
}

.bdf__done-mark {
	align-items: center;
	background: rgba(255, 201, 77, 0.18);
	border: 2px solid var(--bdf-accent);
	border-radius: 50%;
	color: var(--bdf-accent);
	display: flex;
	font-size: 32px;
	height: 68px;
	justify-content: center;
	margin: 0 auto 16px;
	width: 68px;
}

.bdf__done h2 {
	margin: 0 0 8px;
}

.bdf__done p {
	color: var(--bdf-ink-soft);
	margin: 0;
}

/* Honeypot: off-screen rather than display:none, which some bots skip. */
.bdf__hp {
	height: 0;
	left: -9999px;
	overflow: hidden;
	position: absolute;
	width: 0;
}

/* --- responsive & motion ---------------------------------------------------------------- */

@media (max-width: 600px) {
	.bdf {
		border-radius: 0;
		padding: 20px 16px;
	}

	.bdf__title {
		font-size: 19px;
	}

	.bdf__picker {
		flex-direction: column;
		text-align: center;
	}

	.bdf__actions {
		flex-direction: column-reverse;
	}

	.bdf__btn {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bdf__progress-bar,
	.bdf__btn,
	.bdf__choice,
	.bdf__input {
		transition: none;
	}
}

/* Arabic reads right to left; mirror the pieces that carry direction. */
.bdf[dir="rtl"] .bdf__progress-bar {
	margin-left: auto;
}

.bdf[dir="rtl"] .bdf__picker {
	flex-direction: row-reverse;
}

@media (max-width: 600px) {
	.bdf[dir="rtl"] .bdf__picker {
		flex-direction: column;
	}
}
