/**
 * ETA Forms — section ĐĂNG KÝ EXTERNSHIP.
 * Tự chứa, scoped dưới .eta-form-section / .eta-modal, không phụ thuộc theme.
 * Token màu bám thiết kế Figma "TCP x VOCO – Form_Update 08/2026".
 */

.eta-form-section,
.eta-modal {
	--eta-primary: #4f46e5;
	--eta-primary-dark: #4338ca;
	--eta-heading: #0a0e49;
	--eta-text: #1f2937;
	--eta-muted: #6b7280;
	--eta-border: #e5e7eb;
	--eta-error: #ef4444;
	--eta-danger: #dc2626;
	--eta-link: #6366f1;
	--eta-note: #ea580c;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
	color: var(--eta-text);
	box-sizing: border-box;
}

.eta-form-section *,
.eta-form-section *::before,
.eta-form-section *::after,
.eta-modal *,
.eta-modal *::before,
.eta-modal *::after {
	box-sizing: inherit;
}

/* Các element có display riêng (flex…) vẫn phải tôn trọng attribute hidden. */
.eta-form-section [hidden],
.eta-modal [hidden],
.eta-modal[hidden] {
	display: none !important;
}

/* Reset style button toàn cục của theme (Flatsome đặt margin-bottom 14px,
 * min-height 35px, line-height lớn cho mọi <button>) — nếu không, chữ trong
 * các nút ghost bị lệch dọc so với vạch ngăn cách. */
.eta-form-section button,
.eta-modal button {
	margin: 0;
	min-height: 0;
	height: auto;
	line-height: 1.4;
	text-transform: none;
	letter-spacing: normal;
	font-family: inherit;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* ---------------------------------------------------------------------
 * Layout section: gradient dọc trắng → tím nhạt → trắng, ảnh trái / form phải
 * ------------------------------------------------------------------- */

.eta-form-section {
	position: relative;
	display: flex;
	align-items: center; /* cột nội dung căn giữa dọc so với ảnh minh họa */
	gap: 48px;
	padding: 64px 0 96px;
	background: transparent; /* dùng nền của trang, không tự vẽ gradient */
	/* Không đặt overflow:hidden ở đây — nó vô hiệu hóa position:sticky của ảnh. */
}

.eta-form-section__media {
	flex: 0 0 42%;
	max-width: 610px;
	align-self: stretch;
	margin-top: 16px;
}

.eta-form-section__media img {
	display: block;
	width: 100%;
	max-width: 100%;
	/* Giữ nguyên kích thước ảnh, KHÔNG scale theo chiều cao form;
	 * sticky để ảnh đi theo khi cuộn các bước dài. */
	height: auto;
	max-height: min(720px, calc(100vh - 48px));
	object-fit: cover;
	object-position: top;
	border-radius: 0 0 190px 0;
	position: sticky;
	top: 24px;
}

.eta-form-section__content {
	flex: 1 1 auto;
	min-width: 0;
	max-width: 720px;
	/* Màn hình rộng: form nằm gần ảnh, khoảng trống dư dồn về bên phải */
	margin-right: auto;
	padding: 0 24px;
}

.eta-form-section--no-media .eta-form-section__content {
	max-width: 880px;
	padding: 0 clamp(16px, 5vw, 90px);
}

.eta-form-section__title {
	margin: 0 0 20px;
	font-size: 35px;
	line-height: 1.2;
	font-weight: 800;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	color: var(--eta-heading);
}

.eta-form-section__desc {
	margin: 0 0 28px;
	font-size: 15px;
	line-height: 1.6;
	color: var(--eta-text);
}

/* ---------------------------------------------------------------------
 * Card + stepper
 * ------------------------------------------------------------------- */

.eta-card {
	background: #fff;
	border-radius: 20px;
	padding: 40px;
	box-shadow: 0 12px 40px rgba(79, 70, 229, 0.08);
}

.eta-stepper {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 28px;
	padding: 0;
	list-style: none;
}

.eta-stepper__item {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1 1 0;
	min-width: 0;
	/* Flatsome gán margin trái 1.3em cho li — ép về 0 trong stepper */
	margin: 0 !important;
	margin-inline-start: 0 !important;
	padding: 0;
	list-style: none;
}

/* Bước cuối không có đường nối nên không cần giãn hết hàng */
.eta-stepper__item:last-child {
	flex: 0 0 auto;
}

.eta-stepper__num {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 999px;
	background: var(--eta-primary);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
}

.eta-stepper__label {
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: #111827;
	white-space: nowrap;
}

.eta-stepper__line {
	flex: 1 1 auto;
	height: 1px;
	background: var(--eta-border);
	min-width: 16px;
}

.eta-stepper__item.is-upcoming .eta-stepper__num {
	opacity: 0.5;
}

.eta-stepper__item.is-upcoming .eta-stepper__label {
	color: var(--eta-muted);
	font-weight: 600;
}

/* ---------------------------------------------------------------------
 * Fields
 * ------------------------------------------------------------------- */

.eta-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 24px;
	row-gap: 20px;
}

