/*
 * Quote form (design/quote-form.php, itx_quote_embed): CTA panel (title + "Đặt lịch tư vấn" button) on the page, the form (3-step: progress bar, option cards,
 * contact fields; or single step: field grid; both from design/quote-templates.json) / thank-you card in a popup (<dialog>, opened by quote.js). Same palette / typography as blog.css (loaded first: the variables come
 * from .itx-blog), scoped under .itx-q* so Flatsome's CSS is only overridden here. quote.js (form.is-js) shows one step at a time.
 */

/* ---------- popup header band (logo) + form intro (title, text) ---------- */
.itx-q-head { padding: 22px 76px 22px clamp(20px, 4vw, 48px); border-radius: 24px 24px 0 0; background: linear-gradient(135deg, var(--b7), var(--b) 60%, #0A63BC); }
.itx-q-head img { display: block; max-width: none; margin: 0; border-radius: 0; }   /* size = inline style (Flatsome resets img height) */
.itx-q-modal .itx-q-embed { display: flow-root; border-radius: 0 0 24px 24px; background: #fff; }   /* the dialog itself is transparent: no white fringe around the header band's rounded corners */
.itx-q-intro { margin: 0 0 24px; }
.itx-q .itx-q-intro .itx-q-intro-t { margin: 0; font-size: clamp(22px, 2.4vw, 28px); font-weight: 700; line-height: 1.25; letter-spacing: -.02em; color: var(--ink); }
.itx-q .itx-q-intro .itx-q-intro-s { margin: 6px 0 0; font-size: 15px; line-height: 1.6; color: var(--text); }

/* ---------- form / thank-you (inside the popup) ---------- */
.itx-q-form { position: relative; padding: 32px clamp(20px, 4vw, 48px) clamp(24px, 3vw, 36px); }
.itx-q-modal:has(.itx-q-thanks) { width: min(560px, 100% - 32px); }
.itx-q-thanks { padding: 40px clamp(24px, 4vw, 40px); text-align: center;  background: linear-gradient(180deg, #E9F2FC, #F6FAFE); }
.itx-q-tick { width: 56px; height: 56px; margin-bottom: 16px; fill: var(--b7); stroke: #fff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.itx-q-tick circle { stroke: none; }
.itx-q-tick path { fill: none; }
.itx-q-modal .itx-q-embed .itx-q-thanks h2 { margin: 0; font-size: clamp(24px, 3vw, 30px); }   /* beats the page article's `.itx-post-body h2` margins */
.itx-q-modal .itx-q-embed .itx-q-thanks p { margin: 10px 0 18px; font-size: 16.5px; line-height: 1.6; }

/* progress bar: 3 cells, done = dark blue, current = blue with a gradient underline */
.itx-q-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 28px; padding: 0; list-style: none; counter-reset: itx-q; }
.itx-q-steps li { position: relative; display: flex; align-items: center; gap: 10px; padding: 0 0 12px; border-bottom: 3px solid var(--line); font-size: 13.5px; font-weight: 600; color: #9AA9BD; counter-increment: itx-q; transition: color .3s; }
.itx-q-steps li::before { content: counter(itx-q); display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--ice); color: #5F7188; font-size: 13px; transition: background-color .3s, color .3s; }
.itx-q-steps li::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--b7), var(--b) 55%, #0A63BC); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); }
.itx-q-steps li.is-done { color: var(--b7); }
.itx-q-steps li.is-done::before { background: var(--b7); color: #fff; }
.itx-q-steps li.is-current { color: var(--b); }
.itx-q-steps li.is-current::before { background: var(--b); color: #fff; box-shadow: 0 0 0 4px rgba(2, 79, 158, .16); }
.itx-q-steps li.is-current::after { transform: scaleX(1); }

.itx-q-error { margin: 0 0 22px; padding: 12px 16px; border-radius: 12px; border: 1px solid rgba(214, 69, 69, .25); background: #FDEDED; color: #B42318; font-size: 14.5px; font-weight: 500; line-height: 1.5; }
.itx-q-msg { display: block; margin-top: 8px; font-size: 12.5px; font-weight: 500; color: #B42318; }

/* steps (fieldset) */
.itx-q-step { min-width: 0; margin: 0 0 32px; padding: 0; border: 0; }
.itx-q-step legend { display: block; width: 100%; margin: 0 0 22px; padding: 0; font-size: clamp(19px, 2vw, 23px); font-weight: 700; line-height: 1.3; letter-spacing: -.02em; color: var(--ink); }
.is-js .itx-q-step:not(.is-active) { display: none; }
.is-js .itx-q-step.is-active { animation: itx-q-in .4s var(--ease); }
@keyframes itx-q-in { from { opacity: 0; transform: translateY(10px); } }
.itx-q-field { margin-bottom: 26px; }
.itx-q-field:last-child { margin-bottom: 0; }
.itx-q .itx-q-label { margin: 0 0 12px; font-size: 15.5px; font-weight: 600; line-height: 1.5; color: var(--ink); }

/* option cards: the radio stays in the tab order but is visually hidden, the card shows the state */
.itx-q-opt { position: relative; display: flex; align-items: flex-start; gap: 14px; margin: 0 0 10px; padding: 14px 18px 14px 16px; border-radius: 16px; border: 1.5px solid var(--line); background: #fff; font-weight: 500; line-height: 1.5; color: var(--ink); cursor: pointer; transition: border-color .25s, background-color .25s, box-shadow .25s; }
.itx-q-opt:hover { border-color: var(--b); background: var(--bg); }
.itx-q-opt input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.itx-q-opt > span { flex: 1; font-size: 15px; }
.itx-q-opt > span::before { content: ""; float: left; width: 20px; height: 20px; margin: 1px 12px 0 0; border-radius: 50%; border: 2px solid #C5D2E2; background: #fff; transition: border-color .25s, box-shadow .25s; }
.itx-q-opt small { display: block; margin-top: 4px; font-size: 13px; font-weight: 400; line-height: 1.55; color: var(--text); }
.itx-q-opt:has(input:checked) { border-color: var(--b); background: var(--bg); box-shadow: 0 10px 24px rgba(2, 79, 158, .1); }
.itx-q-opt input:checked + span::before { border-color: var(--b); box-shadow: inset 0 0 0 5px var(--b); }   /* sibling selector: works without :has() */
.itx-q-opt:has(input:focus-visible) { outline: 2px solid var(--sky); outline-offset: 2px; }

/* text inputs (industry "other" + contact) */
.itx-q-input { display: block; margin: 0 0 14px; }
.itx-q-input > span, .itx-q-input > label > span { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 600; color: var(--ink); }
.itx-q-input b { color: #D64545; font-weight: 600; }
.itx-q-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.itx-q-grid .itx-q-label { grid-column: 1 / -1; }
.itx-q-grid .itx-q-input { grid-column: 1 / -1; }
.itx-q-grid .itx-q-input.is-half { grid-column: auto; }
.itx-q-field :is(input[type=text], input[type=tel], input[type=email], select, textarea) { display: block; width: 100%; height: 48px; margin: 0; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; box-shadow: none; font-family: inherit; font-size: 15px; color: var(--ink); transition: border-color .25s, box-shadow .25s; }
.itx-q-field :is(input[type=text], input[type=tel], input[type=email], select, textarea):focus { outline: 0; border-color: var(--b); box-shadow: 0 0 0 3px rgba(140, 195, 250, .45); }
.itx-q-field textarea { height: auto; min-height: 120px; padding: 12px 16px; resize: vertical; }
.itx-q-field select { appearance: none; padding-right: 44px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239AA9BD' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 14px center / 20px no-repeat; }
.itx-q-field select:invalid { color: #9AA9BD; }
.itx-q-field .itx-q-other::placeholder { color: #9AA9BD; }
.itx-q-field input.itx-q-other { display: none; }   /* the free-text input of an option ("Khác") shows only while that option is chosen */
.itx-q-opt:has(input:checked) + input.itx-q-other { display: block; }

.itx-q-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.itx-q-grid ~ .itx-q-nav .itx-q-submit { width: 100%; }   /* single-step template: full-width button */
/* nav: back = ghost, next / submit = gradient pill */
.itx-q-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin-top: 8px; }
.itx-q .itx-q-nav button { display: inline-flex; align-items: center; justify-content: center; margin: 0; padding: 15px 28px; border: 0; border-radius: 999px; font-family: inherit; font-size: 15.5px; font-weight: 600; line-height: 1; letter-spacing: 0; text-transform: none; color: #fff; background: linear-gradient(135deg, var(--b7), var(--b) 55%, #0A63BC); box-shadow: 0 12px 30px rgba(2, 79, 158, .3); cursor: pointer; transition: transform .35s var(--ease), box-shadow .35s var(--ease), background-color .25s; }
.itx-q .itx-q-nav button:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(2, 79, 158, .38); }
.itx-q .itx-q-nav button:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; }
.itx-q .itx-q-nav .itx-q-back { color: var(--b); background: #fff; border: 1.5px solid var(--line); box-shadow: none; }
.itx-q .itx-q-nav .itx-q-back:hover { background: var(--bg); border-color: var(--b); box-shadow: none; }
.is-js .itx-q-nav button[hidden] { display: none; }
.grecaptcha-badge { visibility: hidden; }   /* reCAPTCHA v3 badge would cover the scroll-to-top button: hidden */
.itx-q .itx-q-nda { margin: 20px 0 0; font-size: 12.5px; line-height: 1.55; text-align: center; color: var(--text); }

/* ---------- inside a post body ([itx_quote_form] in a post / page) ---------- */
.itx-post-body .itx-q-embed .itx-q-steps { padding-left: 0; }   /* undo .itx-post-body list styles */
.itx-post-body .itx-q-embed .itx-q-steps li { margin-bottom: 0; }
.itx-post-body .itx-q-embed a { text-decoration: none; }
.itx-post-body .itx-q-cta { width: auto; }

/* ---------- every embed (itx_quote_embed): CTA panel (title, "Đặt lịch tư vấn" button that opens the form in a popup) ---------- */
.itx-q-cta { width: min(1240px, 100% - 48px); margin: clamp(32px, 4vw, 56px) auto; text-align: center; }   /* no frame: it already sits inside the page's own section */
.itx-q-grad { background: linear-gradient(100deg, var(--b) 0%, #4F9BE6 50%, var(--b) 100%); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; }   /* same as home.css .hx-grad */
.itx-q-cta .itx-q-title { margin: 0 auto; font-size: clamp(28px, 3.5vw, 46px); font-weight: 700; line-height: 1.16; letter-spacing: -.02em; text-wrap: balance; color: var(--ink); }   /* = section headings (home.css .hx-head h2) */
.itx-q-cta .itx-q-btn { display: inline-flex; align-items: center; margin: 28px 0 0; padding: 15px 34px 17px; border: 0; border-radius: 999px; font-family: inherit; font-size: 16px; font-weight: 600; line-height: 1; letter-spacing: 0; text-transform: none; color: #fff; background: linear-gradient(135deg, var(--b7), var(--b) 55%, #0A63BC); box-shadow: 0 12px 30px rgba(2, 79, 158, .3); cursor: pointer; transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.itx-q-cta .itx-q-btn:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(2, 79, 158, .38); }
.itx-q-cta .itx-q-btn:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; }
/* popup (<dialog>, opened by quote.js) */
.itx-q-modal { width: min(860px, 100% - 32px); max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 0; border-radius: 24px; background: transparent; box-shadow: 0 30px 80px rgba(1, 30, 66, .35); overflow: auto; overscroll-behavior: contain; text-align: left; }
html.itx-q-lock { overflow: hidden; }   /* the page behind the popup does not scroll (class set / removed by quote.js) */
.itx-q-modal:focus { outline: 0; }
.itx-q-modal::backdrop { background: rgba(1, 30, 66, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.itx-q-close { position: absolute; top: 12px; right: 12px; z-index: 1; display: grid; place-items: center; width: 40px; height: 40px; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; transition: background-color .25s; }
.itx-q-close:hover { background: rgba(255, 255, 255, .16); }

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
  .itx-q-form { padding: 28px 28px 24px; }
}
@media (max-width: 640px) {   /* phone: near full-screen popup, compact spacing so the form fits with as little scrolling as possible (inputs stay 16px: iOS zooms smaller ones) */
  .itx-q-modal { width: calc(100% - 16px); max-height: calc(100dvh - 16px); border-radius: 20px; }
  .itx-q-head { padding: 12px 56px 12px 16px; border-radius: 20px 20px 0 0; }
  .itx-q-head img { height: 22px !important; }
  .itx-q-modal .itx-q-embed { border-radius: 0 0 20px 20px; }
  .itx-q-close { top: 6px; right: 6px; width: 34px; height: 34px; font-size: 22px; }
  .itx-q-form { padding: 16px 16px 14px; }
  .itx-q-thanks { padding: 28px 16px; }
  .itx-q-intro { margin-bottom: 12px; }
  .itx-q .itx-q-intro .itx-q-intro-t { font-size: 20px; }
  .itx-q .itx-q-intro .itx-q-intro-s { display: none; }
  .itx-q-grid { gap: 0 10px; }
  .itx-q-input { margin-bottom: 10px; }
  .itx-q-input > span, .itx-q-input > label > span { margin-bottom: 4px; font-size: 13px; }
  .itx-q-field :is(input[type=text], input[type=tel], input[type=email], select, textarea) { height: 44px; font-size: 16px; }
  .itx-q-field :is(input[type=text], input[type=tel], input[type=email], textarea) { padding-left: 12px; padding-right: 12px; }
  .itx-q-field textarea { height: auto; min-height: 84px; padding-top: 10px; padding-bottom: 10px; }
  .itx-q-steps { gap: 6px; margin-bottom: 14px; }
  .itx-q-steps li { gap: 6px; padding-bottom: 8px; font-size: 12px; }
  .itx-q-steps li::before { width: 22px; height: 22px; font-size: 11.5px; }
  .itx-q-step { margin-bottom: 14px; }
  .itx-q-step legend { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip: rect(0 0 0 0); }   /* the progress bar already names the step */
  .itx-q-field { margin-bottom: 20px; }
  .itx-q .itx-q-label { margin-bottom: 8px; font-size: 14.5px; }
  .itx-q-opt { gap: 10px; margin-bottom: 6px; padding: 10px 12px; border-radius: 12px; }
  .itx-q-opt > span { font-size: 14px; }
  .itx-q-opt small { margin-top: 2px; font-size: 12px; line-height: 1.45; }
  .itx-q-nav { flex-wrap: nowrap; gap: 8px; margin-top: 2px; }   /* back + next / submit on one row */
  .itx-q .itx-q-nav button { flex: 1; width: auto; margin: 0; padding: 13px 16px; }
  .itx-q .itx-q-nav .itx-q-back { flex: 0 0 auto; }
  .itx-q .itx-q-nda { margin-top: 10px; font-size: 11.5px; }
}
@media (max-width: 375px) {
  .itx-q-opt { padding: 12px 14px; }
  .itx-q-opt > span { font-size: 14px; }
}
