.aiq-quiz {
	--aiq-bg: #f7f6f1;
	--aiq-card-bg: #ffffff;
	--aiq-border: #eceae3;
	--aiq-text: #1c1c1c;
	--aiq-muted: #8a8a8a;
	--aiq-green: #1f9d63;
	--aiq-green-bg: #e5f6ec;
	--aiq-gray-bg: #eeeeee;
	--aiq-gray-text: #6b6b6b;
	--aiq-red-bg: #fbe7e7;
	--aiq-red-text: #c23b3b;
	--aiq-orange-bg: #fdf0dd;
	--aiq-orange-text: #b9711a;

	position: relative;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
	color: var(--aiq-text);
	max-width: 960px;
	margin: 0 auto;
}

.aiq-quiz[dir="rtl"] { text-align: right; }

/* ----------------------------------------------------------------
 * Step transitions — smooth fade + slide crossfade between steps
 * ------------------------------------------------------------- */
.aiq-step {
	display: none;
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.38s ease, transform 0.38s ease;
}
.aiq-step.is-active {
	display: block;
	opacity: 1;
	transform: translateY(0);
}
.aiq-step.is-leaving {
	opacity: 0;
	transform: translateY(-18px);
}
.aiq-step.is-entering {
	display: block;
	opacity: 0;
	transform: translateY(18px);
}

/* Back button */
.aiq-back-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: none;
	background: transparent;
	cursor: pointer;
	color: var(--aiq-text);
	font-size: 20px;
	padding: 8px;
	margin-bottom: 12px;
	border-radius: 50%;
	transition: background-color 0.2s ease;
}
.aiq-back-btn:hover { background-color: var(--aiq-gray-bg); }
.aiq-back-btn__text { font-size: 14px; font-weight: 600; }
.aiq-quiz[dir="rtl"] .aiq-back-btn svg,
.aiq-quiz[dir="rtl"] .aiq-back-btn i { transform: scaleX(-1); }

/* Question */
.aiq-question { margin-bottom: 24px; }
.aiq-question__title {
	font-size: 22px;
	font-weight: 700;
	line-height: 1.5;
	text-decoration: underline;
	text-underline-offset: 6px;
	margin: 0 0 12px;
}
.aiq-question__description { color: var(--aiq-muted); }

/* Error message */
.aiq-error-message {
	display: none;
	background: var(--aiq-red-bg);
	color: var(--aiq-red-text);
	border-radius: 10px;
	padding: 12px 16px;
	margin-bottom: 16px;
	font-weight: 600;
}
.aiq-error-message.is-visible { display: block; }
.aiq-error-message.aiq-anim-shake { animation: aiq-shake 0.5s; }
.aiq-error-message.aiq-anim-fade { animation: aiq-fade-in 0.3s; }
.aiq-error-message.aiq-anim-slide { animation: aiq-slide-in 0.3s; }

