/* ============================================================
   Kivlo Landing - style.css
   HTML + CSS thuần, không dùng framework.
   ============================================================ */

/* ---------- Biến màu & reset ---------- */
:root {
  --brand-red: #cf232e;
  --brand-magenta: #b3266a;
  --text-dark: black;
  --text-gray: #555555;
  --text-muted: #777777;
  --heading-gray: #4d4d4d;
  --heading-dark: black;
  --border: #e4e4e4;
  --section-bg: #fafafa;
  --blue: #00f;
  --blue-focus: #4a8df8;
  --star: #f5b50a;
  --container: 980px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Chặn cuộn ngang trên mọi thiết bị (đặc biệt khi animation scale làm tràn) */
html, body { overflow-x: hidden; max-width: 100%; }

body {
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  color: var(--text-gray);
  background: #fff;
  line-height: 1.6;
  font-size: 15px;
}

img { max-width: 100%; height: auto; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Logo dùng chung ---------- */
.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.logo-img {
  display: block;
  height: 35px;   /* logo header */
  width: auto;
}
.footer-logo .logo-img { height: 44px; }   /* logo footer nhỏ hơn chút */

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.brand-info { display: flex; flex-direction: column; line-height: 1.3; }
.brand-info strong { color: var(--heading-gray); font-size: 15px; }
.brand-info span { color: var(--text-muted); font-size: 12.5px; }

/* ---------- Hero / Xác minh ---------- */
.hero { text-align: center; padding: 20px 20px 10px; }
.hero h1 {
  color: var(--heading-gray);
  font-size: 30px;
  font-weight: 600;
  margin-bottom: 8px;
}
.hero-sub { color: var(--text-gray); font-size: 16px; margin-bottom: 20px; }

.phone-illustration {
  width: auto;       /* để rộng tự co theo tỉ lệ SVG -> bỏ khoảng trắng thừa 2 bên */
  height: 100px;
  display: block;
  margin: 0 auto 16px;
}

/* Thẻ nhập số điện thoại */
.verify-card {
  max-width: 440px;
  margin: 0 auto;
  background: #f7f7f7;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  text-align: left;
}
.verify-card h3 { color: var(--text-dark); font-size: 18px; margin-bottom: 4px; font-weight: 700; }
.verify-note { color: var(--text-muted); font-size: 14px; margin-bottom: 18px; }

/* Ô input với icon điện thoại */
.phone-field {
  display: flex;
  align-items: center;
  background: #eef3ff;
  border: 3px solid var(--blue);
  border-radius: 6px;
  padding: 0 16px;   /* bỏ padding dọc để input lấp đầy chiều cao div */
  margin-bottom: 14px;
  transform-origin: center;
  will-change: transform;
  /* zoom in/out mượt + đổ bóng nhẹ cho có chiều sâu */
  animation: phone-zoom 2.2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
/* Dừng animation khi user đang focus/gõ để khỏi gây rối */
.phone-field:focus-within { animation: none; }

.phone-icon {
  display: flex;
  margin-right: 12px;
  flex-shrink: 0;          /* không cho icon bị co lại khi input chiếm chỗ */
}
/* Khoá kích thước img (override global "img { height: auto }" có thể làm SVG bị 0px) */
.phone-icon img { width: 27px; height: 27px; }
.phone-field input {
  flex: 1;
  min-width: 0;     /* cho phép input co lại bên trong flex để không đẩy .phone-check ra ngoài viền (mobile) */
  border: none;
  background: transparent;
  padding: 8px 0;   /* input cao, lấp đầy div */
  font-size: 26px;   /* chữ to hơn */
  color: var(--text-dark);
  outline: none;
}
.phone-field input::placeholder { color: #9a9a9a; }

/* Icon tích xanh hiển thị khi sdt hợp lệ */
.phone-check {
  display: flex;
  align-items: center;
  margin-left: 10px;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
.phone-field.is-valid .phone-check {
  opacity: 1;
  transform: scale(1);
}
/* Khi sdt đã hợp lệ: dừng animation ở input để dồn sự chú ý vào button */
.phone-field.is-valid { animation: none; }

/* Hiệu ứng phóng to / thu nhỏ mượt mà */
@keyframes phone-zoom {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 2px 6px rgba(0, 0, 255, 0.12);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 255, 0.20);
  }
}
/* Tôn trọng người dùng tắt hiệu ứng chuyển động */
@media (prefers-reduced-motion: reduce) {
  .phone-field,
  .btn-primary.is-active { animation: none; }
}

/* Nút Tiếp tục */
.btn-primary {
  display: block;
  width: 100%;
  border: none;
  border-radius: 6px;
  padding: 13px;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(#c4c4c4, #a9a9a9);
  transition: background 0.25s ease, box-shadow 0.25s ease;
  transform-origin: center;
  will-change: transform;
}
.btn-primary:hover { background: linear-gradient(#bcbcbc, #9e9e9e); }

/* Trạng thái active: button chuyển xanh + nháy nháy để hút sự chú ý */
.btn-primary.is-active {
  background: linear-gradient(#4a8df8, #2563eb);
  animation: btn-zoom 1.1s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
.btn-primary.is-active:hover { background: linear-gradient(#5a9bff, #1d4ed8); }

@keyframes btn-zoom {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.30);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.45);
  }
}

/* Danh sách bước trong thẻ - căn giữa cả khối */
.verify-steps {
  list-style: disc;
  width: fit-content;   /* co theo nội dung để margin auto căn giữa được */
  max-width: 100%;
  margin: 18px auto 0;
  padding-left: 22px;   /* chừa chỗ cho dấu chấm */
  color: var(--text-gray);
  font-size: 14px;
}
.verify-steps li { margin: 2px 0; }

/* Đoạn giới thiệu nhà mạng */
.intro-text {
  max-width: 760px;
  margin: 32px auto 10px;
  text-align: center;
  color: black;
  font-size: 11px;
}
.intro-text p { margin-bottom: 16px; }

/* ---------- Tiêu đề section (kiểu accordion) ---------- */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--section-bg);
  border-top: 1px solid var(--border);
  padding: 8px 18px;
}
.section-head h2 {
  font-size: 20px;
  font-weight: 500;
  color: var(--heading-dark);
}
/* Mũi tên chevron xuống (vẽ bằng CSS) */
.chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid #9a9a9a;
  border-bottom: 2px solid #9a9a9a;
  transform: rotate(45deg);
  margin-bottom: 4px;
  transition: transform 0.2s ease, margin 0.2s ease;
}

/* ---------- Expand/collapse section ---------- */
.collapsible .section-head {
  cursor: pointer;
  user-select: none;
}
.collapsible .section-head:focus-visible {
  outline: 2px solid #7AC142;
  outline-offset: 2px;
}
/* Expanded: chevron quay lên */
.collapsible:not(.is-collapsed) > .section-head .chevron {
  transform: rotate(-135deg);
  margin-bottom: 0;
  margin-top: 4px;
}
.collapsible > .section-body {
  margin: 22px 0 30px;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              margin 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.25s ease,
              transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: top;
  will-change: max-height, margin, opacity, transform;
}
.collapsible.is-collapsed > .section-body {
  max-height: 0 !important;
  margin-top: 0;
  margin-bottom: 0;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

/* ---------- Tính năng (feature) ---------- */
.feature {
  display: flex;
  align-items: stretch;            /* ảnh & nội dung kéo full chiều cao card */
  border: 1px solid var(--border); /* viền bao quanh box */
  border-radius: 8px;
  overflow: hidden;                /* ảnh phủ sát mép, bo góc theo card - không padding */
  margin-bottom: 18px;
  cursor: pointer;                 /* click để cuộn lên top */
}
.feature-thumb {
  /* flex: 0 0 200px; */
  width: 160px;
  align-self: stretch;   /* ảnh phủ full chiều cao card */
  object-fit: cover;     /* ảnh phủ kín, không méo */
}

.feature-body { padding: 18px 22px; }   /* chỉ phần chữ có khoảng thở */
.feature-body h4 { color: var(--text-dark); font-size: 20px; margin-bottom: 6px; }
.feature-body p  { color: var(--text-dark); font-size: 13px; }

/* ---------- Trưng bày (gallery) ---------- */
/* Bootstrap .row + .col-* lo phần layout; chỉ giữ padding ngoài cho khớp các section khác */
.gallery {
  padding: 0 6px;
}
.tile {
  position: relative;
  height: 240px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;     /* label đặt gần đáy */
  justify-content: center;   /* căn giữa ngang */
  padding-bottom: 18px;      /* khoảng cách label cách đáy */
  cursor: pointer;           /* click để cuộn lên top */
}
/* Ảnh phủ kín toàn bộ tile (đổ từ thẻ <img>, không phải CSS) */
.tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
/* Lớp phủ tối nhẹ giúp label đọc rõ trên ảnh */
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.5));
  z-index: 1;
}
.tile-label {
  position: relative;
  z-index: 2;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 9px 24px;
  border-radius: 4px;
  text-align: center;
}
/* Nhãn đỏ cho ô Trực tiếp */
.live-label { background: #e23744; }

/* ---------- Khối văn bản chung ---------- */
.text-block {
  padding: 0 18px;
  color: var(--text-dark);
  font-size: 13px;
}
.text-block p { margin-bottom: 8px }
.text-block ul { margin: 0 0 14px 22px; }
.text-block li { margin-bottom: 6px; }
.steps strong { color: var(--text-dark); }
.company { font-weight: 600; color: var(--text-dark); }
.address { color: var(--text-dark); }

/* ---------- Lời chứng thực ---------- */
.reviews {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding: 0 6px;
}
.review-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px;
}
.review-card h4 { color: var(--text-dark); font-size: 20px; margin-bottom: 8px; }
.review-card p  { font-size: 14px; margin-bottom: 14px;color: black; } 
.review-author  { color: var(--text-dark); font-size: 13px; }

/* Sao đánh giá */
.stars {
  color: var(--star);
  font-size: 18px;
  letter-spacing: 2px;
  margin-bottom: 12px;
}
.star-empty { color: #d8d8d8; }
/* Sao nửa: tô vàng nửa trái, xám nửa phải */
.star-half {
  background: linear-gradient(90deg, var(--star) 50%, #d8d8d8 50%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Footer (đã gộp vào About) ---------- */
.site-footer {
  /* border-top: 1px solid var(--border);
  margin-top: 24px; */
  padding: 8px 18px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 18px;
}
.footer-links a { font-size: 13px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .reviews { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .hero h1 { font-size: 24px; }
  .hero-sub { font-size: 15px; }

  /* Feature: ảnh lên trên (full ngang), nội dung xuống dưới
     + margin ngang để card không sát mép khi container đã bỏ padding */
  /* Giữ layout dạng row (ảnh trái, text phải) như desktop, không stack column */
  .feature { margin-left: 12px; margin-right: 12px; }
  .feature-thumb {
    width: 130px;
    min-width: 130px;
    height: auto;
    flex: none;
    align-self: stretch;
  }
  .feature-body {
    padding: 12px 14px;
    min-width: 0;   /* cho phép text co lại trong flex để clamp/ellipsis chạy đúng */
  }
  .feature-body h4 {
    font-size: 16px;
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .feature-body p {
    font-size: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .section-head { padding: 14px; }
  .collapsible > .section-body { margin: 18px 0 24px; }
  .section-head h2 { font-size: 18px; }

  /* Gallery: Bootstrap col-12 đã làm mỗi tile 1 hàng trên mobile, chỉ chỉnh chiều cao tile */
  .tile { height: 180px; }

  /* Mobile: bỏ padding ngang container cho các section trong <main> trừ .hero
     (header vẫn giữ padding để logo không sát mép) */
  main .container:not(.hero) { padding: 0; }
  /* .text-block { padding: 0; } */

  .header-inner { gap: 10px; }
  .brand-info span { font-size: 11.5px; }

  /* Trên mobile: Hero/Xác minh giữ nguyên đầu trang, About (đã chứa footer)
     được đẩy lên ngay sau Hero; các section còn lại giữ đúng thứ tự DOM phía dưới */
  main { display: flex; flex-direction: column; }
  .hero { order: -2; }
  .about-section { order: -1; }

  /* Khi nằm trong section trên mobile, footer co lại cho gọn */
  /* .about-section .site-footer { padding: 18px 0 8px; } */

  /* Lời chứng thực hiện là section cuối cùng trên mobile (do About đã đẩy lên trên)
     -> thêm margin-bottom để không bị sát lề dưới màn hình */
  .reviews { margin-bottom: 40px; }
}
