/* Sổ tay xe 2.0 — forms.css · kiểu riêng của các form (do agent M sở hữu).
 * Dùng .field / .input / .stepper / details.fold… từ components.css; chỉ thêm kiểu RIÊNG của form, KHÔNG định nghĩa lại thành phần chung.
 * Tiền tố .f-… (lưu ý: layout.css đã dùng .f-bg .f-panel .f-bar .f-line .f-ico .f-hotbg .f-hotring .f-arrow .f-lbl .f-lbl2 .f-app .f-appmain .f-glyph cho hình minh hoạ cổng cài đặt — không dùng lại các tên đó). */

/* ---------- khung form + thanh nút cuối form ---------- */
.f-form { min-width: 0; min-height: calc(100vh - var(--sat-eff) - var(--offtop) - 158px - var(--sab)); min-height: calc(100dvh - var(--sat-eff) - var(--offtop) - 158px - var(--sab)); }   /* form ngắn vẫn đẩy thanh nút xuống sát đáy màn hình */
.f-form > .h1 { margin-top: 8px; }
.f-form > .sub { margin-bottom: 16px; }
.f-form .field { min-width: 0; }
.f-form .chip { min-height: 48px; }   /* điều khiển trong form cao ≥ 48 px (bằng ô nhập) */
.f-gap { height: 8px; }
.f-note { margin: 12px 2px 0; }
.f-actions { z-index: 15; margin-bottom: calc(-1 * (var(--sab) + 32px)); }   /* chạm đáy khi cuộn tới cuối (bù padding-bottom của #view.notab) */
body.kb .f-actions { visibility: hidden; pointer-events: none; }   /* bàn phím mở: không để thanh nút che ô đang nhập */
.f-live:empty, .f-diff:empty { display: none; }

/* dòng nhãn + phần phụ bên phải (bộ đếm ảnh, nút xoá thông số / dòng chi tiết, "Chọn tất cả") */
.f-lblrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; margin: 0 0 6px; }
.f-lblrow > label, .f-lblrow > .lbl, .f-lblrow > .small { margin: 0 0 0 2px; font-size: var(--fs-cap); font-weight: 600; color: var(--text-2); }
.f-hint-after { margin: -10px 2px 16px; }

/* ---------- thẻ xe chỉ đọc (khi chỉ có 1 xe) ---------- */
.f-veh { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 12px; margin: 0 0 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-ctl); }
.f-veh .plate { flex: none; }
.f-veh-t { flex: 1 1 auto; min-width: 0; }
.f-veh-k { font-size: var(--fs-tiny); font-weight: 600; color: var(--text-2); }
.f-veh-n { font-size: var(--fs-card); font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- hàng công tắc / danh sách chọn ---------- */
.f-switchbox { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); margin: 0 0 16px; overflow: hidden; }
.f-sw .ttl, .f-sw .meta, .f-pick .ttl, .f-pick .meta { display: block; }
.f-sub { margin-top: 2px; }
.f-small { font-size: var(--fs-tiny); }
.f-pick .f-small { color: var(--faint); }
.f-pickbar { margin: 4px 0 8px; }
.f-errslot { margin: 0 0 12px; }
.f-errslot:not(.has-err) { display: none; }
.f-pickbtns { display: inline-flex; gap: 0; margin-right: -10px; }

