@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&display=swap');

:root {
	--p1: #9b30e0;
	--p2: #5706a7;
	--purple: #5706a7;
	--bg: #f3eefb;
	--card: #ffffff;
	--title: #2a103f;
	--text: #6b5f78;
	--muted: #9a8ea8;
	--input-border: #e2d2f2;
	--input-border-focus: #8e24aa;
	--input-text: #2a103f;
	--error: #ef4d63;
	--track: #ece1f7;
}

*, :before, :after {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	outline: 0;
}

html, body { min-height: 100%; }

body {
	background: var(--bg);
	background-image: radial-gradient(120% 60% at 50% 0%, #f7effb 0%, var(--bg) 60%);
	color: var(--text);
	font-family: 'Inter', Arial, sans-serif;
	font-size: 14px;
	line-height: 1.4;
	text-align: center;
	-webkit-font-smoothing: antialiased;
}

.app {
	max-width: 440px;
	margin: 0 auto;
	padding: 5px 16px;
}

/* ---------- top bar ---------- */
.topbar {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	padding: 6px 4px 14px;
}

.lang-switch { position: relative; }
.lang-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #fff;
	border: 1px solid var(--input-border);
	border-radius: 999px;
	padding: 7px 12px;
	color: var(--purple);
	font-family: inherit;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(106, 13, 173, .06);
}
.lang-btn .globe { fill: var(--purple); }
.lang-btn .chev { fill: var(--purple); transition: transform .2s; }
.lang-menu.open ~ * .chev,
.lang-switch:has(.lang-menu.open) .chev { transform: rotate(180deg); }

