/* =========================================================
   TEMA FORM SPT - SAMA DENGAN KALENDER & LPK
   Dimuat SETELAH style.css (hanya dipakai di form.html)
========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

/* ---------- Latar halaman ---------- */
body {
    background: #EAF5F6 !important;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(180deg, #cfecef 0, rgba(234, 245, 246, 0) 340px),
        radial-gradient(ellipse 55% 40% at 100% 0%, rgba(0, 140, 145, 0.22), transparent 70%),
        radial-gradient(ellipse 55% 40% at 35% 0%, rgba(32, 196, 199, 0.25), transparent 70%);
}

html::after {
    content: "";
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 420px;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(circle, rgba(32, 196, 199, 0.65) 2.2px, transparent 2.8px) 0 0 / 15px 15px;
    -webkit-mask-image: radial-gradient(ellipse 100% 100% at 0 0, #000 20%, transparent 75%);
    mask-image: radial-gradient(ellipse 100% 100% at 0 0, #000 20%, transparent 75%);
}

body::after {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 170px;
    z-index: -1;
    pointer-events: none;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 220' preserveAspectRatio='none'><path d='M0 90 C90 40 190 20 270 70 C350 120 500 205 760 220 L0 220 Z' fill='%2320C4C7' fill-opacity='.40'/><path d='M0 130 C100 85 190 70 260 115 C340 165 480 212 760 220 L0 220 Z' fill='%23008C91'/><path d='M0 170 C120 150 250 190 420 205 C520 214 640 220 760 220 L0 220 Z' fill='%23006B70'/><path d='M1440 120 C1340 150 1230 195 1000 220 L1440 220 Z' fill='%23008C91'/><path d='M1440 160 C1350 180 1250 205 1120 220 L1440 220 Z' fill='%23006B70'/></svg>") no-repeat bottom / 100% 170px;
}

/* Foto gedung BBKK di kanan bawah (tidak terpotong) */
html::before {
    content: "";
    position: fixed;
    right: 0;
    bottom: 0;
    width: min(640px, 46vw);
    height: 80vh;
    z-index: -1;
    pointer-events: none;
    background: url("assets/gedung.jpg") no-repeat right bottom / auto 100%;
    opacity: 0.92;
    -webkit-mask-image:
        linear-gradient(90deg, transparent 0%, #000 40%),
        linear-gradient(180deg, transparent 0%, #000 25%);
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(90deg, transparent 0%, #000 40%),
        linear-gradient(180deg, transparent 0%, #000 25%);
    mask-composite: intersect;
}

/* ---------- Font Poppins hanya untuk form (surat tetap Calibri) ---------- */
main.container,
main.container input,
main.container textarea,
main.container select,
main.container button,
.sidebar-drawer,
.sidebar-drawer button,
.hasil-action-buttons button,
.result-header {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
}

/* ---------- Judul bagian ---------- */
.section-title span {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    background: rgba(0, 140, 145, 0.12);
    color: #006B70 !important;
    letter-spacing: 1.5px;
}

.section-title h2 {
    font-size: 30px;
    font-weight: 700;
    color: #0B4F62;
    margin: 10px 0 6px;
}

.section-title p {
    color: #4f8a93;
    font-size: 14px;
}

/* ---------- Kartu ---------- */
#form .card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: 18px;
    padding: 28px 30px;
    margin-bottom: 22px;
    box-shadow: 0 10px 30px rgba(0, 107, 112, 0.12);
}

#form .card::before {
    height: 5px;
    background: linear-gradient(90deg, #006B70 0%, #008C91 55%, #20C4C7 100%);
}

#form .card-title h3 {
    font-size: 18px;
    font-weight: 700;
    color: #0B4F62;
}

#form .card-title p {
    color: #5f959d;
    font-size: 12.5px;
}

#form .number {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #006B70, #20C4C7) !important;
    border-radius: 14px !important;
    box-shadow: 0 6px 14px rgba(0, 140, 145, 0.30) !important;
}

/* ---------- Isian ---------- */
#form .form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #0B4F62 !important;
}

#form input,
#form textarea,
#form select {
    border: 1.5px solid #cfe6e8;
    border-radius: 12px;
    padding: 12px 15px;
    font-size: 13.5px;
    color: #0B4F62;
    background: #f9fdfd;
}

#form input::placeholder,
#form textarea::placeholder {
    color: #8fb1b6;
}

#form input:hover,
#form textarea:hover,
#form select:hover {
    border-color: #8fd3d6;
}

#form input:focus,
#form textarea:focus,
#form select:focus {
    background: #ffffff;
    border-color: #14B0B5 !important;
    box-shadow: 0 0 0 4px rgba(32, 196, 199, 0.18) !important;
}

/* ---------- Kartu pegawai / kegiatan ---------- */
#form .employee-card {
    background: linear-gradient(180deg, #f6fcfc, #eef8f9);
    border: 1px solid #cfe6e8;
    border-radius: 14px;
    padding: 20px;
}