/* ---------- ảnh: n/6, xem trước, xoá trước khi lưu ---------- */
.f-photofield { margin-bottom: 16px; }
.f-vehphoto { margin-bottom: 16px; }
.f-vpbtn { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--border-strong); border-radius: var(--r-ctl); overflow: hidden; background: none; color: inherit; font: inherit; }
.f-vpcta { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 14px; border-radius: var(--r-pill); background: rgba(15, 23, 42, .74); color: #fff; font-size: var(--fs-cap); font-weight: 600; white-space: nowrap; }
.f-vpcta svg { width: 18px; height: 18px; }
.f-vpdel { margin-top: 2px; }
.f-count { flex: none; font-size: var(--fs-tiny); font-weight: 700; padding: 2px 10px; border-radius: var(--r-pill); background: var(--surface-3); color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.f-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.f-photos .ph, .f-photos .add { aspect-ratio: 1 / 1; min-height: 80px; border-radius: var(--r-ctl); }
.f-photos .ph { position: relative; background: var(--surface-3); overflow: hidden; }
.f-photos .pv { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: none; }
.f-photos .pv img { display: block; width: 100%; height: 100%; object-fit: cover; }
.f-photos .x { position: absolute; top: 0; right: 0; width: 44px; height: 44px; padding: 0; border: 0; background: none; display: grid; place-items: center; }   /* vùng chạm 44 px, nút nhìn thấy 26 px */
.f-photos .x span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(15, 23, 42, .74); color: #fff; }
.f-photos .x svg { width: 14px; height: 14px; stroke-width: 2.6; }
.f-photos .add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 4px; border: 2px dashed var(--border-strong); background: none; color: var(--text-2); font-size: var(--fs-tiny); font-weight: 600; line-height: 1.2; text-align: center; }
.f-photos .add svg { width: 24px; height: 24px; }
.f-photos .add:active { background: var(--surface-2); }
.f-bigphoto { display: block; width: 100%; max-height: 64vh; max-height: 64dvh; object-fit: contain; margin-top: 8px; border-radius: var(--r-ctl); background: var(--surface-3); }

/* ---------- form xe ---------- */
.f-per { display: flex; align-items: center; gap: 8px; }
.f-per .grow { min-width: 0; }
.f-per-u { flex: 0 0 112px; min-width: 0; }
.f-rate { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.f-rate .stars button { min-width: 44px; }   /* vùng chạm ≥ 44 × 44 */

/* ---------- thiết lập mốc (bước 3) ---------- */
.f-bl-h { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.f-bl-i { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-ctl); background: var(--surface); border: 1px solid var(--border); font-size: 20px; }
.f-bl .field { margin-bottom: 12px; }
.f-bl .field:last-child { margin-bottom: 0; }
.f-bl .grid2 .field { margin-bottom: 0; }

/* ---------- cập nhật số km (S09) ---------- */
.f-vh { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 14px; margin: 0 0 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.f-vh-t { flex: 1 1 auto; min-width: 0; }
.f-vh-n { margin-top: 1px; font-size: 20px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.f-vh .plate { margin-top: 6px; }
.f-prev { margin: 0 0 16px; padding: 12px 14px; border-radius: var(--r-ctl); background: var(--surface-2); border: 1px solid var(--border); }
.f-prev.none { border-style: dashed; font-size: 14px; color: var(--text-2); }
.f-prev-k { font-size: var(--fs-tiny); font-weight: 600; color: var(--text-2); }
.f-prev-v { margin-top: 2px; font-size: 15px; font-weight: 600; color: var(--text-2); }
.f-prev-v b { font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.f-prev-d { margin-top: 2px; font-size: var(--fs-cap); color: var(--text-2); overflow-wrap: anywhere; }
.f-kmfield .input { min-height: 64px; font-size: 26px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.f-kmfield .input::placeholder { font-weight: 500; }
.f-kmfield .with-unit .input { padding-right: 64px; }
.f-kmfield .with-unit .u { font-size: 16px; right: 16px; }
.f-diff { font-weight: 600; color: var(--text-2); }
.f-diff.warn { color: var(--st-soon-fg); }
.f-quick { margin: -6px 0 16px; }

/* ---------- ghi bảo dưỡng / sửa chữa / chi phí khác (S07, S08) ---------- */
.f-plans .lbl { margin-bottom: 8px; }
.f-more { margin-top: 6px; }
.f-more > summary { list-style: none; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 4px; color: var(--accent); font-size: 14px; font-weight: 600; cursor: pointer; }
.f-more > summary::-webkit-details-marker { display: none; }
.f-more > summary::after { content: ""; width: 16px; height: 16px; background: currentColor; transition: transform .2s; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat; }
.f-more[open] > summary::after { transform: rotate(180deg); }
.chip.f-pchip { height: auto; max-width: 100%; padding: 6px 14px; flex-wrap: wrap; justify-content: flex-start; gap: 2px 8px; text-align: left; white-space: normal; line-height: 1.25; }
.f-pn { min-width: 0; overflow-wrap: anywhere; }
.f-pchk { display: inline-flex; flex: none; }
.f-pchk svg { width: 16px; height: 16px; stroke-width: 3; }
.f-pst { flex: none; padding: 1px 8px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; line-height: 16px; white-space: nowrap; }
.f-pst.st-over { background: var(--st-over-bg); color: var(--st-over-fg); }
.f-pst.st-maybe { background: var(--st-maybe-bg); color: var(--st-maybe-fg); box-shadow: inset 0 0 0 1px var(--st-maybe-bar); }
.f-pst.st-soon { background: var(--st-soon-bg); color: var(--st-soon-fg); }
.f-costsub { margin: -4px 0 12px; }
.f-ln .f-lblrow { margin-bottom: 4px; }
.f-ln-t { display: inline-flex; align-items: center; gap: 8px; margin-left: 2px; font-size: var(--fs-cap); font-weight: 700; color: var(--text-2); }
.f-ln .field { margin-bottom: 10px; }
.f-ln .grid2 .field { margin-bottom: 2px; }
.f-addln { margin: 4px 0 16px; }
.f-computed { margin: 4px 0 16px; }
.f-lblrow .x svg { width: 18px; height: 18px; }
.f-computed .total-box { margin: 0 0 6px; }
.f-quickamt { margin-top: -4px; margin-bottom: 16px; }

/* ---------- giấy tờ / gia hạn (S13) ---------- */
.f-sugg { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; }
.f-ctx { margin: 0 0 16px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.f-ctx-n { font-size: 17px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.f-ctx-s { margin-top: 2px; font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }
.f-ctx-d { margin-top: 8px; font-size: 14px; }