.lang-menu {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	min-width: 140px;
	background: #fff;
	border: 1px solid var(--input-border);
	border-radius: 12px;
	box-shadow: 0 10px 28px rgba(42, 16, 63, .14);
	overflow: hidden;
	opacity: 0;
	transform: translateY(-6px);
	pointer-events: none;
	transition: .18s ease;
	z-index: 50;
}
.lang-menu.open {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}
.lang-option {
	padding: 11px 14px;
	font-size: 14px;
	font-weight: 600;
	color: var(--title);
	text-align: left;
	cursor: pointer;
}
.lang-option:hover { background: #f6effb; }
.lang-option.active {
	color: var(--purple);
	background: #f3e8fb;
}

/* ---------- card ---------- */
.card {
	background: var(--card);
	border-radius: 22px;
	padding: 20px 22px 26px;
	box-shadow: 0 14px 40px rgba(106, 13, 173, .10);
	border: 1px solid #f0e6fa;
}

/* ---------- integration hooks (kept for ajax.js, not shown) ---------- */
.hooks { display: none; }

/* ---------- pin stepper (step 2 only) ---------- */
.stepper {
	display: flex;
	justify-content: center;
	align-items: flex-start;
	margin: 6px 0 20px;
}
.stp {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	width: 120px;
}
.stp-dot {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 15px;
	font-weight: 700;
	color: #fff;
	background: #cba8e8;
}
.stp.active .stp-dot {
	background: linear-gradient(135deg, var(--p1), var(--p2));
	box-shadow: 0 4px 12px rgba(106, 13, 173, .30);
}
.stp-label {
	font-size: 12px;
	font-weight: 600;
	color: var(--muted);
}
.stp.active .stp-label { color: var(--purple); }
.stp-line {
	flex: 1;
	max-width: 80px;
	height: 3px;
	border-radius: 2px;
	margin-top: 16px;
	background: linear-gradient(90deg, #cba8e8, var(--p2));
}

/* ---------- hero illustration ---------- */
.hero {
	display: flex;
	justify-content: center;
	margin: 6px auto 4px;
}
.hero svg { max-width: 100%; height: auto; max-height: clamp(120px, 24vh, 230px); }
.hero-mail { margin-top: 14px; }

/* ---------- texts ---------- */
.title {
	color: var(--p2);
	font-size: 24px;
	line-height: 1.2;
	font-weight: 900;
	margin: 10px 0 6px;
}
.subtitle {
	font-size: 14px;
	color: var(--text);
	margin-bottom: 20px;
	padding: 0 6px;
}

/* ---------- fields ---------- */
.field {
	position: relative;
	margin-bottom: 14px;
}

.phone-input {
	display: flex;
	align-items: center;
	height: 60px;
	background: #fbf8ff;
	border: 2px solid var(--input-border);
	border-radius: 14px;
	overflow: hidden;
	transition: border-color .25s, box-shadow .25s;
}
.phone-input:focus-within {
	border-color: var(--input-border-focus);
	box-shadow: 0 0 0 4px rgba(142, 36, 170, .10);
}
.phone-prefix {
	display: flex;
	align-items: center;
	flex: none;
	height: 100%;
	padding: 0 16px;
	font-size: 18px;
	font-weight: 700;
	color: var(--title);
	background: #f1e6fb;
	border-right: 2px solid var(--input-border);
}
.phone-input .field-input {
	flex: 1 1 auto;
	min-width: 0;
	width: 100%;
	height: 100%;
	border: 0;
	background: transparent;
	padding: 0 14px;
	color: var(--input-text);
	font-family: inherit;
	font-size: 20px;
	font-weight: 600;
	letter-spacing: 1px;
}
.phone-input .field-input::placeholder { color: #c3b2d6; font-weight: 500; }

.field-check {
	width: 24px;
	height: 24px;
	margin-right: 12px;
	fill: #d9c7ec;
	opacity: 0;
	transition: .25s;
	flex: none;
}
.form-valid .field-check { fill: #22b07d; opacity: 1; }

.field-input.has-error,
.has-error .phone-input,
.phone-input:has(.has-error) { border-color: var(--error); }

/* pin field */
.field-input.pin {
	display: block;
	width: 100%;
	height: 70px;
	background: #fbf8ff;
	border: 2px solid var(--input-border);
	border-radius: 14px;
	text-align: center;
	color: var(--input-text);
	font-family: inherit;
	font-size: 34px;
	font-weight: 700;
	letter-spacing: 18px;
	text-indent: 18px;
	transition: border-color .25s, box-shadow .25s;
}
.field-input.pin::placeholder { color: #d6c6e8; }
.field-input.pin:focus {
	border-color: var(--input-border-focus);
	box-shadow: 0 0 0 4px rgba(142, 36, 170, .10);
}
.field-input.pin.has-error { border-color: var(--error); }

/* ---------- button ---------- */
.btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	height: 58px;
	background: linear-gradient(135deg, var(--p1), var(--p2));
	border: none;
	border-radius: 14px;
	color: #fff;
	font-family: inherit;
	font-size: 18px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 10px 22px rgba(106, 13, 173, .30);
	transition: transform .12s, box-shadow .2s, opacity .2s;
}
.btn:active { transform: translateY(1px); }
.btn-arrow { fill: #fff; flex: none; }
.btn[disabled], .btn.disabled {
	background: #cdbfe0;
	box-shadow: none;
	cursor: default;
}

/* ---------- secure note ---------- */
.secure-note {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	margin-top: 16px;
	color: var(--muted);
	font-size: 13px;
	text-align: left;
}
.secure-note .shield { fill: #b48cd6; flex: none; }

/* ---------- attention ---------- */
.attention {
	font-size: 13px;
	text-align: center;
	margin: 10px 4px 0;
	color: var(--error);
	opacity: 0;
}
.attention--show {
	-webkit-animation: blink 1s ease-in-out both;
	animation: blink 1s ease-in-out both;
}
@-webkit-keyframes blink {
	0%, 50%, 100% { opacity: 1; }
	25%, 75% { opacity: 0; }
}
@keyframes blink {
	0%, 50%, 100% { opacity: 1; }
	25%, 75% { opacity: 0; }
}

.d-none { display: none; }

/* ---------- message ---------- */
.messageBox {
	display: none;
	position: fixed;
	z-index: 999;
	inset: 0;
	justify-content: center;
	align-items: center;
	backdrop-filter: blur(4.5px);
	background: rgba(20, 6, 33, .82);
	flex-direction: column;
}
.message__content {
	position: relative;
	width: 90%;
	max-width: 350px;
	padding: 26px 22px;
	margin-top: calc(var(--vh, 100vh) * -0.1);
	color: #2a103f;
	background: #fff;
	border-radius: 16px;
	animation: fadeInDown .8s .2s both;
}
.message__title {
	margin: 8px 0 5px;
	font-weight: 600;
	font-size: 16px;
	line-height: 1.4;
	text-align: center;
	color: #2a103f;
}
.message__close {
	position: absolute;
	width: 21px;
	height: 21px;
	font-size: 0;
	color: transparent;
	cursor: pointer;
	padding: 12px;
	top: 6px;
	right: 6px;
	background: #fff;
}
.message__close::before,
.message__close::after {
	content: "";
	position: absolute;
	top: 0;
	left: 50%;
	width: 2px;
	height: 100%;
	background-color: #6b5f78;
	transform: translateX(-50%) rotate(-45deg);
}
.message__close::after { transform: translateX(-50%) rotate(45deg); }

@keyframes fadeInDown {
	from { opacity: 0; transform: translate3d(0, -100%, 0); }
	50% { opacity: 1; }
	to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.message__button {
	margin-top: 20px;
}

/*--------------------loader--------------------*/
.loader {
    /* display: flex; */
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 110;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(3px);
}

.loader__inner {
    display: inline-block;
    width: 30vmin;
    height: 30vmin;
    border: 3vmin solid rgba(255, 255, 255, .3);
    border-radius: 65%;
    border-top-color: #00e2ff;
    border-bottom-color: #ffbb00;
    transition: all 0.5s ease-in-out;
    -webkit-transition: all 0.5s ease-in-out;
    animation: spin 1s ease-in-out infinite alternate;
    -webkit-animation: spin 1s ease-in-out infinite alternate;
}

@keyframes spin {
    to { transform: rotate(360deg); border-radius: 20%; }
}

@-webkit-keyframes spin {
    to { -webkit-transform: rotate(360deg); border-radius: 20%; }
}

/*-------------------- compact layout for short screens --------------------*/
@media (max-height: 730px) {
	.topbar { padding: 2px 4px 6px; }
	.card { padding: 14px 20px 18px; }
	.hero { margin: 0 auto; }
	.title { font-size: 21px; margin: 4px 0; }
	.subtitle { margin-bottom: 12px; }
	.field { margin-bottom: 10px; }
	.phone-input { height: 54px; }
	.field-input.pin { height: 60px; }
	.btn { height: 52px; }
	.secure-note { margin-top: 10px; }
	.stepper { margin: 4px 0 14px; }
	.hero-mail { margin-top: 6px; }
}

@media (max-height: 600px) {
	.card { padding: 12px 18px 16px; }
	.title { font-size: 20px; }
	.subtitle { margin-bottom: 10px; }
	.phone-input { height: 50px; }
	.btn { height: 50px; }
}