.eta-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.eta-field__label {
	font-size: 14px;
	font-weight: 500;
	color: var(--eta-text);
	line-height: 1.45;
}

.eta-req {
	color: var(--eta-error);
}

.eta-field__control {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.eta-form input[type='text'],
.eta-form input[type='tel'],
.eta-form input[type='email'],
.eta-form select,
.eta-form textarea {
	width: 100%;
	margin: 0;
	background: #fff;
	border: 1px solid var(--eta-border);
	border-radius: 8px;
	padding: 8px 12px;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.5;
	color: var(--eta-text);
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	appearance: none;
	-webkit-appearance: none;
	height: auto;
	max-width: 100%;
}

.eta-form input::placeholder,
.eta-form textarea::placeholder {
	color: var(--eta-muted);
	opacity: 1;
}

.eta-form input:focus,
.eta-form select:focus,
.eta-form textarea:focus {
	outline: none;
	border-color: var(--eta-primary);
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.eta-form input:disabled {
	background: #f9fafb;
	color: var(--eta-muted);
	cursor: not-allowed;
}

.eta-form textarea {
	min-height: 76px;
	resize: vertical;
}

.eta-select {
	position: relative;
	display: block;
}

.eta-select::after {
	content: '';
	position: absolute;
	top: 50%;
	right: 12px;
	width: 16px;
	height: 16px;
	transform: translateY(-50%);
	pointer-events: none;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat center / contain;
}

.eta-select select {
	padding-right: 36px;
}

.eta-select select:invalid,
.eta-select select option[value=''] {
	color: var(--eta-muted);
}

.eta-field__error {
	display: none;
	font-size: 12px;
	line-height: 1.4;
	color: var(--eta-error);
}

.eta-field--invalid .eta-field__error {
	display: block;
}

.eta-field--invalid input,
.eta-field--invalid select,
.eta-field--invalid textarea {
	border-color: var(--eta-error);
}

/* Label bên trái (câu hỏi tự luận / chọn công việc của nguyện vọng) */

.eta-field--label-left {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr)); /* label và control chia 50:50 */
	column-gap: 20px;
	align-items: start;
}

.eta-field--label-left .eta-field__label {
	padding-top: 8px;
	display: flex;
	justify-content: space-between;
	gap: 6px;
}

/* Checkbox điều khoản */

.eta-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	cursor: pointer;
	font-weight: 400;
}

.eta-checkbox input[type='checkbox'] {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	margin: 2px 0 0;
	accent-color: var(--eta-primary);
	cursor: pointer;
}

.eta-checkbox__text {
	font-size: 13px;
	line-height: 1.55;
	color: #4b5563;
}

/* ---------------------------------------------------------------------
 * Steps, nav ghost buttons
 * ------------------------------------------------------------------- */

.eta-step__desc {
	margin: 0 0 20px;
	font-size: 14px;
	line-height: 1.6;
	color: var(--eta-text);
}

.eta-nav {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	margin-top: 28px;
}