#form .remove-employee {
    border-radius: 10px;
    font-weight: 600;
}

/* ---------- Tombol ---------- */
#form .add-button {
    border: 1.5px dashed #14B0B5 !important;
    background: rgba(234, 245, 246, 0.9) !important;
    color: #006B70 !important;
    border-radius: 12px;
    padding: 12px 20px;
    font-weight: 600;
    transition: background-color .2s ease, transform .2s ease, box-shadow .2s ease !important;
}

#form .add-button:hover {
    background: #cdeff1 !important;
    transform: translateY(-2px);
}

#form .form-actions .btn-cancel,
#form .form-actions .btn-save,
#form .form-actions .btn-submit {
    border: none !important;
    border-radius: 12px !important;
    padding: 12px 24px !important;
    font-weight: 700 !important;
}

#form .form-actions .btn-cancel {
    background: linear-gradient(135deg, #ff5a5a, #e63535) !important;
    box-shadow: 0 6px 14px rgba(230, 53, 53, 0.28) !important;
}

#form .form-actions .btn-save {
    background: linear-gradient(135deg, #14B0B5, #20C4C7) !important;
    box-shadow: 0 6px 14px rgba(32, 196, 199, 0.34) !important;
}

#form .form-actions .btn-submit {
    background: linear-gradient(135deg, #006B70, #008C91) !important;
    box-shadow: 0 6px 14px rgba(0, 107, 112, 0.34) !important;
}

#form .form-actions .btn-cancel:hover,
#form .form-actions .btn-save:hover,
#form .form-actions .btn-submit:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
}

/* Tombol Kembali */
#btnKembaliHalaman,
#barKembaliRekap button,
#barKembaliRekap a {
    background: linear-gradient(135deg, #006B70, #008C91 60%, #14B0B5) !important;
    border-radius: 999px !important;
    padding: 11px 24px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    font-family: 'Poppins', 'Segoe UI', sans-serif !important;
    box-shadow: 0 6px 16px rgba(0, 107, 112, 0.30) !important;
}

/* ---------- Hasil surat ---------- */
.result-section {
    background: transparent;
}

.result-header h2 {
    color: #0B4F62;
    font-weight: 700;
}

.result-header span {
    color: #006B70 !important;
}

.hasil-action-buttons button,
.print-button,
.pdf-button,
.word-button {
    border-radius: 12px !important;
    font-weight: 600 !important;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.14);
    transition: transform .2s ease, filter .2s ease !important;
}

.hasil-action-buttons button:hover {
    transform: translateY(-2px);
    filter: brightness(1.07);
}

.print-button { background: linear-gradient(135deg, #006B70, #008C91) !important; }

/* ---------- Responsif ---------- */
@media (max-width: 800px) {
    html::before { opacity: 0.35; width: 70vw; }
    #form .card { padding: 22px 18px; }
    .form-grid { grid-template-columns: 1fr !important; }
}

/* ---------- Cetak: buang semua hiasan ---------- */
@media print {
    html::before, html::after, body::before, body::after { display: none !important; }
    body { background: #fff !important; }
}

/* =========================================================
   PERKECIL UKURAN FORM + PERBAIKI TOMBOL AKSI
========================================================= */
main.container#form {
    max-width: 820px;
    padding: 40px 20px 60px;
}

.section-title { margin-bottom: 20px; }
.section-title span { font-size: 11px; padding: 4px 12px; }
.section-title h2 { font-size: 24px; margin: 8px 0 4px; }
.section-title p { font-size: 12.5px; }

#form .card {
    padding: 20px 22px;
    margin-bottom: 16px;
    border-radius: 16px;
}

#form .card-title { gap: 12px; margin-bottom: 16px; }
#form .card-title h3 { font-size: 15.5px; margin-bottom: 2px; }
#form .card-title p { font-size: 11.5px; }

#form .number {
    width: 36px;
    height: 36px;
    font-size: 13px !important;
    border-radius: 11px !important;
}

#form .form-grid,
#form .employee-grid { gap: 14px; }

#form .form-group { gap: 5px; }
#form .form-group label { font-size: 12px; }

#form input,
#form textarea,
#form select {
    padding: 9px 12px;
    font-size: 12.5px;
    border-radius: 10px;
}

#form textarea { min-height: 70px; }

#form .employee-card { padding: 14px 16px; margin-bottom: 12px; }
#form .employee-header { margin-bottom: 12px; }

#form .add-button {
    padding: 9px 16px;
    font-size: 12px;
    border-radius: 10px;
}

/* ---------- Tombol aksi: teks putih, jelas terbaca ---------- */
#form .form-actions {
    gap: 10px;
    margin-top: 18px;
}

