/* 06-forms.css — Progress bar, tombol kecil (btn-sm), section form, input, dan tombol submit.
   Diekstrak apa adanya dari index.html baris 890-1109 (commit 4734b5c).
   URUTAN MUAT PENTING: prefix angka menentukan urutan <link>. Jangan ditukar —
   beberapa selektor sengaja didefinisikan ulang dan bergantung pada urutan ini.
   Lihat docs/DECISIONS.md K-5. */

.progress-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
}

.progress-wrapper .progress-bar-container {
    flex: 1;
    height: 8px;
    background: #f0e0e0;
    border-radius: 10px;
    overflow: hidden;
    min-width: 50px;
}

.progress-wrapper .progress-bar-container .progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.progress-wrapper .progress-bar-container .progress-fill.selesai {
    background: #2e7d32;
}

.progress-wrapper .progress-bar-container .progress-fill.proses {
    background: #f57f17;
}

.progress-wrapper .progress-bar-container .progress-fill.tinjau {
    background: #c62828;
}

.progress-wrapper .progress-bar-container .progress-fill.perbaikan {
    background: #f57f17;
}

.progress-wrapper .progress-bar-container .progress-fill.selesai_perbaikan {
    background: #2e7d32;
}

.progress-wrapper .progress-text {
    font-size: 0.7rem;
    font-weight: 600;
    color: #4a3a3a;
    min-width: 35px;
    text-align: right;
}

.progress-wrapper .progress-label {
    font-size: 0.6rem;
    color: #8a6a6a;
    min-width: 55px;
}

.btn-sm {
    padding: 0.2rem 0.8rem;
    border: none;
    border-radius: 60px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.15s;
}

.btn-sm.primary {
    background: #d42a2a;
    color: white;
}

.btn-sm.primary:hover {
    background: #b82222;
}

.btn-sm.danger {
    background: #c62828;
    color: white;
}

.btn-sm.success {
    background: #2e7d32;
    color: white;
}

.btn-sm.warning {
    background: #f57f17;
    color: white;
}

.btn-sm.info {
    background: #0d47a1;
    color: white;
}

.btn-sm.outline {
    background: transparent;
    border: 1px solid #d42a2a;
    color: #d42a2a;
}

.btn-sm.outline:hover {
    background: #fff0f0;
}

.form-section {
    background: white;
    border-radius: 1.5rem;
    padding: 1.8rem 2rem;
    border: 1px solid #f0e0e0;
    max-width: 1100px;
    margin: 0 auto;
}

