/* SAAS-ONBOARDING-V1 */
/* ==========================================================================
   Website Pro — bề đăng ký SaaS (landing / login / wizard / dashboard)
   Palette: xanh lá đậm #0a7d4f + amber #c9a227 trên nền sáng (khớp tone C3).
   Mobile-first: style gốc cho điện thoại, mở rộng dần từ breakpoint 768px.
   Không framework, không web font ngoài hệ thống.
   ========================================================================== */

:root {
  --green-900: #064d33;
  --green-800: #086540;
  --green-700: #0a7d4f;
  --green-600: #0c915c;
  --green-100: #e1f2e9;
  --green-50: #eff7f2;
  --amber-700: #a8871f;
  --amber: #c9a227;
  --amber-100: #faf1d7;
  --bg: #f5f8f6;
  --surface: #ffffff;
  --text: #182720;
  --muted: #5c6f65;
  --border: #dbe6df;
  --danger: #b3362a;
  --danger-100: #fbe9e6;
  --radius: 15px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 40, 28, 0.05), 0 10px 30px rgba(15, 40, 28, 0.08);
  --shadow-sm: 0 1px 2px rgba(15, 40, 28, 0.06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* ---------- Nền & chữ ---------- */
* { box-sizing: border-box; }
/* Bắt buộc: nhiều phần tử có class đặt display (.btn, .site-list…) vẫn phải
   ẩn được bằng thuộc tính hidden khi JS điều khiển các bước. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.55;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 10px; }
p { margin: 0 0 12px; }
a { color: var(--green-700); }
img { max-width: 100%; }

.container { width: 100%; max-width: 1060px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

/* ---------- Header dùng chung ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.2px;
  color: var(--text);
  text-decoration: none;
}
.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--green-700), var(--green-600));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
}
.logo-mark::after { content: "W"; }
.header-nav { display: flex; align-items: center; gap: 8px; }
.header-nav .nav-link { font-weight: 600; font-size: 14.5px; text-decoration: none; padding: 8px 10px; border-radius: 8px; }
.header-nav .nav-link:hover { background: var(--green-50); }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px solid transparent;
  border-radius: 12px;
  padding: 11px 18px;
  font-family: var(--font);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-loading { opacity: 0.75; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 22px; font-size: 16.5px; border-radius: 13px; }

.btn-primary { background: var(--green-700); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--green-800); box-shadow: 0 6px 18px rgba(10, 125, 79, 0.28); }

.btn-amber { background: var(--amber); color: #241d05; box-shadow: var(--shadow-sm); }
.btn-amber:hover { background: var(--amber-700); color: #fff; }

.btn-ghost { background: var(--surface); color: var(--green-800); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--green-700); background: var(--green-50); }

.btn-quiet { background: transparent; color: var(--muted); }
.btn-quiet:hover { color: var(--text); background: rgba(0, 0, 0, 0.05); }

.btn-sm { padding: 8px 13px; font-size: 14px; border-radius: 10px; }

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 18px;
}

/* ---------- Form ---------- */
.field { margin-bottom: 14px; }
.label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.req { color: var(--danger); }
.input {
  width: 100%;
  padding: 11px 13px;
  font-family: var(--font);
  font-size: 15.5px;
  color: var(--text);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input::placeholder { color: #9ab0a4; }
.input:focus {
  outline: none;
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(10, 125, 79, 0.18);
}
.field .field-error { display: none; color: var(--danger); font-size: 13px; margin-top: 5px; }
.field.invalid .input { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(179, 54, 42, 0.12); }
.field.invalid .field-error { display: block; }
.form-hint { font-size: 13.5px; color: var(--muted); margin: 10px 0 0; text-align: center; }

/* Captcha phép tính (hiện khi khách nhập mã giới thiệu) */
.captcha-block {
  border: 1.5px dashed var(--amber);
  background: var(--amber-100);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin: 4px 0 14px;
}
.captcha-row { display: flex; align-items: center; gap: 8px; }
.captcha-question {
  flex: none;
  min-width: 74px;
  text-align: center;
  font-weight: 800;
  font-size: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 8px;
  letter-spacing: 1px;
}
.captcha-row .input { flex: 1; }
.btn-refresh {
  flex: none;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 17px;
  cursor: pointer;
  color: var(--muted);
}
.btn-refresh:hover { border-color: var(--amber); color: var(--amber-700); }

/* ---------- Hero (landing) ---------- */
.hero { padding: 34px 0 10px; }
.hero-eyebrow {
  display: inline-block;
  background: var(--green-100);
  color: var(--green-800);
  font-weight: 700;
  font-size: 13px;
  border-radius: 999px;
  padding: 5px 12px;
  margin-bottom: 14px;
}
.hero h1 { font-size: 27px; letter-spacing: -0.4px; margin-bottom: 12px; }
.hero h1 .hl { color: var(--green-700); }
.hero-sub { color: var(--muted); font-size: 16px; margin-bottom: 20px; }
.hero-cta { display: flex; flex-direction: column; gap: 10px; margin-bottom: 26px; }

/* 3 bước */

.steps { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 10px; }
.steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.step-num {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green-700);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.steps b { display: block; font-size: 15px; }
.steps span { font-size: 13.5px; color: var(--muted); }

/* Card đăng ký ngay trên landing */
.signup-card h2 { font-size: 20px; }
.signup-card .card-sub { font-size: 14px; color: var(--muted); margin-bottom: 16px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 22px 0 30px; }
.site-footer .container { display: flex; flex-direction: column; gap: 6px; text-align: center; color: var(--muted); font-size: 13.5px; }
.site-footer a { color: var(--muted); }

/* ---------- Login ---------- */
.auth-wrap { max-width: 430px; margin: 40px auto 60px; padding: 0 16px; }
.auth-card { padding: 26px 22px; }
.auth-card h1 { font-size: 23px; margin-bottom: 6px; }
.auth-sub { color: var(--muted); font-size: 14.5px; margin-bottom: 20px; }
.demo-hint {
  display: flex;
  gap: 9px;
  background: var(--green-50);
  border: 1px solid var(--green-100);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--green-900);
  margin-top: 16px;
}

/* ---------- Wizard ---------- */
.wizard-main { padding: 22px 0 50px; }
.wizard-head { margin-bottom: 18px; }
.wizard-head h2 { font-size: 21px; margin-bottom: 4px; }
.wizard-head p { color: var(--muted); font-size: 14.5px; margin: 0; }

/* Progress 4 chấm nối dòng */
.progress { list-style: none; display: flex; margin: 0 0 26px; padding: 0; }
.progress .p-step { flex: 1; text-align: center; position: relative; }
.progress .p-step::before {
  content: "";
  position: absolute;
  top: 15px; /* tâm chấm 28px + viền -> dòng nối căn giữa chấm */
  left: -50%;
  width: 100%;
  height: 2.5px;
  background: var(--border);
  z-index: 0;
  transition: background 0.2s ease;
}
.progress .p-step:first-child::before { display: none; }
.progress .p-dot {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  margin: 0 auto 6px;
  border-radius: 50%;
  background: var(--surface);
  border: 2.5px solid var(--border);
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.progress .p-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.progress .p-step.active .p-dot { border-color: var(--green-700); color: var(--green-700); box-shadow: 0 0 0 4px rgba(10, 125, 79, 0.15); }
.progress .p-step.active .p-label { color: var(--green-800); }
.progress .p-step.done .p-dot { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.progress .p-step.done .p-dot::after { content: "✓"; }
.progress .p-step.done .p-dot > * { display: none; }
.progress .p-step.done::before, .progress .p-step.active::before { background: var(--green-700); }

/* B1: ô tìm kiếm + lưới nghề */
.search-wrap { position: relative; margin-bottom: 14px; }
.search-wrap .input { padding-left: 40px; }
.search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 16px; }
.search-count { font-size: 13px; color: var(--muted); margin: 0 0 12px; }

.grid-industries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 10px;
}
.ind-card {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 12px 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ind-card:hover { border-color: var(--green-600); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.ind-card.selected { border-color: var(--green-700); background: var(--green-50); box-shadow: 0 0 0 3px rgba(10, 125, 79, 0.15); }
.ind-brand {
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
  padding-right: 22px;
}
.ind-code { font-size: 12px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ind-preview {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--green-700);
  text-decoration: none;
  margin-top: 6px;
  align-self: flex-start;
  border-bottom: 1px dashed currentColor;
}
.ind-preview:hover { color: var(--green-800); }
.badge-dang {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.badge-dang.dang-A { background: var(--green-100); color: var(--green-800); }
.badge-dang.dang-B { background: var(--amber-100); color: var(--amber-700); }
.badge-dang.dang-C, .badge-dang.dang-unknown { background: #edf1ee; color: var(--muted); }
.ind-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 30px 10px; }

/* B2: chọn mẫu form */
.grid-forms { display: grid; gap: 12px; grid-template-columns: 1fr; }
.form-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  position: relative;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-card.selectable { cursor: pointer; }
.form-card.selectable:hover { border-color: var(--green-600); box-shadow: var(--shadow-sm); }
.form-card.selected { border-color: var(--green-700); background: var(--green-50); box-shadow: 0 0 0 3px rgba(10, 125, 79, 0.15); }
.form-card.disabled { opacity: 0.55; background: #f4f6f4; cursor: not-allowed; }
.form-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.form-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  font-size: 12.5px;
  background: #edf1ee;
  border-radius: 7px;
  padding: 3px 8px;
  color: var(--muted);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
  padding: 3px 10px;
  letter-spacing: 0.3px;
}
.chip-ready { background: var(--green-100); color: var(--green-800); }
.chip-soon { background: var(--amber-100); color: var(--amber-700); }
.chip-sub { background: var(--green-50); border: 1px solid var(--green-100); color: var(--green-900); font-weight: 600; font-size: 13px; padding: 5px 12px; }
.chip-status { background: var(--green-100); color: var(--green-900); font-size: 13px; }
.form-card h3 { font-size: 16.5px; margin-bottom: 4px; }
.form-card .form-desc { font-size: 13.5px; color: var(--muted); margin-bottom: 10px; }
.form-card .ind-preview { margin-top: 0; font-size: 13px; }

/* Thanh điều hướng wizard */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
}
.wizard-nav .spacer { flex: 1; }
.wizard-error {
  display: none;
  background: var(--danger-100);
  border: 1px solid #f0c4bd;
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14.5px;
  margin-top: 16px;
}
.wizard-error.show { display: block; }
.wizard-error .btn { margin-top: 10px; }

/* Nút đang dựng website: spinner + chữ */
.btn .spinner {
  flex: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: onb-spin 0.8s linear infinite;
}
.spinner-dark {
  width: 26px;
  height: 26px;
  border: 3px solid var(--green-100);
  border-top-color: var(--green-700);
  border-radius: 50%;
  animation: onb-spin 0.8s linear infinite;
  margin: 0 auto 10px;
}
@keyframes onb-spin { to { transform: rotate(360deg); } }

/* B4: màn hình thành công */
.success-box { text-align: center; padding: 30px 18px 26px; }
.success-check {
  width: 62px;
  height: 62px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-700);
  font-size: 32px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: onb-pop 0.35s ease;
}
@keyframes onb-pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.success-box h2 { font-size: 23px; }
.success-actions { display: flex; flex-direction: column; gap: 10px; margin: 20px 0 14px; }
.success-note { font-size: 13.5px; color: var(--muted); }

/* ---------- Dashboard ---------- */
.dash-main { padding: 26px 0 60px; }
.dash-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 20px; }
.dash-head h1 { font-size: 23px; margin: 0; }
.dash-head p { color: var(--muted); font-size: 14.5px; margin: 0; }
.dash-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.site-list { display: grid; gap: 14px; }
.site-card { display: flex; flex-direction: column; gap: 12px; }
.site-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.site-brand { font-size: 18px; margin: 0; }
.site-id { font-size: 12.5px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.site-card-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.site-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.empty-state { text-align: center; padding: 40px 18px; }
.empty-state .empty-icon { font-size: 40px; margin-bottom: 8px; }
.dash-foot { margin-top: 26px; display: flex; justify-content: center; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 14px);
  max-width: min(92vw, 480px);
  background: #1b2d24;
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(10, 25, 18, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 90;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.toast-error { background: #8e2f24; }
.toast.toast-success { background: var(--green-700); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 26, 19, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 80;
}
.modal-backdrop[hidden] { display: none; }
.modal { max-width: 430px; width: 100%; }
.modal h3 { font-size: 18px; }
.modal .modal-text { color: var(--muted); font-size: 14.5px; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* ---------- Loading toàn trang ---------- */
.center-loading { text-align: center; padding: 60px 16px; color: var(--muted); }

/* ==========================================================================
   Responsive: mở rộng từ 768px (tablet/desktop)
   ========================================================================== */
@media (min-width: 768px) {
  .hero { padding: 56px 0 30px; }
  .hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 44px; align-items: start; }
  .hero h1 { font-size: 38px; }
  .hero-sub { font-size: 17.5px; }
  .hero-cta { flex-direction: row; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .signup-card { padding: 26px 26px 22px; }

  .auth-wrap { margin-top: 60px; }

  .wizard-main { padding-top: 34px; }
  .wizard-head h2 { font-size: 25px; }
  .progress { max-width: 620px; margin-left: auto; margin-right: auto; }
  .progress .p-label { font-size: 13px; }
  .grid-forms { grid-template-columns: repeat(2, 1fr); }
  .grid-forms .form-card:first-child { grid-column: 1 / -1; }

  .success-actions { flex-direction: row; justify-content: center; }
  .site-card { flex-direction: row; align-items: center; justify-content: space-between; }
  .site-card .site-card-info { flex: 1; min-width: 0; }
  .dash-head { flex-direction: row; align-items: baseline; justify-content: space-between; }
  .site-footer .container { flex-direction: row; justify-content: space-between; text-align: left; }
}

/* Màn hình rất nhỏ (<=360px): thu chữ cho vừa 390px trở xuống */
@media (max-width: 360px) {
  .hero h1 { font-size: 24px; }
  .grid-industries { grid-template-columns: 1fr 1fr; gap: 8px; }
  .progress .p-label { display: none; }
}