#form .form-actions .btn-cancel,
#form .form-actions .btn-save,
#form .form-actions .btn-submit {
    color: #ffffff !important;
    border: none !important;
    border-style: solid !important;
    padding: 10px 22px !important;
    font-size: 13px !important;
    border-radius: 10px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

#form .form-actions .btn-cancel { background: linear-gradient(135deg, #ff5a5a, #e63535) !important; }
#form .form-actions .btn-save   { background: linear-gradient(135deg, #0e9aa0, #14B0B5) !important; }
#form .form-actions .btn-submit { background: linear-gradient(135deg, #005a5f, #008C91) !important; }

/* ---------- Lebarkan form ke kiri & kanan ---------- */
main.container#form {
    max-width: 1150px;   /* semula 1450px; 900px terlalu sempit, jadi dipilih 1150px */
    margin: 0 auto;
    padding: 28px 24px 60px;
}
/* Ukuran disamakan dengan RPK & Rekap: tampilan layar dikecilkan sedikit (hanya desktop) */
@media screen and (min-width: 801px) {
    main.container#form { zoom: .86; }
}
@media (max-width: 800px) {
    main.container#form { padding-left: 14px; padding-right: 14px; }
}

/* ---------- Tombol Kembali (bentuk bulat / pill) ---------- */
#form .form-actions #backToHome,
#form .form-actions .btn-back-home {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    border: none !important;
    cursor: pointer;
    padding: 11px 24px !important;
    border-radius: 999px !important;
    background: linear-gradient(135deg, #006B70, #008C91 60%, #14B0B5) !important;
    color: #ffffff !important;
    font-family: 'Poppins', 'Segoe UI', sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-shadow: none !important;
    box-shadow: 0 6px 16px rgba(0, 107, 112, 0.30) !important;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease !important;
}

#form .form-actions #backToHome:hover,
#form .form-actions .btn-back-home:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
    box-shadow: 0 8px 20px rgba(0, 107, 112, 0.38) !important;
}

#form .form-actions #backToHome:focus-visible {
    outline: 3px solid #A8F0F2;
    outline-offset: 2px;
}

/* Tombol Kembali (yang dipasang otomatis) ikut bulat */
#btnKembaliHalaman {
    border-radius: 999px !important;
    padding: 11px 24px !important;
}

/* =========================================================
   TOMBOL KEMBALI (otomatis) - jangan menimpa logo/navbar
   Dipindah ke bawah navbar, di sebelah kanan tombol ≡
========================================================= */
#btnKembaliHalaman {
    position: absolute !important;
    top: 100px !important;
    left: 76px !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 998 !important;
    height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    padding: 0 18px !important;
    font-size: 13px !important;
    white-space: nowrap;
}

@media (max-width: 640px) {
    #btnKembaliHalaman {
        left: 70px !important;
        height: 38px !important;
        padding: 0 14px !important;
        font-size: 12px !important;
    }
}

@media print {
    #btnKembaliHalaman { display: none !important; }
}

/* =========================================================
   PERBAIKAN (revisi)
========================================================= */

/* Tombol Kembali tetap di tempatnya (ikut bergulir bersama halaman, tidak melayang) */
.bar-kembali-halaman.melayang {
    position: absolute !important;
    top: 100px !important;
    left: 76px !important;
    margin: 0 !important;
}
.bar-kembali-halaman.melayang #btnKembaliHalaman {
    position: static !important;
}

/* Kartu 02 (Data Pegawai) dibuat sama persis dengan kartu 01:
   garis atas ikut melengkung mengikuti sudut kartu */
#form .card::before {
    inset: 0 !important;
    height: auto !important;
    border-radius: inherit;
    background: linear-gradient(90deg, #006B70 0%, #008C91 55%, #20C4C7 100%) top / 100% 5px no-repeat !important;
    pointer-events: none;
}
#form .card:has(#employeeContainer) { overflow: visible !important; }

/* Tabel Lampiran: kolom Pangkat/Gol. dan Jabatan cukup lebar, tidak tumpang tindih */
#suratOutput .tabel-pegawai { table-layout: fixed; width: 100%; }
#suratOutput .tabel-pegawai th,
#suratOutput .tabel-pegawai td { white-space: normal !important; word-break: normal !important; overflow-wrap: anywhere !important; }
#suratOutput .tabel-pegawai .no      { width: 6%;  white-space: nowrap !important; }
#suratOutput .tabel-pegawai .nama    { width: 27%; }
#suratOutput .tabel-pegawai .nip     { width: 21%; white-space: nowrap !important; overflow-wrap: normal !important; }
#suratOutput .tabel-pegawai .gol     { width: 22%; }
#suratOutput .tabel-pegawai .jabatan { width: 24%; overflow: visible; text-overflow: clip; }

/* Tombol Kembali tidak boleh menimpa header: saat halaman digulir ia lewat di bawah header */
#btnKembaliHalaman,
.bar-kembali-halaman.melayang {
    z-index: 1 !important;
}