/* ============================================================
   NOXH OXH-02 — Trang đăng ký (register.css)
   Kế thừa design system từ styles.css (:root, header, footer,
   .btn, .grad-text, .pill-label, .container). File này chỉ bổ
   sung phần riêng của trang đăng ký.
   ============================================================ */

/* ---------- page hero band (ảnh phối cảnh dự án) ---------- */
.reg-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(320px, 42vh, 440px);
  padding: clamp(36px, 5vh, 60px) 0 clamp(32px, 4.5vh, 52px);
  background:
    linear-gradient(97deg, rgba(240, 249, 252, 0.97) 0%, rgba(233, 246, 251, 0.88) 34%, rgba(233, 246, 251, 0.34) 58%, rgba(233, 246, 251, 0) 80%),
    #dff0f6 url("../assets/hero-bg.jpg") right center / cover no-repeat;
  overflow: hidden;
}
.reg-hero .container { position: relative; z-index: 1; }
.reg-crumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-label);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
}
.reg-crumb a { color: var(--blue-2); font-weight: 600; transition: color .2s ease; }
.reg-crumb a:hover { color: var(--blue-1); }
.reg-crumb .sep { color: var(--gray-muted); }
.reg-hero-head { max-width: 700px; display: flex; flex-direction: column; gap: 16px; }
.reg-hero .pill-label { align-self: flex-start; }
.reg-hero .section-title { text-transform: none; }
.reg-hero-sub {
  font-size: clamp(16px, 1.9vw, 20px);
  color: #35485a;
  line-height: 1.6;
  max-width: 620px;
}
.reg-hero-sub strong { color: var(--blue-1); font-weight: 600; }