@keyframes aiq-shake {
	10%, 90% { transform: translateX(-2px); }
	20%, 80% { transform: translateX(4px); }
	30%, 50%, 70% { transform: translateX(-8px); }
	40%, 60% { transform: translateX(8px); }
}
@keyframes aiq-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes aiq-slide-in { from { transform: translateY(-10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.aiq-option.is-shake { animation: aiq-shake 0.5s; }

/* ----------------------------------------------------------------
 * Step 1 — Employee table
 * ------------------------------------------------------------- */
.aiq-table {
	background: var(--aiq-card-bg);
	border: 1px solid var(--aiq-border);
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.aiq-table__header {
	display: flex;
	align-items: center;
	gap: 12px;
	background: #fafaf7;
	padding: 14px 24px;
	border-bottom: 1px solid var(--aiq-border);
	font-size: 13px;
	font-weight: 600;
	color: var(--aiq-muted);
}
.aiq-table__col--name  { flex: 1.6 1 180px; }
.aiq-table__col--role  { flex: 1 1 140px; }
.aiq-table__col--status{ flex: 0.9 1 110px; }
.aiq-table__col--login { flex: 1 1 150px; }
.aiq-table__col--menu  { flex: 0 0 40px; }
.aiq-table__sort { margin-inline-start: 4px; font-size: 11px; }

/* Options table/list */
.aiq-options {
	display: flex;
	flex-direction: column;
}

.aiq-option {
	display: flex;
	align-items: center;
	gap: 12px;
	background: var(--aiq-card-bg);
	padding: 16px 24px;
	cursor: pointer;
	transition: background-color 0.2s ease;
	border-bottom: 1px solid var(--aiq-border);
}
.aiq-options .aiq-option:last-child { border-bottom: none; }
.aiq-option:hover { background-color: #fafafa; }
.aiq-option.is-active { background-color: var(--aiq-green-bg); }
.aiq-option.is-wrong { background-color: var(--aiq-red-bg); }

/* Name cell */
.aiq-option__name-cell {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
	flex: 1.6 1 180px;
}
.aiq-option__role-cell   { flex: 1 1 140px; min-width: 0; }
.aiq-option__status-cell { flex: 0.9 1 110px; min-width: 0; }
.aiq-option__login-cell  { flex: 1 1 150px; min-width: 0; }
.aiq-option__menu-cell   { flex: 0 0 40px; }
.aiq-option__avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}
.aiq-option__body { min-width: 0; }
.aiq-option__name { font-weight: 700; font-size: 14px; }
.aiq-option__subtitle {
	font-size: 12px;
	color: var(--aiq-muted);
	margin-top: 2px;
}

/* Role cell */
.aiq-option__role-cell {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}
.aiq-option__role-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 7px;
	flex-shrink: 0;
	font-size: 13px;
}
.aiq-option__role-icon--purple { background: #f2e9fc; color: #9747ff; }
.aiq-option__role-icon--blue   { background: #e6f0fe; color: #2f6fed; }
.aiq-option__role-icon--teal   { background: #e2f7f3; color: #14a892; }
.aiq-option__role-icon--pink   { background: #fce9f3; color: #d84c9b; }
.aiq-option__position {
	font-size: 13px;
	color: var(--aiq-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Status cell */
.aiq-option__status-cell { min-width: 0; }
.aiq-status-badge {
	display: inline-flex;
	align-items: center;
	font-size: 12px;
	font-weight: 600;
	padding: 4px 12px;
	border-radius: 20px;
	white-space: nowrap;
}
.aiq-status-badge::before {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	margin-inline-end: 6px;
	background: currentColor;
}
.aiq-status-badge--green { background: var(--aiq-green-bg); color: var(--aiq-green); }
.aiq-status-badge--gray { background: var(--aiq-gray-bg); color: var(--aiq-gray-text); }
.aiq-status-badge--red { background: var(--aiq-red-bg); color: var(--aiq-red-text); }
.aiq-status-badge--orange { background: var(--aiq-orange-bg); color: var(--aiq-orange-text); }

/* Last login cell */
.aiq-option__login-cell { min-width: 0; }
.aiq-option__login-time {
	font-size: 13px;
	font-weight: 600;
	color: var(--aiq-text);
	white-space: nowrap;
}
.aiq-option__login-time.is-urgent { color: #e0473e; }
.aiq-option__login-date {
	font-size: 12px;
	color: var(--aiq-muted);
	margin-top: 3px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	white-space: nowrap;
}
.aiq-option__login-date-icon { font-size: 11px; }
.aiq-option__login-note {
	font-size: 11px;
	color: var(--aiq-muted);
	margin-top: 2px;
}

/* Row menu (⋮) */
.aiq-option__menu-cell { display: flex; justify-content: center; }
.aiq-row-menu {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: none;
	background: transparent;
	border-radius: 50%;
	color: var(--aiq-muted);
	font-size: 16px;
	cursor: pointer;
	transition: background-color 0.2s ease;
}
.aiq-row-menu:hover { background-color: var(--aiq-gray-bg); }

/* Step 2: Answer detail screen */
.aiq-step--detail { text-align: center; }
.aiq-detail-intro {
	font-weight: 700;
	font-size: 17px;
	line-height: 1.6;
	margin-bottom: 20px;
}
.aiq-detail-selected-option { margin-bottom: 22px; }
.aiq-detail-selected-option .aiq-option {
	display: flex;
	align-items: center;
	gap: 14px;
	border: 1px solid var(--aiq-border);
	border-radius: 12px;
	padding: 14px 18px;
	cursor: default;
	max-width: 420px;
	margin: 0 auto;
}
.aiq-detail-selected-option .aiq-option:hover { background-color: var(--aiq-card-bg); }
.aiq-detail-selected-option .aiq-option__name-cell { flex: 1; }
.aiq-detail-selected-option .aiq-option__login-cell,
.aiq-detail-selected-option .aiq-option__menu-cell { display: none; }
.aiq-detail-description {
	font-size: 16px;
	line-height: 1.7;
	margin-bottom: 26px;
}
.aiq-detail-description b,
.aiq-detail-description strong { font-weight: 800; }

/* Step 3: Result confirmation card */
.aiq-step--result { text-align: center; }
.aiq-success-card {
	background: var(--aiq-card-bg);
	border: 1px solid var(--aiq-border);
	border-radius: 16px;
	padding: 28px;
	max-width: 420px;
	margin: 0 auto 28px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}
.aiq-success-icon {
	width: 44px;
	height: 44px;
	margin: 0 auto 12px;
	display: block;
}
.aiq-success-icon--default {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--aiq-green-bg);
	color: var(--aiq-green);
	font-size: 22px;
	line-height: 44px;
	text-align: center;
}
.aiq-success-title { color: var(--aiq-green); font-weight: 700; margin-bottom: 18px; }
.aiq-success-amount__label { font-size: 13px; color: var(--aiq-muted); }
.aiq-success-amount__value { font-size: 28px; font-weight: 700; margin: 4px 0 18px; }
.aiq-success-details { border-top: 1px solid var(--aiq-border); padding-top: 12px; }
.aiq-success-details__row {
	display: flex;
	justify-content: space-between;
	padding: 6px 0;
	font-size: 14px;
}
.aiq-success-details__label { color: var(--aiq-muted); }
.aiq-success-details__value { font-weight: 600; }

/* Buttons */
.aiq-btn {
	display: inline-block;
	border: none;
	cursor: pointer;
	background: #1f9d63;
	color: #fff;
	font-weight: 700;
	font-size: 15px;
	padding: 14px 32px;
	border-radius: 30px;
	transition: background-color 0.2s ease;
}
.aiq-btn:hover { background: #17804f; }

.aiq-result-image { max-width: 100%; margin: 0 auto 20px; display: block; }
.aiq-result-title { font-size: 20px; font-weight: 700; margin-bottom: 24px; }
.aiq-result-description { margin-bottom: 20px; color: var(--aiq-muted); }

.aiq-result-cards {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px;
}

.aiq-result-card {
	display: block;
	background: var(--aiq-card-bg);
	border: 1px solid var(--aiq-border);
	border-radius: 14px;
	padding: 20px 16px;
	text-decoration: none;
	color: var(--aiq-text);
	text-align: start;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	cursor: pointer;
}
.aiq-result-card:hover {
	transform: scale(1.05);
	box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}
.aiq-result-card__image { width: 100%; border-radius: 8px; margin-bottom: 10px; }
.aiq-result-card__number { font-size: 12px; color: var(--aiq-muted); margin-bottom: 8px; }
.aiq-result-card__title { font-weight: 700; line-height: 1.4; }
.aiq-result-card__description { font-size: 13px; color: var(--aiq-muted); margin-top: 8px; }

/* Responsive */
@media (max-width: 992px) {
	.aiq-result-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 782px) {
	.aiq-table__header { display: none; }
	.aiq-option {
		flex-wrap: wrap;
		row-gap: 10px;
		padding: 16px;
		position: relative;
	}
	.aiq-option__name-cell { flex: 1 1 100%; order: 1; padding-inline-end: 36px; }
	.aiq-option__menu-cell { position: absolute; inset-inline-end: 12px; top: 14px; order: 2; }
	.aiq-option__role-cell { flex: 1 1 100%; order: 3; }
	.aiq-option__status-cell { flex: 1 1 auto; order: 4; }
	.aiq-option__login-cell { flex: 1 1 auto; order: 5; text-align: end; }
}

@media (max-width: 600px) {
	.aiq-result-cards { grid-template-columns: 1fr; }
	.aiq-question__title { font-size: 18px; }
	.aiq-table__header { padding: 12px 16px; }
}
