/* ============================================================
   BIỂU MẪU: trang Đăng sự kiện (dang-su-kien.html) và trang Duyệt (duyet.html)
   Màu, font, bo góc lấy từ tokens.css.
   ============================================================ */
/* phần tử có thuộc tính hidden luôn ẩn, kể cả khi class của nó đặt display: flex/grid */
.form-page [hidden] { display: none !important; }
.form-page { max-width: 860px; padding-top: 44px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 26px; }
.form-head { display: flex; flex-direction: column; gap: 10px; }
.form-head h1 { margin: 0; color: var(--cam-tieu-de); font-family: var(--font-tieu-de); font-weight: 400; font-size: clamp(30px, 4vw, 42px); line-height: 1.15; }
.form-head p { margin: 0; font-size: 16.5px; line-height: 1.65; color: var(--chu-nhat); max-width: 720px; }
.back-link { font-size: 14px; font-weight: 600; text-decoration: none; }

/* các bước */
.fsteps { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; font-size: 13px; }
.fsteps li { padding: 10px 12px; border-radius: var(--bo-nut); background: var(--nen-trang); border: 1px solid var(--vien); color: var(--chu-nhat); }
.fsteps li.done { background: var(--la-nhat); border-color: var(--la-nhat); color: var(--la); font-weight: 600; }
.fsteps li[aria-current="step"] { background: var(--la); border-color: var(--la); color: #fff; font-weight: 600; }

/* khung biểu mẫu */
.fcard { background: var(--nen-trang); border: 1px solid var(--vien); border-radius: var(--bo-the); padding: 32px; display: flex; flex-direction: column; gap: 24px; }
.fsec { display: flex; flex-direction: column; gap: 20px; padding-top: 26px; border-top: 1px solid var(--vien-nhat); }
.fsec:first-child { padding-top: 0; border-top: 0; }
.fsec > h2 { margin: 0; font-family: var(--font-tieu-de); font-weight: 600; font-size: 21px; color: var(--chu); display: flex; align-items: center; gap: 10px; }
.fsec > h2 .num { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--la-nhat); color: var(--la); font-size: 15px; display: inline-flex; align-items: center; justify-content: center; }
.fsec-note { margin: -8px 0 0; font-size: 14px; line-height: 1.55; color: var(--chu-mo); }
.fsec-private { padding: 12px 14px; border-radius: var(--bo-nut); background: var(--la-rat-nhat); font-size: 14px; line-height: 1.55; color: var(--la-dam); margin: -6px 0 0; }

.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field > label, .field > .lbl, fieldset.field > legend { font-weight: 600; font-size: 15.5px; padding: 0; }
.req { color: #9A3B24; margin-left: 2px; }
.opt { font-weight: 400; color: var(--chu-mo); font-size: 14px; }
.hint { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--chu-mo); }
fieldset.field { margin: 0; border: 0; padding: 0; }
fieldset.field > legend { margin-bottom: 8px; }

.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.fgrid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }

