/* f5aitool.work - "Studio Neutral Dark"
 *
 * Nen XAM TRUNG TINH THUAN, khong nga xanh: cac tool cua trang xoay quanh
 * anh chan dung, nen nhiem mau lam lech cam nhan tong da (ly do Lightroom/
 * Capture One deu dung xam trung tinh). Mau chi dung cho hanh dong/trang thai.
 */

:root {
  /* Nen va be mat - thang xam trung tinh (R=G=B gan bang nhau) */
  --nen: #111113;
  --be-mat: #1c1c1f;
  --be-mat-noi: #232327;
  --vien: #2a2a2e;
  /* Chu */
  --chu: #ececee;          /* ~14:1 tren --nen */
  --chu-mo: #a4a4ab;       /* ~6:1 tren --nen */
  /* Hanh dong - MOT mau accent duy nhat */
  --cam: #f97316;
  --cam-dam: #ea6a0c;
  /* Link/thong tin */
  --xanh: #60a5fa;         /* sang hon #2563EB de du 4.5:1 tren nen toi */
  --bo-goc: 12px;
  --chuyen: 200ms ease-out;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--nen);
  color: var(--chu);
  line-height: 1.6;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

a { color: var(--xanh); }

/* --- Khung trang --- */

.khung { width: min(1100px, 100% - 2.5rem); margin-inline: auto; }

header.dau-trang {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--vien);
}

.dau-trang .khung { display: flex; align-items: center; justify-content: space-between; }

.logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--chu);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.logo .cham { color: var(--cam); }

/* --- Trạng thái đăng nhập ở đầu trang --- */

.tai-khoan { display: flex; align-items: center; gap: 0.6rem; font-size: 0.88rem; }
.tai-khoan .ten { color: var(--chu-mo); }

.tai-khoan a {
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--vien);
  color: var(--chu);
  text-decoration: none;
  transition: border-color var(--chuyen), background var(--chuyen);
}
.tai-khoan a:hover { border-color: var(--chu-mo); background: var(--be-mat); }
/* Nút đăng nhập là hành động chính khi chưa có phiên */
.tai-khoan a.chinh {
  background: var(--cam); color: #1a1205; font-weight: 600; border-color: transparent;
}
.tai-khoan a.chinh:hover { background: var(--cam-dam, var(--cam)); filter: brightness(1.08); }

/* Thẻ tool khi chưa đăng nhập: vẫn bấm được (sang trang đăng nhập rồi quay
   lại), chỉ nói trước để không ai tưởng bị lỗi. */
.the-tool .can-dang-nhap {
  /* block chứ KHÔNG inline-block: `.trang-thai` ngay trước là inline nên
     inline-block sẽ nằm dính cùng dòng ("Đang hoạt độngCần đăng nhập"). */
  display: block;
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--chu-mo);
}

/* --- Hero --- */

.hero { padding: 5rem 0 3.5rem; text-align: center; }

.hero h1 {
  font-size: clamp(1.9rem, 5vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  max-width: 21ch;
  margin-inline: auto;
}

.hero h1 .nhan-cam { color: var(--cam); }

.hero p {
  margin-top: 1rem;
  color: var(--chu-mo);
  font-size: 1.06rem;
  max-width: 52ch;
  margin-inline: auto;
}

/* --- Luoi tool --- */

.muc-tool { padding: 1rem 0 4rem; }

.muc-tool h2 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--chu-mo);
  margin-bottom: 1rem;
}

.luoi-tool {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.the-tool {
  display: block;
  background: var(--be-mat);
  border: 1px solid var(--vien);
  border-radius: var(--bo-goc);
  padding: 1.4rem;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--chuyen), transform var(--chuyen), background var(--chuyen);
}

a.the-tool { cursor: pointer; }

a.the-tool:hover, a.the-tool:focus-visible {
  border-color: var(--cam);
  background: var(--be-mat-noi);
  transform: translateY(-2px);
}

a.the-tool:focus-visible { outline: 2px solid var(--cam); outline-offset: 2px; }

.the-tool .bieu-tuong {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--be-mat-noi);
  border: 1px solid var(--vien);
  border-radius: 10px;
  margin-bottom: 0.9rem;
  color: var(--cam);
}

.the-tool .bieu-tuong svg { width: 22px; height: 22px; }

.the-tool h3 { font-size: 1.05rem; font-weight: 600; }

.the-tool p { margin-top: 0.35rem; color: var(--chu-mo); font-size: 0.92rem; }

.the-tool .trang-thai {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.9rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--chu-mo);
}

.the-tool .trang-thai::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.the-tool[data-trang-thai="hoat-dong"] .trang-thai { color: #4ade80; }

.the-tool[data-trang-thai="sap-ra-mat"] { opacity: 0.75; }

/* --- Chan trang --- */

footer.chan-trang {
  margin-top: auto;
  border-top: 1px solid var(--vien);
  padding: 1.5rem 0;
  color: var(--chu-mo);
  font-size: 0.85rem;
}

/* --- Kha nang tiep can --- */

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

@media (max-width: 480px) {
  .hero { padding: 3.5rem 0 2.5rem; }
}
