/* ====================================================================
   Kroxlabz Product Authenticator — Frontend
   ==================================================================== */

.kx-auth-box {
	--kx-ink: #14161a;
	--kx-muted: #6b7280;
	--kx-border: #e5e7eb;
	--kx-accent: #111827;
	--kx-accent-contrast: #ffffff;
	--kx-radius: 16px;

	max-width: 560px;
	margin: 0 auto;
	padding: 40px 36px 32px;
	background: #ffffff;
	border-radius: var(--kx-radius);
	border: 1px solid var(--kx-border);
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 32px -8px rgba(16, 24, 40, 0.10);
	text-align: center;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--kx-ink);
	box-sizing: border-box;
}

.kx-auth-box * {
	box-sizing: border-box;
}

.kx-auth-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 14px;
	margin-bottom: 18px;
	border-radius: 999px;
	background: #f3f4f6;
	color: var(--kx-ink);
}

.kx-auth-badge svg {
	color: #16a34a;
	flex-shrink: 0;
}

.kx-auth-badge span {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
}

.kx-auth-heading {
	margin: 0 0 8px;
	font-size: 26px;
	font-weight: 800;
	letter-spacing: -0.01em;
}

.kx-auth-subheading {
	margin: 0 0 26px;
	color: var(--kx-muted);
	font-size: 15px;
	line-height: 1.55;
}

.kx-auth-form {
	text-align: left;
}

.kx-auth-field {
	margin-bottom: 16px;
	flex: 1 1 0;
}

.kx-auth-field-row {
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
}

.kx-auth-phone-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.kx-auth-hint {
	margin: 0;
	font-size: 12px;
	color: #9ca3af;
}

.kx-auth-combobox {
	position: relative;
}

.kx-auth-combobox-list {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	max-height: 260px;
	overflow-y: auto;
	background: #fff;
	border: 1px solid var(--kx-border);
	border-radius: 10px;
	box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
	z-index: 20;
}

.kx-auth-combobox-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 14px;
	font-size: 14.5px;
	cursor: pointer;
}

.kx-auth-combobox-item:hover,
.kx-auth-combobox-item:focus {
	background: #f3f4f6;
}

.kx-auth-combobox-dial {
	color: var(--kx-muted);
	font-size: 13px;
	font-weight: 600;
	flex-shrink: 0;
}

.kx-auth-combobox-empty {
	padding: 14px;
	font-size: 13.5px;
	color: var(--kx-muted);
	text-align: center;
}

.kx-auth-country {
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 36px;
	cursor: pointer;
}

.kx-auth-phone-number {
	display: flex;
	align-items: stretch;
	border: 1.5px solid var(--kx-border);
	border-radius: 10px;
	background: #fafafa;
	overflow: hidden;
	transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.kx-auth-phone-number:focus-within {
	border-color: var(--kx-accent);
	background: #fff;
	box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.06);
}

.kx-auth-dial-code {
	display: flex;
	align-items: center;
	padding: 0 12px;
	font-size: 15px;
	font-weight: 600;
	color: var(--kx-muted);
	background: #f3f4f6;
	border-right: 1.5px solid var(--kx-border);
	white-space: nowrap;
}

.kx-auth-phone-number .kx-auth-mobile {
	border: none;
	background: transparent;
	border-radius: 0;
}

.kx-auth-phone-number .kx-auth-mobile:focus {
	box-shadow: none;
}

.kx-auth-field label {
	display: block;
	margin-bottom: 6px;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--kx-muted);
	letter-spacing: 0.01em;
}

.kx-auth-input {
	width: 100%;
	padding: 13px 16px;
	font-size: 15.5px;
	color: var(--kx-ink);
	background: #fafafa;
	border: 1.5px solid var(--kx-border);
	border-radius: 10px;
	outline: none;
	transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.kx-auth-code {
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-weight: 600;
}

.kx-auth-input:focus {
	border-color: var(--kx-accent);
	background: #fff;
	box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.06);
}

.kx-auth-input::placeholder {
	color: #9ca3af;
	letter-spacing: normal;
	font-weight: 400;
}

.kx-auth-error {
	margin: -4px 0 14px;
	padding: 10px 14px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
	font-size: 13.5px;
	border-radius: 8px;
}

.kx-auth-submit {
	width: 100%;
	padding: 15px 24px;
	font-size: 15.5px;
	font-weight: 700;
	letter-spacing: 0.01em;
	color: var(--kx-accent-contrast);
	background: var(--kx-accent);
	border: none;
	border-radius: 10px;
	cursor: pointer;
	transition: transform 0.1s, opacity 0.15s;
}

