/* ==========================================================================
   LangGo Careers — Trang trắc nghiệm MBTI
   ========================================================================== */

/* SVN-Gilroy XBold theo bản thiết kế. Đặt tên họ riêng (không dùng lại tên
   "SVN-Gilroy" mà shell.css đang tham chiếu) để chỉ trang này đổi mặt chữ,
   các trang khác giữ nguyên. */
@font-face {
    font-family: 'SVN Gilroy XBold';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('../fonts/SVN-Gilroy XBold.otf') format('opentype');
}

/* Cuộn mượt khi bấm nút nhảy tới form đăng ký; ai tắt hiệu ứng hệ thống thì
   nhảy thẳng như cũ. */
@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

/* --------------------------------------------------------------------------
   HERO — nền vân rèm đỏ dùng chung với banner Bản tin nội bộ
   -------------------------------------------------------------------------- */
.mbti-hero {
    padding: 54px 0 46px;
    font-family: var(--font-shell);
    background:
        url('../images/ban-tin/bg-curtain.webp') repeat-x center / 260px 100%,
        linear-gradient(180deg, #D01B21 0%, #A00A0E 100%);
}

.mbti-hero__title {
    margin: 0;
    font-family: 'Anton', var(--font-shell);
    font-size: clamp(32px, 3.1vw, 60px);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 1);
}

.mbti-hero__desc {
    max-width: 640px;
    margin: 16px 0 0;
    font-size: clamp(15px, 1.05vw, 18px);
    font-weight: 600;
    line-height: 1.5;
    color: rgba(255, 255, 255, 1);
}

/* --------------------------------------------------------------------------
   TIÊU ĐỀ DÙNG CHUNG
   -------------------------------------------------------------------------- */
.mbti-heading {
    margin: 0 0 18px;
    font-family: var(--font-shell);
    font-size: clamp(22px, 1.9vw, 36px);
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    color: var(--brand);
}

/* Cỡ chữ và cách canh giữa lấy đúng .why-heading của trang chủ */
.mbti-heading--light {
    margin-bottom: 24px;
    font-size: var(--fs-h2);
    font-weight: 800;
    text-align: center;
    color: rgba(255, 255, 255, 1);
}

/* Chữ "MBTI" trong tiêu đề nền đỏ tô vàng cho nổi */
.mbti-heading--light span { color: #FDDA35; }

/* --------------------------------------------------------------------------
   MBTI LÀ GÌ?
   -------------------------------------------------------------------------- */
.mbti-intro {
    padding: 56px 20px 64px;
    font-family: var(--font-shell);
}

.mbti-intro__text {
    max-width: 1180px;
    margin: 0;
    font-size: clamp(15px, 1.05vw, 18px);
    line-height: 1.75;
    color: rgba(34, 34, 34, 1);
}

/* --------------------------------------------------------------------------
   LỢI ÍCH CỦA MBTI — khối đỏ có cạnh trên/dưới bo cong
   -------------------------------------------------------------------------- */
.mbti-benefits {
    position: relative;
    padding: 78px 20px 96px;
    font-family: var(--font-shell);
    /* Ảnh nền trên đè xuống ảnh dưới bao nhiêu px */
    --mbti-bg-overlap: 60px;
    /* Ảnh nền trồi lên trên mép section bao nhiêu px, để cạnh cong của ảnh đè
       lên khối trắng phía trên — giống .why-section ở trang chủ */
    --mbti-bg-rise: 120px;
    /* Ảnh nền thò xuống dưới mép section bao nhiêu px, phủ luôn phần tiêu đề
       "Khám phá vị trí phù hợp". Cho dư một chút cũng không sao: khối đỏ 16
       nhóm nằm lớp trên nên che hết phần thừa. */
    --mbti-bg-drop: 360px;
}

/* Nền ghép hai ảnh xếp dọc, mép dưới ảnh trên phủ lên ảnh dưới --mbti-bg-overlap.
   Chỉ có một ảnh thì ảnh đó phủ kín cả section. */
.mbti-benefits__bg {
    position: absolute;
    top: calc(var(--mbti-bg-rise) * -1);
    right: 0;
    bottom: calc(var(--mbti-bg-drop) * -1);
    left: 0;
    z-index: 0;
    display: flex;
    flex-direction: column;
    /* Ảnh trên giữ nguyên tỉ lệ nên có thể dài hơn section — cắt phần thừa */
    overflow: hidden;
    pointer-events: none;
}

.mbti-benefits__bg img {
    width: 100%;
    min-height: 0;
    object-fit: cover;
    display: block;
}

/* Giữ đúng tỉ lệ gốc để đường cong ở mép trên hiện y như trang chủ, không bị
   ép dẹp khi section ngắn hơn section "Vì sao nên chọn LangGo?" */
.mbti-benefits__bg-top {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    height: auto;
    object-position: center top;
}

/* Ảnh dưới ăn hết phần chiều cao còn lại của section */
.mbti-benefits__bg-bottom {
    flex: 1 1 auto;
    margin-top: calc(var(--mbti-bg-overlap) * -1);
    object-position: center bottom;
}

.mbti-benefits > .shell {
    position: relative;
    z-index: 1;
}

.mbti-benefits__text {
    max-width: 900px;
    margin: 0 auto 56px;
    font-size: clamp(15px, 1.05vw, 18px);
    line-height: 1.7;
    text-align: center;
    color: rgba(255, 255, 255, 1);
}

/* --------------------------------------------------------------------------
   4 THẺ LỢI ÍCH — mượn nguyên hình dáng card của section "Vì sao nên chọn
   LangGo?" ở trang chủ: bo 26px ba góc, huy hiệu tròn đè mép trên, tiêu đề
   gradient đỏ in hoa. Khác một điểm: huy hiệu ở đây là hình minh hoạ nhiều màu
   nên nền trắng, không tô trắng glyph như bên why.
   -------------------------------------------------------------------------- */
.mbti-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 74px 24px;
    max-width: 1293px;
    margin-inline: auto;
}