/* số liệu nhanh của dự án */
.reg-facts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.reg-fact {
  flex: 1 1 128px; min-width: 128px;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(9px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  padding: 14px 18px;
  box-shadow: 0 12px 28px rgba(14, 96, 172, 0.13);
}
.reg-fact .f-num {
  display: block;
  font-weight: 800; font-size: clamp(21px, 2.3vw, 27px); line-height: 1.05;
  background: var(--blue-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.reg-fact .f-num i { font-style: normal; font-size: .6em; font-weight: 700; }
.reg-fact .f-lbl { display: block; margin-top: 4px; font-size: 12.5px; color: #566574; font-weight: 500; }

/* ---------- layout ---------- */
.reg-section { padding: clamp(40px, 5vw, 68px) 0 clamp(56px, 8vw, 96px); }
.reg-grid {
  display: grid;
  grid-template-columns: 0.84fr 1.16fr;
  gap: 36px;
  align-items: start;
}

/* ============================================================
   RAIL TRÁI — panel gradient xanh (điểm nhấn màu đậm)
   ============================================================ */
.reg-rail {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  align-self: start;
  border-radius: var(--radius-card);
  padding: 30px 30px 32px;
  color: #fff;
  background:
    radial-gradient(130% 120% at 100% 0%, rgba(255, 255, 255, 0.16), transparent 45%),
    linear-gradient(158deg, #0e60ac 0%, #0774c2 52%, #0087d8 100%);
  box-shadow: 0 30px 70px rgba(14, 96, 172, 0.28);
  overflow: hidden;
}
.reg-rail::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.10) 1px, transparent 1.4px);
  background-size: 22px 22px;
  opacity: 0.5;
  pointer-events: none;
}
.reg-rail > * { position: relative; z-index: 1; }
.reg-rail-photo {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 22px;
  box-shadow: 0 16px 34px rgba(3, 32, 60, 0.32);
}
.reg-rail-photo img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.reg-rail-photo::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(6, 40, 74, 0.62));
}
.reg-rail-photo .cap {
  position: absolute; left: 16px; bottom: 13px; z-index: 1;
  display: inline-flex; align-items: center; gap: 7px;
  color: #fff; font-weight: 600; font-size: 13.5px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .4);
}
.reg-rail-photo .cap svg { width: 15px; height: 15px; fill: #ffd9b8; flex: 0 0 auto; }
.reg-rail-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 50px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.28);
  margin-bottom: 16px;
}
.reg-rail-title {
  font-size: clamp(22px, 2.2vw, 27px);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
}
.reg-rail-title em { font-style: normal; color: #ffd9b8; }

/* danh sách 5 lợi ích */
.reg-benefits { display: flex; flex-direction: column; gap: 2px; margin-bottom: 22px; }
.reg-benefit {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 13px;
  align-items: start;
  padding: 11px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}
.reg-benefit:first-child { border-top: none; padding-top: 2px; }
.reg-benefit .bi {
  width: 26px; height: 26px; margin-top: 1px;
  border-radius: 50%;
  background: var(--orange-grad);
  display: grid; place-items: center;
  box-shadow: 0 6px 14px rgba(255, 103, 0, 0.34);
}
.reg-benefit .bi svg { width: 14px; height: 14px; fill: #fff; }
.reg-benefit p { font-size: 14.5px; line-height: 1.42; color: rgba(255, 255, 255, 0.94); font-weight: 500; }
.reg-benefit p strong { font-weight: 700; color: #ffd9b8; }

/* hotline card */
.reg-hotline {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.reg-hotline .h-ico {
  width: 46px; height: 46px; flex: 0 0 auto;
  border-radius: 50%;
  background: var(--orange-grad);
  display: grid; place-items: center;
  box-shadow: 0 10px 22px rgba(255, 103, 0, 0.4);
}
.reg-hotline .h-ico svg { width: 22px; height: 22px; fill: #fff; }
.reg-hotline .h-k { display: block; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, 0.8); margin-bottom: 2px; }
.reg-hotline .h-v { display: block; font-size: 22px; font-weight: 800; line-height: 1.1; letter-spacing: .01em; }

/* hàng giữa rail: 3 badge trust (trái) + QR (phải) */
.reg-rail-mid {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
}
.reg-trust { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.reg-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 16px; border-radius: 14px;
  font-size: 13.5px; font-weight: 600;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
}
.reg-chip svg { width: 16px; height: 16px; fill: #ffd9b8; flex: 0 0 auto; }

/* QR cộng đồng — poster thu gọn, bấm để phóng to quét */
.reg-qr-wrap { text-align: center; }
.reg-qr {
  display: inline-block;
  width: 100%; max-width: 158px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 26px rgba(3, 32, 60, 0.3);
  transition: transform .2s ease, box-shadow .2s ease;
}
.reg-qr:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(3, 32, 60, 0.4); }
.reg-qr img { width: 100%; display: block; }
.reg-qr-cap {
  margin: 9px 0 0;
  font-size: 12px; line-height: 1.4; font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
}

/* ============================================================
   FORM CARD — thẻ trắng sạch cho biểu mẫu dài
   ============================================================ */
.reg-form-card {
  background: #fff;
  border: 1px solid #eef2f6;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.reg-form-top {
  padding: 30px 38px 26px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f7fbfd, #ffffff);
}
.reg-form-top h2 {
  font-size: clamp(21px, 2.2vw, 26px);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 8px;
}
.reg-form-top p { font-size: 15px; color: #5a6a78; line-height: 1.6; }
.reg-form-top .req-note { color: var(--orange-1); font-weight: 600; }

.reg-form { padding: 26px 38px 34px; }

/* nhóm trường */
.reg-fieldset { border: none; margin-bottom: 22px; }
.reg-fieldset:last-of-type { margin-bottom: 18px; }
.reg-legend {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--blue-1);
  margin-bottom: 15px;
}
.reg-legend .n {
  width: 26px; height: 26px; flex: 0 0 auto;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800; color: #fff;
  background: var(--blue-grad);
}
.reg-legend::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.reg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.reg-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.reg-field.full { grid-column: 1 / -1; }
.reg-row .reg-field { margin-bottom: 0; }
.reg-row { margin-bottom: 14px; }
.reg-row:last-child { margin-bottom: 0; }

.reg-field label {
  font-size: 14px; font-weight: 600; color: #2f3b46;
  display: flex; align-items: center; gap: 5px;
}
.reg-field label .star { color: var(--orange-1); font-weight: 700; }

.reg-field input,
.reg-field select,
.reg-field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16.5px;            /* >16px: chống zoom trên mobile */
  color: var(--ink);
  background: #f6f9fc;
  border: 1.5px solid #e3eaf1;
  border-radius: 14px;
  padding: 13px 16px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.reg-field textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
.reg-field input::placeholder,
.reg-field textarea::placeholder { color: #9aa7b2; }
.reg-field input:focus,
.reg-field select:focus,
.reg-field textarea:focus {
  background: #fff;
  border-color: var(--blue-3);
  box-shadow: 0 0 0 4px rgba(0, 135, 216, 0.14);
}
.reg-field select {
  appearance: none; -webkit-appearance: none;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, #6b7b88 50%),
    linear-gradient(135deg, #6b7b88 50%, transparent 50%);
  background-position: right 22px center, right 16px center;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.reg-field select:invalid { color: #9aa7b2; }

/* trạng thái lỗi */
.reg-field.error input,
.reg-field.error select,
.reg-field.error textarea {
  border-color: #e5484d;
  background: #fef4f4;
  box-shadow: 0 0 0 4px rgba(229, 72, 77, 0.12);
}
.reg-err { display: none; font-size: 13px; color: #d63a3f; font-weight: 500; }
.reg-field.error .reg-err { display: block; }

/* consent checkbox */
.reg-consent {
  position: relative;
  display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start;
  padding: 16px 18px;
  background: #f6f9fc;
  border: 1.5px solid #e3eaf1;
  border-radius: 16px;
  margin-bottom: 22px;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}
.reg-consent:hover { border-color: #cfe0ee; }
.reg-consent.error { border-color: #e5484d; background: #fef4f4; }
.reg-consent input { position: absolute; opacity: 0; width: 0; height: 0; }
.reg-consent .box {
  width: 22px; height: 22px; margin-top: 1px; flex: 0 0 auto;
  border-radius: 7px; border: 2px solid #c3d2df; background: #fff;
  display: grid; place-items: center;
  transition: background .2s ease, border-color .2s ease;
}
.reg-consent .box svg { width: 13px; height: 13px; fill: #fff; opacity: 0; transform: scale(.6); transition: opacity .18s ease, transform .18s ease; }
.reg-consent input:checked + .box { background: var(--blue-grad); border-color: transparent; }
.reg-consent input:checked + .box svg { opacity: 1; transform: scale(1); }
.reg-consent input:focus-visible + .box { box-shadow: 0 0 0 4px rgba(0, 135, 216, 0.18); }
.reg-consent .c-text { font-size: 14px; color: #46545f; line-height: 1.55; }
.reg-consent .c-text a { color: var(--blue-2); font-weight: 600; }

/* submit */
.reg-submit {
  width: 100%;
  padding: 20px;
  font-size: clamp(18px, 2vw, 22px);
  text-transform: uppercase;
  letter-spacing: .02em;
}
.reg-submit svg { width: 20px; height: 20px; fill: #fff; }

/* link cộng đồng hỏi đáp */
.reg-community {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  margin-top: 14px;
  padding: 13px 18px;
  border: 1.5px dashed #cfe0ee;
  border-radius: 14px;
  color: var(--blue-1);
  font-weight: 600; font-size: 15px;
  text-align: center;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.reg-community:hover { background: #f4fafc; border-color: #a9d3f0; transform: translateY(-1px); }
.reg-community svg { width: 17px; height: 17px; fill: var(--blue-2); flex: 0 0 auto; }

.reg-foot-note {
  text-align: center;
  font-size: 13px; color: #8a97a2;
  margin-top: 16px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.reg-foot-note svg { width: 14px; height: 14px; fill: #9aa7b2; }

/* ============================================================
   SUCCESS STATE
   ============================================================ */
.reg-success {
  display: none;
  text-align: center;
  padding: 54px 38px 48px;
}
.reg-success.show { display: block; animation: regFade .5s ease both; }
@keyframes regFade { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.reg-success .tick {
  width: 90px; height: 90px; margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--blue-grad);
  display: grid; place-items: center;
  box-shadow: 0 20px 44px rgba(14, 96, 172, 0.32);
}
.reg-success .tick svg { width: 44px; height: 44px; fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.reg-success .tick svg path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: regTick .5s .25s ease forwards; }
@keyframes regTick { to { stroke-dashoffset: 0; } }
.reg-success h2 { font-size: clamp(24px, 2.6vw, 32px); font-weight: 700; margin-bottom: 12px; }
.reg-success p { font-size: 16px; color: #5a6a78; line-height: 1.7; max-width: 460px; margin: 0 auto 10px; }
.reg-success .ref {
  display: inline-block; margin: 8px 0 26px;
  padding: 8px 20px; border-radius: 50px;
  font-weight: 700; letter-spacing: .04em;
  color: var(--blue-1);
  background: var(--cyan-2);
  border: 1px solid #d3ecf3;
}
.reg-success .s-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.reg-success .s-actions .btn { padding: 15px 30px; font-size: 16px; }
.btn-ghost {
  background: #fff; color: var(--blue-1);
  border: 1.5px solid #cfe0ee;
  box-shadow: none;
}
.btn-ghost:hover { filter: none; background: #f4fafc; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .reg-grid { grid-template-columns: 1fr; gap: 28px; }
  .reg-rail { position: static; order: 2; }
  .reg-form-card { order: 1; }
}
@media (max-width: 620px) {
  .reg-hero {
    min-height: 0;
    background-position: 72% center;
  }
  .reg-fact { flex-basis: calc(50% - 6px); min-width: 0; }
  .reg-row { grid-template-columns: 1fr; gap: 0; }
  .reg-row .reg-field { margin-bottom: 18px; }
  .reg-form-top { padding: 26px 22px 22px; }
  .reg-form { padding: 26px 22px 30px; }
  .reg-rail { padding: 32px 24px; }
  .reg-rail-mid { grid-template-columns: 1fr; gap: 22px; }
  .reg-rail-mid .reg-qr-wrap { max-width: 190px; margin: 0 auto; }
}