.form-section h4 {
    color: #7a3a3a;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    font-weight: 500;
    font-size: 0.8rem;
    color: #7a4a4a;
    margin-bottom: 0.3rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid #f0d0d0;
    border-radius: 12px;
    font-size: 0.9rem;
    background: white;
    transition: 0.15s;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #d42a2a;
    box-shadow: 0 0 0 3px rgba(212, 42, 42, 0.08);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-group .file-input-group {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.form-group .file-input-group .file-item {
    flex: 1;
    min-width: 150px;
}

.form-group .file-input-group .file-item label {
    font-size: 0.7rem;
    color: #8a6a6a;
}

.form-group .file-input-group .file-item input[type="file"] {
    padding: 0.4rem;
    border: 1px dashed #d42a2a;
    border-radius: 10px;
    background: #fff8f8;
    font-size: 0.8rem;
    width: 100%;
}

.btn-submit {
    background: #d42a2a;
    color: white;
    border: none;
    padding: 0.8rem 2.5rem;
    border-radius: 60px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 8px 20px -8px rgba(200, 40, 40, 0.3);
    margin-top: 0.5rem;
}

.btn-submit:hover {
    background: #b82222;
    transform: scale(1.01);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
/* Aksi form inspeksi (index.html .form-actions): satu primary (.btn-submit —
   Simpan & Ajukan / Ajukan Ulang), secondary (.btn-secondary — Simpan Draft),
   tertiary (.btn-text — Batal). Hanya modifier; .btn-submit lain tidak berubah. */
.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.btn-submit.btn-secondary {
    background: #ffffff;
    color: #b31b1b;
    border: 1px solid #d9a3a3;
    box-shadow: none;
}

.btn-submit.btn-secondary:hover {
    background: #fbf3f3;
    transform: none;
}

.btn-text {
    margin-top: 0.5rem;
    padding: 0.8rem 1rem;
    border: 0;
    background: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: #8a6a6a;
    cursor: pointer;
}

.btn-text:hover {
    color: #3a2a2a;
    text-decoration: underline;
}

.btn-text:focus-visible {
    outline: 2px solid #d42a2a;
    outline-offset: 2px;
}

/* ========== FORM BUAT / REVISI INSPEKSI (index.html .inspection-form) ==========
   Satu form kerja: bagian berjudul dipisah garis tipis (fieldset.form-block), bukan
   kartu per bagian; input berbingkai netral — merah hanya untuk fokus, aksi utama,
   dan galat; daftar temuan berupa baris, bukan badge/kartu. Semua aturan diawali
   .inspection-form: .form-group/.form-row di modal lain (jadwal, pengguna,
   progres perbaikan) tidak berubah. */
.inspection-form .revision-notice {
    margin-bottom: 1.2rem;
}

/* Catatan revisi menyatu dengan form: garis aksen kiri, bukan kartu berbingkai. */
.inspection-form .revision-info {
    padding: 0.9rem 1.1rem;
    border: 0;
    border-left: 3px solid #c62828;
    border-radius: 0;
    background: #fdf7f7;
}

/* min-width 0: fieldset bawaannya selebar isi minimumnya (bisa melebar di ponsel). */
.inspection-form .form-block {
    min-width: 0;
    margin: 0;
    padding: 1.2rem 0 0.2rem;
    border: 0;
    border-top: 1px solid #eee2e2;
}

/* float + clear: legend tampil sebagai judul biasa, tidak menempel di garis fieldset. */
.inspection-form .form-block-title {
    float: left;
    width: 100%;
    margin-bottom: 0.9rem;
    padding: 0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #7a3a3a;
}

/* Semua isi bagian di bawah judul (termasuk bila elemen pertamanya tersembunyi, mis.
   catatan foto yang kosong). */
.inspection-form .form-block > :not(.form-block-title) {
    clear: both;
}

/* Jarak antarfield hanya dari margin .form-group: saat .form-row menjadi satu kolom
   (layar sempit) field yang menumpuk tidak mendapat jarak ganda. */
.inspection-form .form-row {
    row-gap: 0;
}

.inspection-form .form-block-note {
    margin: 0 0 0.8rem;
    font-size: 0.78rem;
    color: #8a6a6a;
}

.inspection-form .form-block-note:empty {
    display: none;
}

.inspection-form .form-group label {
    color: #4a3434;
    font-weight: 600;
}

.inspection-form .required-mark {
    color: #c62828;
}

.inspection-form .optional-mark {
    font-weight: 400;
    color: #8a6a6a;
}

.inspection-form .form-group input,
.inspection-form .form-group select,
.inspection-form .select-search-wrapper input {
    padding: 0.65rem 0.85rem;
    border: 1px solid #d8cdcd;
    border-radius: 8px;
}

.inspection-form .select-search-wrapper input {
    padding-right: 35px;
}

.inspection-form .form-group input:focus,
.inspection-form .form-group select:focus,
.inspection-form .select-search-wrapper input:focus {
    border-color: #b31b1b;
    box-shadow: 0 0 0 3px rgba(179, 27, 27, 0.12);
}

/* Galat plant (plant-select.js markInvalid) tetap merah, juga saat fokus. */
.inspection-form .select-search-wrapper input.error {
    border-color: #c62828;
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.15);
}

.inspection-form .form-group input[readonly] {
    background: #f7f4f4;
    color: #5a4a4a;
}

.inspection-form .form-group input[type="file"] {
    padding: 0.45rem;
    font-size: 0.8rem;
}

/* Plant terpilih: teks konfirmasi, bukan pill hijau. */
.inspection-form .select-search-wrapper .selected-value {
    margin-top: 0.35rem;
    padding: 0;
    border-radius: 0;
    background: none;
    font-size: 0.78rem;
    font-weight: 500;
}

/* Isian temuan: deskripsi lebar, kategori, lalu Tambah sebaris (satu kolom di layar sempit). */
.inspection-form .finding-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 13rem auto;
    align-items: end;
    gap: 0 0.8rem;
}

/* Tambah tetap sebaris dengan deskripsi & kategori; "Kategori lainnya" (bila
   kategori = Lainnya) tepat di bawah pilihan kategori. */
.inspection-form .finding-entry-action {
    grid-column: 3;
    grid-row: 1;
}

.inspection-form .finding-entry-other {
    grid-column: 2;
    grid-row: 2;
}

.inspection-form .finding-add-btn {
    padding: 0.62rem 1.1rem;
    border: 1px solid #b31b1b;
    border-radius: 8px;
    background: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    color: #b31b1b;
    cursor: pointer;
}

.inspection-form .finding-add-btn:hover {
    background: #fbf3f3;
}

.inspection-form .finding-add-btn:focus-visible,
.inspection-form .finding-remove-btn:focus-visible {
    outline: 2px solid #d42a2a;
    outline-offset: 2px;
}

/* Daftar temuan: satu baris per temuan, kategori sekunder, Hapus di kanan, garis tipis. */
.inspection-form .finding-list {
    margin: 0.2rem 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid #eee2e2;
}

.inspection-form .finding-row {
    display: grid;
    grid-template-columns: 9rem minmax(0, 1fr) auto;
    grid-template-areas: "category description remove";
    align-items: baseline;
    gap: 0.15rem 0.8rem;
    padding: 0.65rem 0.2rem;
    border-bottom: 1px solid #eee2e2;
}

.inspection-form .finding-category {
    grid-area: category;
    font-size: 0.75rem;
    font-weight: 600;
    color: #8a6a6a;
}

.inspection-form .finding-description {
    grid-area: description;
    font-size: 0.9rem;
    color: #2a1a1a;
    overflow-wrap: anywhere;
}

.inspection-form .finding-remove-btn {
    grid-area: remove;
    padding: 0.2rem 0.3rem;
    border: 0;
    background: none;
    font-size: 0.8rem;
    font-weight: 600;
    color: #b31b1b;
    cursor: pointer;
}

.inspection-form .finding-remove-btn:hover {
    text-decoration: underline;
}

.inspection-form .finding-empty {
    padding: 0.8rem 0.2rem;
    border-bottom: 1px solid #eee2e2;
    font-size: 0.85rem;
    color: #8a6a6a;
}

.inspection-form .finding-counter {
    margin: 0.5rem 0 0;
    font-size: 0.78rem;
    color: #8a6a6a;
}

/* Baris aksi: dipisah garis tipis; tombol primary & secondary sama tinggi, sudut
   sederhana, tanpa bayangan; Batal tetap tautan teks (.btn-text). */
.inspection-form .form-actions {
    margin-top: 1.2rem;
    padding-top: 1.2rem;
    border-top: 1px solid #eee2e2;
}

.inspection-form .form-actions .btn-submit {
    margin-top: 0;
    padding: 0.7rem 1.4rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.95rem;
    box-shadow: none;
}

.inspection-form .form-actions .btn-submit.btn-secondary {
    border-color: #d9a3a3;
}

.inspection-form .form-actions .btn-submit:hover {
    transform: none;
}

.inspection-form .form-actions .btn-text {
    margin-top: 0;
    padding: 0.7rem 0.6rem;
}
