.ftb-auth {
	font-family: inherit;
}

.ftb-auth--popup {
	display: inline-block;
}

.ftb-auth__trigger {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.25rem 0;
	border: none;
	background: transparent;
	color: #111827;
	cursor: pointer;
	font: inherit;
	line-height: 1;
}

.ftb-auth__trigger:hover .ftb-auth__trigger-label,
.ftb-auth__trigger:focus-visible .ftb-auth__trigger-label {
	color: #1d4ed8;
}

.ftb-auth__trigger:focus-visible {
	outline: 2px solid #1d4ed8;
	outline-offset: 2px;
}

.ftb-auth__trigger-icon {
	display: inline-flex;
	width: 22px;
	height: 22px;
	line-height: 0;
	color: #4b5563;
}

.ftb-auth__trigger-icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

.ftb-auth__trigger-label {
	font-size: 0.95rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	transition: color 0.15s ease;
}

.ftb-auth__popup {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.ftb-auth__popup[hidden] {
	display: none;
}

.ftb-auth__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	cursor: pointer;
}

.ftb-auth__dialog {
	position: relative;
	width: 100%;
	max-width: 480px;
	max-height: calc(100vh - 2rem);
	overflow-y: auto;
	padding: 1.25rem;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}

.ftb-auth__close {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: none;
	background: transparent;
	color: #475569;
	cursor: pointer;
	border-radius: 4px;
}

.ftb-auth__close:hover,
.ftb-auth__close:focus-visible {
	background: #f1f5f9;
	outline: none;
}

body.ftb-auth-popup-open {
	overflow: hidden;
}

.ftb-auth__tabs {
	display: flex;
	gap: 0.25rem;
	border-bottom: 1px solid #e2e8f0;
	margin: 0 0 1rem;
}

.ftb-auth__tab {
	flex: 1;
	padding: 0.6rem 0.8rem;
	border: none;
	background: transparent;
	color: #475569;
	font-weight: 500;
	cursor: pointer;
	border-bottom: 2px solid transparent;
}

.ftb-auth__tab.is-active {
	color: #1d4ed8;
	border-bottom-color: #1d4ed8;
}

.ftb-auth__form.is-hidden {
	display: none;
}

.ftb-auth__form p {
	margin: 0 0 0.85rem;
}

.ftb-auth__form label {
	display: block;
	font-size: 0.9rem;
}

.ftb-auth__form label > span {
	display: block;
	margin-bottom: 0.25rem;
	color: #334155;
}

.ftb-auth__form input[type="text"],
.ftb-auth__form input[type="email"],
.ftb-auth__form input[type="tel"],
.ftb-auth__form input[type="password"] {
	width: 100%;
	padding: 0.55rem 0.7rem;
	border: 1px solid #cbd5e1;
	border-radius: 4px;
	font-size: 1rem;
	box-sizing: border-box;
	background: #fff;
	color: #111827;
}

.ftb-auth__form input::placeholder {
	color: #94a3b8;
}

.ftb-auth__form input:focus {
	outline: 2px solid #1d4ed8;
	outline-offset: 1px;
	border-color: #1d4ed8;
}

.ftb-auth__submit {
	width: 100%;
	padding: 0.65rem 1rem;
	border: none;
	border-radius: 4px;
	background: #1d4ed8;
	color: #fff;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}

.ftb-auth__submit:hover:not([disabled]),
.ftb-auth__submit:focus-visible {
	background: #1e40af;
}

.ftb-auth__submit[disabled] {
	background: #93c5fd;
	cursor: not-allowed;
}

.ftb-auth__message {
	min-height: 1.2em;
	font-size: 0.9rem;
	margin: 0 0 0.5rem;
}

.ftb-auth__message[data-state="error"] {
	color: #b91c1c;
}

.ftb-auth__message[data-state="success"] {
	color: #15803d;
}

.ftb-auth__message[data-state="info"] {
	color: #1d4ed8;
}

.ftb-auth__dialog--account {
	max-width: 360px;
	text-align: center;
}

.ftb-auth__account {
	padding: 0.75rem 0.5rem 0.25rem;
}

.ftb-auth__account-icon {
	display: inline-flex;
	width: 40px;
	height: 40px;
	margin-bottom: 0.5rem;
	color: #4b5563;
}

.ftb-auth__account-icon svg {
	width: 100%;
	height: 100%;
}

.ftb-auth__welcome {
	margin: 0 0 1rem;
	color: #334155;
}

.ftb-auth__logout {
	width: 100%;
	padding: 0.6rem 1rem;
	border: 1px solid #cbd5e1;
	border-radius: 4px;
	background: #fff;
	color: #b91c1c;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.ftb-auth__logout:hover:not([disabled]),
.ftb-auth__logout:focus-visible {
	background: #fef2f2;
	border-color: #fca5a5;
}

.ftb-auth__logout[disabled] {
	opacity: 0.6;
	cursor: not-allowed;
}

.ftb-auth__form label > span.ftb-auth__phone-row {
	display: flex;
	gap: 0.5rem;
	align-items: stretch;
	margin-bottom: 0;
}

.ftb-auth__phone-row input[type="tel"] {
	flex: 1 1 auto;
	min-width: 0;
}

.ftb-auth__send-code {
	flex: 0 0 auto;
	padding: 0 1rem;
	border: none;
	border-radius: 4px;
	background: #1d4ed8;
	color: #fff;
	font-size: 0.9rem;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
	transition: background 0.15s ease;
}

.ftb-auth__send-code:hover:not([disabled]),
.ftb-auth__send-code:focus-visible {
	background: #1e40af;
}

.ftb-auth__send-code[disabled] {
	background: #e2e8f0;
	color: #94a3b8;
	cursor: not-allowed;
}

.ftb-auth__code-field {
	margin-top: 0.25rem;
}

.ftb-auth__dialog--success {
	max-width: 400px;
	padding: 2rem 1.5rem 1.5rem;
	text-align: center;
}

.ftb-auth__success-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin-bottom: 1rem;
	border-radius: 50%;
	background: #dcfce7;
	color: #15803d;
}

.ftb-auth__success-title {
	margin: 0 0 0.5rem;
	font-size: 1.25rem;
	font-weight: 700;
	color: #111827;
}

.ftb-auth__success-text {
	margin: 0 0 1.5rem;
	font-size: 1rem;
	line-height: 1.5;
	color: #334155;
}

.ftb-auth__success-ok {
	max-width: 160px;
}