.mbti-card {
    position: relative;
    flex: 0 0 520px;
    max-width: 100%;
    padding: 64px 32px 30px;
    border-radius: 26px 26px 26px 0;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 20px 0 rgba(0, 0, 0, .25);
    text-align: center;
    transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}

.mbti-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 14px 34px 0 rgba(0, 0, 0, .3);
}

.mbti-card__icon {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 1);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 2px 7.2px 0 rgba(0, 0, 0, .25);
    overflow: hidden;
}

.mbti-card__icon img {
    width: 74px;
    height: 74px;
    object-fit: contain;
}

.mbti-card__title {
    margin: 0 0 16px;
    padding-top: .08em;
    font-size: var(--fs-h3);
    font-weight: 700;
    line-height: 1.15;
    text-transform: uppercase;
    background: linear-gradient(180deg, #DB1F1F 0%, #9D0B0F 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.mbti-card__text {
    margin: 0;
    font-size: var(--fs-body);
    font-weight: 500;
    line-height: 23px;
    color: rgba(0, 0, 0, 1);
}

@media (max-width: 991px) {
    /* Hai ảnh nền ghép dọc giữ nguyên tỉ lệ gốc (khổ 1920) nên co về bề ngang
       điện thoại là chỉ còn cao vài trăm px: phần trên section mất nền đỏ và
       chữ trắng biến mất. Thay bằng gradient đỏ brand, giống cách why-section
       và process-section đang làm. */
    .mbti-benefits__bg { display: none; }

    .mbti-benefits {
        padding: 64px 16px 72px;
        background: linear-gradient(180deg, #DB1F1F 0%, #9D0B0F 100%);
    }

    .mbti-cards { gap: 66px 20px; }
    .mbti-card { flex: 0 0 100%; padding: 60px 24px 26px; }
    .mbti-card__title { font-size: 22px; }
}

@media (max-width: 768px) {
    .mbti-hero { padding: 34px 0 30px; }
    .mbti-intro { padding: 36px 20px 40px; }
}

/* --------------------------------------------------------------------------
   KHÁM PHÁ VỊ TRÍ PHÙ HỢP — tiêu đề trên nền trang, 16 nhóm trên nền đỏ
   -------------------------------------------------------------------------- */
.mbti-types { font-family: var(--font-shell); }

/* Nằm trên phần nền thò xuống của khối lợi ích */
.mbti-types__head {
    position: relative;
    z-index: 1;
    padding: 56px 20px 40px;
    text-align: center;
}

/* Thiết kế ghi 80px ở bản 1920px, thu lại cho cân với phần còn lại của trang */
.mbti-types__title {
    margin: 0;
    padding-bottom: .12em;
    font-family: 'SVN Gilroy XBold', var(--font-shell);
    font-size: clamp(26px, 3.125vw, 60px);
    font-weight: 800;
    line-height: 100%;
    letter-spacing: 0;
    text-transform: uppercase;
    background: linear-gradient(180deg, #DB1F1F 0%, #9D0B0F 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.mbti-types__title span { display: block; }

/* Dòng 2 thiết kế ghi line-height 100px trên cỡ chữ 80px */
.mbti-types__title span + span { line-height: 1.25; }

.mbti-types__sub {
    /* Thiết kế ghi Inter 500; project chưa self-host Inter nên dùng Reddit Sans
       (cùng nhóm grotesque) như các section khác. */
    margin: 10px 0 0;
    font-size: clamp(14px, 1.25vw, 24px);
    font-weight: 500;
    line-height: 100%;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--brand);
}

.mbti-types__sub span { display: block; }

/* Dòng 2: line-height 49px trên cỡ chữ 24px, chữ tô gradient đỏ */
.mbti-types__sub span + span {
    line-height: 2.04;
    background: linear-gradient(180deg, #DB1F1F 0%, #9D0B0F 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* Gạch ngang mảnh với 3 viên kim cương ở giữa như bản thiết kế */
.mbti-types__rule {
    position: relative;
    display: block;
    width: min(340px, 70%);
    height: 1px;
    margin: 26px auto 0;
    /* Chừa khoảng trống giữa bằng gradient thay vì lấy màu nền che — nền ở đây
       là ảnh nên một mảng màu đặc sẽ lộ rõ. */
    background: linear-gradient(
        90deg,
        rgba(186, 0, 0, .45) 0 41%,
        transparent 41% 59%,
        rgba(186, 0, 0, .45) 59% 100%
    );
}

.mbti-types__rule::after {
    content: '◆ ◆ ◆';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--brand);
}

/* z-index để nền đỏ của khối này che phần ảnh nền thò xuống quá tay */
.mbti-types__body {
    position: relative;
    z-index: 1;
    padding: 54px 20px 60px;
    background:
        url('../images/ban-tin/bg-curtain.webp') repeat-x center / 260px 100%,
        linear-gradient(180deg, #D01B21 0%, #A00A0E 100%);
}

/* --------------------------------------------------------------------------
   16 NHÓM TÍNH CÁCH — 6 / 6 / 4 thẻ mỗi hàng, hàng cuối canh giữa
   -------------------------------------------------------------------------- */
.mbti-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 26px 22px;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

.mbti-type {
    /* 6 thẻ một hàng ở khổ 1120px; thu nhỏ dần chứ không vỡ hàng sớm */
    flex: 0 0 calc((100% - 5 * 22px) / 6);
    max-width: 160px;
    text-align: center;
    color: rgba(255, 255, 255, 1);
}

.mbti-type__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 10px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .18);
}

/* Ảnh nhân vật cao thấp khác nhau nên khoá chiều cao để mọi thẻ bằng nhau */
.mbti-type__card img {
    width: auto;
    height: 92px;
    object-fit: contain;
    object-position: bottom center;
}

.mbti-type__code {
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .5px;
    color: var(--brand);
}

.mbti-type__name {
    display: block;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.mbti-type__vi {
    display: block;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.3;
    opacity: .92;
}

/* --------------------------------------------------------------------------
   NÚT BẮT ĐẦU
   -------------------------------------------------------------------------- */
.mbti-types__cta {
    margin-top: 40px;
    text-align: center;
}

/* Nút bắt đầu làm trắc nghiệm */
.mbti-start {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Thiết kế ghi 626x77 ở bản 1920px, thu lại ~17% cho cân với khối bên trên */
    width: clamp(260px, 27.1vw, 520px);
    max-width: 100%;
    height: clamp(48px, 3.33vw, 64px);
    padding: 0 20px;
    border: 2px solid rgba(255, 255, 255, 1);
    border-radius: 158px;
    background: linear-gradient(180deg, #F5801C 0%, #E54509 100%);
    box-shadow:
        7px 6px 8.1px 0 rgba(0, 0, 0, .25) inset,
        6px 14px 13.9px 1px rgba(0, 0, 0, .16);
    color: rgba(255, 255, 255, 1);
    font-family: 'SVN Gilroy XBold', var(--font-shell);
    font-size: clamp(16px, 1.72vw, 33px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
    text-align: center;
    text-transform: uppercase;
    text-decoration: none;
    transition: transform .18s var(--ease), filter .18s var(--ease);
}

.mbti-start:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
    color: rgba(255, 255, 255, 1);
}

.mbti-types__note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 18px 0 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: rgba(255, 255, 255, .9);
}

.mbti-types__dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .7);
}

@media (max-width: 992px) {
    .mbti-type { flex: 0 0 calc((100% - 3 * 22px) / 4); }
}

@media (max-width: 600px) {
    .mbti-types__head { padding: 36px 20px 28px; }
    .mbti-types__body { padding: 36px 16px 44px; }
    .mbti-grid { gap: 18px 14px; }
    .mbti-type { flex: 0 0 calc((100% - 2 * 14px) / 3); }
    .mbti-type__card img { height: 70px; }
    .mbti-start { width: 100%; max-width: 320px; }
}

/* --------------------------------------------------------------------------
   BẮT ĐẦU TEST — form đăng ký trước khi vào bài trắc nghiệm
   -------------------------------------------------------------------------- */
/* Nút "Bắt đầu làm trắc nghiệm" nhảy xuống đây; chừa chỗ cho header dính trên */
.mbti-start-test {
    position: relative;
    scroll-margin-top: 100px;
    padding: 60px 20px 72px;
    font-family: var(--font-shell);
    text-align: center;
}

/* Dùng lại đúng ảnh nền dưới của khối "Lợi ích của MBTI" */
.mbti-start-test__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom;
    pointer-events: none;
}

.mbti-start-test > .shell {
    position: relative;
    z-index: 1;
}

/* Bản thiết kế 1920px: SVN-Gilroy XBold 48px */
.mbti-start-test__title {
    margin: 0;
    font-family: 'SVN Gilroy XBold', var(--font-shell);
    padding-bottom: .12em;
    font-size: clamp(24px, 2.5vw, 48px);
    font-weight: 800;
    line-height: 100%;
    letter-spacing: 0;
    text-transform: uppercase;
    background: linear-gradient(180deg, #DB1F1F 0%, #9D0B0F 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.mbti-start-test__desc {
    margin: 18px 0 0;
    font-size: clamp(14px, 1vw, 17px);
    line-height: 1.7;
    color: rgba(40, 40, 40, 1);
}

.mbti-start-test__lead {
    margin: 18px 0 0;
    font-size: clamp(14px, 1vw, 17px);
    font-weight: 700;
    line-height: 1.5;
    color: rgba(20, 20, 20, 1);
}

.mbti-form-card {
    max-width: 900px;
    margin: 30px auto 0;
    padding: 44px 60px 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .12);
}

.mbti-form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 30px;
}