.eta-nav__btn {
	background: none;
	border: 0;
	padding: 6px 14px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	color: var(--eta-muted);
	cursor: pointer;
	border-radius: 6px;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.eta-nav__btn:hover:not(:disabled) {
	color: var(--eta-text);
	background: #f3f4f6;
}

.eta-nav__btn--next {
	color: #374151;
	font-weight: 600;
}

.eta-nav__btn:disabled {
	color: #d1d5db;
	cursor: default;
}

.eta-nav__sep {
	width: 1px;
	height: 20px;
	background: var(--eta-border);
	margin: 0 4px;
}

.eta-actions {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 12px;
	margin-top: 28px;
}

/* ---------------------------------------------------------------------
 * Buttons
 * ------------------------------------------------------------------- */

.eta-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	border: 1px solid transparent;
	padding: 9px 18px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.eta-btn--primary {
	background: var(--eta-primary);
	color: #fff;
}

.eta-btn--primary:hover {
	background: var(--eta-primary-dark);
	color: #fff;
}

.eta-btn--primary:disabled {
	opacity: 0.6;
	cursor: wait;
}

.eta-btn--outline {
	background: #fff;
	border-color: var(--eta-border);
	color: #111827;
	font-weight: 500;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.eta-btn--outline:hover {
	border-color: #d1d5db;
	color: #111827;
}

.eta-btn--danger {
	background: var(--eta-danger);
	color: #fff;
}

.eta-btn--danger:hover {
	background: #b91c1c;
	color: #fff;
}

/* ---------------------------------------------------------------------
 * Bước 2 nhánh A: danh sách JD + nguyện vọng
 * ------------------------------------------------------------------- */

.eta-jobs {
	margin-bottom: 8px;
}

.eta-jobs__title {
	margin: 0 0 10px;
	font-size: 14px;
	font-weight: 700;
	color: #111827;
}

.eta-jobs__list {
	margin: 0;
	padding: 0 0 0 8px;
	list-style: none;
}

.eta-jobs__list li {
	margin: 0 0 8px;
}

.eta-jobs__list a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--eta-link);
	text-decoration: none;
}

.eta-jobs__list a:hover {
	color: var(--eta-primary);
	text-decoration: underline;
}

/* Công việc không có link JD: chỉ hiện tên */
.eta-jobs__plain {
	font-size: 14px;
	font-weight: 600;
	color: var(--eta-text);
}

.eta-icon {
	flex: 0 0 auto;
}

.eta-wish {
	margin: 24px 0 0;
	padding: 0;
	border: 0;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

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

.eta-wish__legend {
	margin: 0;
	padding: 0;
	font-size: 15px;
	font-weight: 700;
	color: #111827;
	float: none;
	width: auto;
	text-transform: none;
	letter-spacing: normal;
	white-space: nowrap;
	border-bottom: 0; /* Flatsome gán border-bottom 1px #f1f1f1 cho legend */
}

.eta-wish__line {
	flex: 1 1 auto;
	height: 1px;
	background: var(--eta-border);
}

/* Cặp nút ↓↑ đổi thứ tự — button group bo góc 2 đầu */

.eta-swap {
	display: inline-flex;
}

.eta-swap__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 7px; /* icon 14px + 7px mỗi phía = ô vuông 28x28 như thiết kế */
	background: #fff;
	border: 1px solid var(--eta-border);
	color: var(--eta-muted);
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.eta-swap__btn:first-child {
	border-radius: 8px 0 0 8px;
}

.eta-swap__btn:last-child {
	border-radius: 0 8px 8px 0;
	margin-left: -1px;
}

.eta-swap__btn:hover:not(:disabled) {
	background: #f3f4f6;
	color: var(--eta-text);
}

.eta-swap__btn:disabled {
	color: #d1d5db;
	cursor: default;
}

/* ---------------------------------------------------------------------
 * Bước 3 nhánh A: upload CV
 * ------------------------------------------------------------------- */

.eta-upload {
	background: #f3f4f6;
	border-radius: 12px;
	padding: 40px 24px;
	text-align: center;
	margin-bottom: 20px;
}

.eta-upload__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 10px;
	background: #fff;
	color: #111827;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
	margin-bottom: 12px;
}

.eta-upload__title {
	margin: 0 0 6px;
	font-size: 16px;
	font-weight: 700;
	color: var(--eta-primary);
}

.eta-upload__hint {
	margin: 0 0 16px;
	font-size: 14px;
	color: var(--eta-muted);
}

