/* THL JOBS · Giai đoạn 1 – Học tập dễ dàng. Giao diện ưu tiên điện thoại. */
:root {
  --red: #c8102e;
  --red-dark: #990b24;
  --red-soft: #fff0f2;
  --ink: #262321;
  --muted: #6f6966;
  --line: #ece4e2;
  --paper: #fff;
  --canvas: #faf7f6;
  --green: #237b55;
  --green-soft: #eef8f2;
  --amber: #8a5a00;
  --amber-soft: #fff6e0;
  --radius: 16px;
  --font: "Be Vietnam Pro", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-tap-highlight-color: transparent; }
body { margin: 0; min-height: 100vh; background: var(--canvas); font-family: var(--font); line-height: 1.55; }
a { color: inherit; }
:focus-visible { outline: 3px solid #e57b8d; outline-offset: 2px; border-radius: 8px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 60px; padding: 8px max(16px, calc((100vw - 1040px) / 2));
  background: rgba(255, 255, 255, 0.96); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--red); font-weight: 700; font-size: 17px; }
.brand img { width: 40px; height: 40px; object-fit: contain; }
.header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
.btn {
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px; border: 1px solid var(--red); border-radius: 10px; background: #fff; color: var(--red);
  font: 600 14px var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--red-soft); }
.btn.primary { background: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

@media (max-width: 420px) {
  .brand span { display: none; }          /* màn hình hẹp: chỉ giữ logo để header trên một hàng */
  .header-actions { gap: 6px; }
  .header-actions .btn { padding: 8px 10px; font-size: 13px; }
}

main { width: min(100% - 32px, 1040px); margin: 0 auto; padding: 20px 0 48px; }

/* Lời chào */
.hello { padding: 22px 20px; border-radius: var(--radius); background: linear-gradient(135deg, var(--red), #e0384f); color: #fff; }
.hello h1 { margin: 0 0 6px; font-size: clamp(22px, 5.4vw, 30px); line-height: 1.25; }
.hello p { margin: 0; font-size: 15px; opacity: 0.95; }
.hello .hello-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.hello .btn { border-color: #fff; }
.hello .btn.light { background: #fff; color: var(--red); }
.hello .btn.ghost { background: transparent; color: #fff; }
.hello .btn.ghost:hover { background: rgba(255, 255, 255, 0.15); }

/* Tiêu đề nhóm */
.group-title { display: flex; align-items: center; gap: 10px; margin: 28px 0 10px; font-size: 18px; }
.tag { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.tag.public { background: var(--green-soft); color: var(--green); }
.tag.private { background: var(--red-soft); color: var(--red); }
.tag.soon { background: var(--amber-soft); color: var(--amber); }
.group-note { margin: -4px 0 12px; color: var(--muted); font-size: 14px; }

/* Thẻ học liệu */
.cards { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .cards.three { grid-template-columns: repeat(3, 1fr); } }
.card {
  position: relative; display: flex; gap: 14px; align-items: flex-start;
  min-height: 92px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); text-decoration: none; color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
a.card:hover { border-color: #e7b7c0; box-shadow: 0 8px 20px rgba(120, 20, 40, 0.08); }
a.card:active { transform: scale(0.99); }
.card-icon {
  flex: 0 0 48px; height: 48px; display: grid; place-items: center; border-radius: 12px;
  background: var(--red-soft); color: var(--red); font-size: 22px; font-weight: 700;
}
.card-body { min-width: 0; }
.card h3 { margin: 0 0 4px; font-size: 17px; line-height: 1.3; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.card-title-link { color: inherit; text-decoration: none; }
.card-title-link:hover { color: var(--red); }
.card .tag { margin-top: 8px; }
.card .meta { display: inline-block; margin-top: 6px; color: var(--red); font-size: 13px; font-weight: 700; }
.card.locked { background: #fbfafa; }
.card.locked .card-icon { background: #f1eeed; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  min-height: 40px; min-width: 64px; display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff;
  color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none;
}
.chip:hover { border-color: var(--red); color: var(--red); }

/* Tiếp tục học */
.continue { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 12px 16px;
  border: 1px dashed #e7b7c0; border-radius: var(--radius); background: #fff; }
.continue p { margin: 0; font-size: 14px; color: var(--muted); }
.continue strong { color: var(--ink); }

/* Ô thông tin */
.notice { margin-top: 24px; padding: 14px 16px; border-radius: 12px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.notice strong { color: var(--ink); }

/* Lớp học của tôi */
.empty { padding: 26px 20px; border: 1px dashed #e2d6d3; border-radius: var(--radius); background: #fff; text-align: center; }
.empty .empty-icon { width: 64px; height: 64px; margin: 0 auto 10px; display: grid; place-items: center; border-radius: 50%; background: var(--red-soft); color: var(--red); font-size: 28px; }
.empty h3 { margin: 0 0 6px; font-size: 18px; }
.empty p { margin: 0 auto; max-width: 460px; color: var(--muted); font-size: 14px; }
.skeleton-list { display: grid; gap: 10px; }
.skeleton-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.skeleton-row span { display: block; height: 12px; border-radius: 6px; background: #f1eceb; }
.skeleton-row span.short { width: 64px; }
.skeleton-row span.long { width: 70%; }
.checking { padding: 40px 0; text-align: center; color: var(--muted); }
html.thl-auth-checking .needs-auth { display: none; }
html:not(.thl-auth-checking) .checking { display: none; }

footer { padding: 24px 16px 40px; text-align: center; color: var(--muted); font-size: 13px; }