.kx-auth-submit:hover {
	opacity: 0.92;
}

.kx-auth-submit:active {
	transform: translateY(1px);
}

.kx-auth-submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.kx-auth-submit.is-loading {
	position: relative;
}

.kx-auth-privacy {
	margin: 14px 0 0;
	font-size: 12px;
	color: #9ca3af;
	text-align: center;
}

/* ---- Modal ---- */

body.kx-auth-modal-open {
	overflow: hidden;
}

.kx-auth-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 17, 21, 0.55);
	backdrop-filter: blur(2px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100000;
	padding: 20px;
}

.kx-auth-modal {
	position: relative;
	width: 100%;
	max-width: 420px;
	background: #fff;
	border-radius: 20px;
	padding: 40px 32px 32px;
	text-align: center;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	animation: kxModalIn 0.2s ease-out;
}

@keyframes kxModalIn {
	from { opacity: 0; transform: translateY(12px) scale(0.98); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

.kx-auth-modal-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 32px;
	height: 32px;
	border: none;
	background: #f3f4f6;
	color: #4b5563;
	border-radius: 50%;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.kx-auth-modal-close:hover {
	background: #e5e7eb;
}

.kx-auth-modal-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 76px;
	height: 76px;
	border-radius: 50%;
	margin: 0 auto 18px;
}

.kx-auth-modal[data-status="valid"] .kx-auth-modal-icon { background: #ecfdf3; color: #16a34a; }
.kx-auth-modal[data-status="repeat"] .kx-auth-modal-icon { background: #fffbeb; color: #d97706; }
.kx-auth-modal[data-status="invalid"] .kx-auth-modal-icon,
.kx-auth-modal[data-status="blocked"] .kx-auth-modal-icon { background: #fef2f2; color: #dc2626; }

.kx-auth-modal-title {
	margin: 0 0 10px;
	font-size: 21px;
	font-weight: 800;
	letter-spacing: -0.01em;
	color: #14161a;
}

.kx-auth-modal-message {
	margin: 0 0 20px;
	font-size: 14.5px;
	line-height: 1.6;
	color: #4b5563;
}

.kx-auth-modal-details {
	text-align: left;
	background: #f9fafb;
	border: 1px solid #f0f1f3;
	border-radius: 12px;
	padding: 4px 16px;
	margin-bottom: 22px;
}

.kx-auth-detail-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 11px 0;
	border-bottom: 1px solid #f0f1f3;
	font-size: 13.5px;
}

.kx-auth-detail-row:last-child {
	border-bottom: none;
}

.kx-auth-detail-row span {
	color: #9ca3af;
}

.kx-auth-detail-row strong {
	color: #14161a;
	font-weight: 700;
	text-align: right;
	word-break: break-word;
}

.kx-auth-modal-reset {
	width: 100%;
	padding: 14px 20px;
	font-size: 14.5px;
	font-weight: 700;
	color: #14161a;
	background: #f3f4f6;
	border: none;
	border-radius: 10px;
	cursor: pointer;
	transition: background 0.15s;
}

.kx-auth-modal-reset:hover {
	background: #e5e7eb;
}

@media (max-width: 480px) {
	.kx-auth-box {
		padding: 30px 20px 26px;
	}
	.kx-auth-field-row {
		flex-direction: column;
		gap: 0;
	}
	.kx-auth-modal {
		padding: 32px 22px 24px;
	}
}

/* ====================================================================
   Admin
   ==================================================================== */

.kx-auth-wrap .kx-stat-cards {
	display: flex;
	gap: 16px;
	margin: 20px 0 30px;
	flex-wrap: wrap;
}

.kx-auth-wrap .kx-stat-card {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 10px;
	padding: 20px 26px;
	min-width: 160px;
}

.kx-auth-wrap .kx-stat-num {
	display: block;
	font-size: 30px;
	font-weight: 700;
	line-height: 1.2;
}

.kx-auth-wrap .kx-stat-label {
	color: #666;
	font-size: 13px;
}

.kx-auth-wrap .kx-card {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 10px;
	padding: 20px 24px;
	max-width: 700px;
}

.kx-badge {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
}

.kx-badge-unused { background: #e8f0fe; color: #1a56db; }
.kx-badge-used,
.kx-badge-valid { background: #eafaf0; color: #1a7a45; }
.kx-badge-repeat { background: #fff8e6; color: #8a5b00; }
.kx-badge-invalid,
.kx-badge-blocked { background: #fdeeee; color: #a3181c; }

.kx-pagination {
	margin-top: 15px;
}

.kx-pagination a,
.kx-pagination strong {
	margin-right: 8px;
}