.inp, .field input[type="text"], .field input[type="email"], .field input[type="tel"], .field input[type="url"],
.field input[type="date"], .field input[type="time"], .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 1px solid #B8A979; border-radius: var(--bo-nut);
  font: inherit; font-size: 16px; color: var(--chu); background: #FFFCF2;
}
.field textarea { padding: 12px 14px; line-height: 1.55; resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus, .choice input:focus-visible + span { outline: 3px solid rgba(63, 107, 42, .35); outline-offset: 1px; border-color: var(--la); }
.field.has-err input, .field.has-err select, .field.has-err textarea { border: 2px solid #9A3B24; }
.ferr { margin: 0; font-size: 14px; line-height: 1.5; color: #8A3320; }
.ferr strong { font-weight: 600; }
.ferr[hidden] { display: none; }

/* lựa chọn dạng thẻ (radio / checkbox) */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 8px; }
.choices.col-1 { grid-template-columns: 1fr; }
.choice { position: relative; display: flex; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice > span {
  flex: 1; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 14px;
  border: 1px solid var(--vien-vang); border-radius: var(--bo-nut); background: #FFFCF2;
  font-size: 15px; line-height: 1.4; cursor: pointer;
}
.choice > span::before {
  content: ''; flex: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid #A99A68; background: #fff; box-sizing: border-box;
}
.choice input[type="checkbox"] + span::before { border-radius: 5px; }
.choice input:checked + span { border: 2px solid var(--la); background: var(--la-nhat); padding: 9px 13px; font-weight: 600; }
.choice input:checked + span::before { border-color: var(--la); background: radial-gradient(circle, var(--la) 0 4px, #fff 5px); }
.choice input[type="checkbox"]:checked + span::before { background: var(--la) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.6l4.6-5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.days .choice > span { justify-content: center; padding: 8px 4px; font-size: 14px; min-height: 44px; }
.days .choice > span::before { display: none; }
.days .choice input:checked + span { padding: 7px 3px; }
.other-inp { margin-top: 2px; }
.other-inp[hidden] { display: none; }
.subbox { display: flex; flex-direction: column; gap: 16px; padding: 18px; border-radius: 12px; background: var(--nen-kem); border: 1px dashed var(--vien-vang); }
.subbox[hidden] { display: none; }

/* ảnh */
.pic { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.pic-box { width: 120px; height: 120px; border-radius: 12px; border: 1px dashed #B8A979; background: #FFFCF2; display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--chu-mo); font-size: 13px; text-align: center; padding: 8px; }
.pic-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pic-box.has-img { padding: 0; border-style: solid; }
.pic-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* khối vàng "ý nghĩa" */
.fyellow { padding: 20px; border-radius: 12px; background: var(--nang); }
.fyellow .hint { color: #4A3F36; }
.fyellow textarea { background: #fff; border-color: #C9B06A; min-height: 96px; }

.confirm { display: flex; align-items: flex-start; gap: 12px; font-size: 15px; line-height: 1.5; cursor: pointer; }
.confirm input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--la); }

/* nút */
.factions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--vien-nhat); padding-top: 22px; }
.btn { min-height: 48px; padding: 0 22px; border-radius: var(--bo-nut); font: inherit; font-size: 15.5px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn-main { border: 0; background: var(--la); color: #fff; font-weight: 600; padding: 0 26px; }
.btn-main:hover { background: var(--la-dam); color: #fff; }
.btn-soft { border: 1px solid var(--vien-vang); background: #FFFCF2; color: var(--chu); }
.btn-soft:hover { background: var(--la-nhat); color: var(--chu); }
.btn-warn { border: 1px solid #D9A28F; background: #FBEAE3; color: #8A3320; font-weight: 600; }
.btn-warn:hover { background: #F6D6CA; color: #6E2614; }
.btn-ghost { border: 0; background: transparent; color: var(--la); font-weight: 600; padding: 0 10px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; }

/* hộp báo */
.fmsg { border-radius: var(--bo-the); padding: 18px 22px; font-size: 15px; line-height: 1.6; }
.fmsg-err { background: #FBEAE3; color: #6E2614; border: 1px solid #E9B8A6; }
.fmsg-ok { background: var(--la-nhat); color: var(--la-dam); }
.fmsg[hidden] { display: none; }
.fdone { background: var(--la-nhat); border-radius: var(--bo-the); padding: 32px 28px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.fdone .eyebrow { font-size: 12px; letter-spacing: .1em; color: var(--la); font-weight: 600; }
.fdone h2 { margin: 0; font-family: var(--font-tieu-de); font-weight: 600; font-size: 26px; }
.fdone p { margin: 0; font-size: 15.5px; line-height: 1.65; color: #3E453C; max-width: 640px; }

/* xem trước thẻ */
.preview { display: flex; flex-direction: column; gap: 14px; }
.preview-label { font-size: 12px; letter-spacing: .1em; color: var(--la); font-weight: 600; }
.preview-stage { background: var(--nen-xanh); border-radius: var(--bo-khoi); padding: 22px; }
.preview-stage .card { max-width: 560px; margin: 0 auto; }
.review-list { margin: 0; display: grid; grid-template-columns: minmax(130px, 200px) 1fr; gap: 8px 18px; font-size: 14.5px; line-height: 1.5; }
.review-list dt { color: var(--chu-mo); }
.review-list dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ô bẫy chống spam: người thật không thấy */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 760px) {
  .form-page { padding-top: 26px; padding-bottom: 48px; gap: 22px; }
  .fcard { padding: 22px 16px; }
  .fgrid { grid-template-columns: 1fr; }
  .fgrid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fsteps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-list { grid-template-columns: 1fr; gap: 2px; }
  .review-list dd { margin-bottom: 10px; }
  .preview-stage { padding: 14px 10px; }
  .factions .btn { flex: 1 1 auto; }
}
@media (max-width: 420px) {
  .days { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ============================================================
   TRANG DUYỆT
   ============================================================ */
.adm-page { max-width: 1100px; }
.login { max-width: 440px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs button { min-height: 44px; padding: 0 16px; border-radius: var(--bo-tron); border: 1px solid var(--vien-vang); background: var(--nen-trang); font: inherit; font-size: 14.5px; color: var(--chu); cursor: pointer; }
.tabs button[aria-pressed="true"] { background: var(--la); border-color: var(--la); color: #fff; font-weight: 600; }
.tabs .n { display: inline-block; min-width: 22px; margin-left: 6px; padding: 1px 7px; border-radius: var(--bo-tron); background: rgba(0,0,0,.08); font-size: 12.5px; }
.adm-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.adm-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-list { display: flex; flex-direction: column; gap: 18px; }
.adm-empty { padding: 28px; text-align: center; color: var(--chu-mo); background: var(--nen-trang); border: 1px dashed var(--vien); border-radius: var(--bo-the); }
.adm-item { background: var(--nen-trang); border: 1px solid var(--vien); border-radius: var(--bo-the); overflow: hidden; }
.adm-item > summary { list-style: none; cursor: pointer; padding: 16px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.adm-item > summary::-webkit-details-marker { display: none; }
.adm-item > summary::after { content: '▾'; margin-left: auto; color: var(--chu-mo); }
.adm-item[open] > summary::after { content: '▴'; }
.adm-item[open] > summary { border-bottom: 1px solid var(--vien-nhat); }
.adm-title { font-family: var(--font-tieu-de); font-weight: 600; font-size: 17px; }
.adm-meta { font-size: 13.5px; color: var(--chu-mo); }
.badge { display: inline-block; padding: 3px 10px; border-radius: var(--bo-tron); font-size: 12.5px; font-weight: 600; }
.b-pending { background: var(--nen-vang-nhat); color: var(--nau-nhac); }
.b-approved { background: var(--la-nhat); color: var(--la-dam); }
.b-rejected { background: #FBEAE3; color: #8A3320; }
.adm-body { padding: 20px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.adm-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.adm-col h3 { margin: 0; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--la); }
.adm-note { margin-top: -10px; }
.adm-contact {padding: 14px 16px; border-radius: var(--bo-nut); background: var(--la-rat-nhat); font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere; }
.adm-reason { padding: 12px 14px; border-radius: var(--bo-nut); background: #FBEAE3; color: #6E2614; font-size: 14.5px; line-height: 1.55; }
.adm-edit { display: flex; flex-direction: column; gap: 12px; }
.adm-edit .field > label { font-size: 13.5px; }
.adm-edit .field input, .adm-edit .field select, .adm-edit .field textarea { min-height: 42px; font-size: 15px; }
.adm-edit .field textarea { min-height: 110px; }
.adm-rbox { margin: 0 20px 16px; padding: 16px 18px 18px; border: 2px solid var(--la); border-radius: var(--bo-the); background: var(--la-nhat); display: flex; flex-direction: column; gap: 14px; }
.adm-rbox h3 { margin: 0; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: var(--la-dam); }
.adm-rbox .field select, .adm-rbox .field input { background: #fff; }
.adm-rbox .hint { color: var(--la-dam); }
.adm-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--vien-nhat); background: #FFFDF6; }
.adm-reject { display: flex; flex-direction: column; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--vien-nhat); background: #FFF6F2; }
.adm-reject[hidden] { display: none; }
.adm-pic { width: 96px; height: 96px; border-radius: 10px; object-fit: cover; border: 1px solid var(--vien); }
@media (max-width: 860px) {
  .adm-body { grid-template-columns: 1fr; padding: 16px; }
  .adm-actions, .adm-reject { padding: 14px 16px; }
  .adm-rbox { margin: 0 16px 14px; padding: 14px; }
  .adm-rbox .fgrid { grid-template-columns: 1fr; }
  .adm-item > summary { padding: 14px 16px; }
}