.mbti-form__input {
    width: 100%;
    height: 46px;
    padding: 0 22px;
    border: 1px solid var(--brand);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 1);
    font-family: var(--font-shell);
    font-size: 15px;
    color: rgba(30, 30, 30, 1);
    outline: none;
    transition: box-shadow .18s var(--ease), border-color .18s var(--ease);
}

.mbti-form__input::placeholder { color: rgba(130, 130, 130, 1); }

.mbti-form__input:focus { box-shadow: 0 0 0 3px rgba(186, 0, 0, .12); }

/* Ô thiếu dữ liệu được tô đậm viền để người dùng thấy ngay chỗ cần sửa */
.mbti-form__input.is-invalid {
    border-color: #D01B21;
    box-shadow: 0 0 0 3px rgba(208, 27, 33, .16);
}

.mbti-form__submit { margin-top: 30px; }

.mbti-form__alert {
    margin-bottom: 18px;
    padding: 12px 18px;
    border-radius: 10px;
    background: rgba(186, 0, 0, .08);
    font-size: 15px;
    line-height: 1.5;
    color: var(--brand);
}

@media (max-width: 700px) {
    .mbti-start-test { padding: 40px 16px 48px; }
    .mbti-form-card { padding: 28px 20px 32px; }
    .mbti-form__grid { grid-template-columns: 1fr; gap: 16px; }
    .mbti-start-test__desc br { display: none; }
}