.eta-upload__filename {
	display: inline-block;
	margin: 4px 0 16px;
	padding: 6px 14px;
	background: #fff;
	border: 1px solid var(--eta-border);
	border-radius: 8px;
	font-size: 14px;
	color: var(--eta-text);
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.eta-upload__actions {
	display: flex;
	justify-content: center;
	gap: 10px;
	flex-wrap: wrap;
}

.eta-upload .eta-field__error {
	display: none;
	margin-top: 10px;
}

.eta-upload.eta-field--invalid .eta-field__error {
	display: block;
}

.eta-field--checkbox {
	margin-bottom: 4px;
}

.eta-step[data-step='timing'] .eta-field {
	margin-bottom: 18px;
}

.eta-form__submit-error {
	margin: 16px 0 0;
	font-size: 13px;
	color: var(--eta-error);
	text-align: right;
}

/* ---------------------------------------------------------------------
 * Modal kết quả
 * ------------------------------------------------------------------- */

.eta-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.eta-modal[hidden] {
	display: none;
}

.eta-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.45);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.eta-modal__card {
	position: relative;
	background: #fff;
	border-radius: 20px;
	max-width: 800px;
	width: 100%;
	padding: 56px 64px;
	box-shadow: 0 24px 64px rgba(15, 23, 42, 0.25);
	max-height: calc(100vh - 40px);
	overflow: auto;
}

.eta-modal__close {
	position: absolute;
	top: 24px;
	right: 24px;
	background: none;
	border: 0;
	padding: 6px;
	color: #111827;
	cursor: pointer;
	line-height: 0;
	border-radius: 6px;
}

.eta-modal__close:hover {
	background: #f3f4f6;
}

.eta-modal__icon {
	display: inline-flex;
	color: #4776f6;
	margin-bottom: 20px;
}

.eta-modal__title {
	margin: 0 0 20px;
	font-size: 35px;
	line-height: 1.2;
	font-weight: 800;
	text-transform: uppercase;
	color: var(--eta-heading);
}

.eta-modal__card p {
	margin: 0 0 16px;
	font-size: 16px;
	line-height: 1.65;
	color: var(--eta-text);
}

.eta-modal__card p:last-child {
	margin-bottom: 0;
}

.eta-modal__card p.eta-modal__strong {
	font-weight: 700;
}

.eta-modal__strong a {
	color: inherit;
	text-decoration: underline;
}

.eta-modal__card p.eta-modal__note {
	color: var(--eta-note);
	font-weight: 700;
}

/* ---------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------- */

@media (max-width: 1100px) {
	.eta-form-section {
		gap: 32px;
	}

	.eta-form-section__media {
		flex-basis: 36%;
	}
}

@media (max-width: 900px) {
	.eta-form-section {
		display: block;
		padding: 40px 0 64px;
	}

	/* Mobile: 1 cột, ảnh minh họa full-width nằm trên nội dung */
	.eta-form-section__media {
		flex-basis: auto;
		max-width: none;
		margin: 0 0 28px;
	}

	.eta-form-section__media img {
		width: 100%;
		height: auto;
		max-height: 360px;
		object-fit: cover;
		object-position: top;
		border-radius: 0 0 120px 0;
		position: static; /* mobile 1 cột: không sticky */
	}

	.eta-form-section__content {
		padding: 0;
		max-width: 640px;
		margin: 0 auto;
	}

	.eta-form-section--no-media .eta-form-section__content {
		padding: 0 20px;
	}

	.eta-form-section__title {
		font-size: 26px;
	}

	.eta-card {
		padding: 24px 20px;
		border-radius: 16px;
	}

	.eta-grid {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 16px;
	}

	/* Stepper mobile: chỉ hiện label của bước hiện tại, các bước khác chỉ còn
	 * số tròn nằm sát nhau — đủ chỗ cho label dù có 3 bước. */
	.eta-stepper {
		flex-wrap: nowrap;
		gap: 8px;
	}

	.eta-stepper__item {
		flex: 0 0 auto;
		gap: 8px;
	}

	.eta-stepper__item .eta-stepper__label,
	.eta-stepper__item .eta-stepper__line {
		display: none;
	}

	.eta-stepper__item.is-current {
		flex: 1 1 auto;
	}

	.eta-stepper__item.is-current .eta-stepper__label {
		display: inline;
		font-size: 12px;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.eta-stepper__item.is-current .eta-stepper__line {
		display: block;
		min-width: 10px;
	}

	.eta-field--label-left {
		display: flex;
		flex-direction: column;
		align-items: stretch; /* đè align-items:start của grid desktop để textarea full width */
	}

	.eta-field--label-left .eta-field__label {
		padding-top: 0;
	}

	.eta-modal__card {
		padding: 48px 24px 32px;
	}

	.eta-modal__title {
		font-size: 24px;
	}

	.eta-modal__card p {
		font-size: 15px;
	}
}
