/* General Reset */
body,
html {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    background-color: #F1F1F1;
    overflow-x: hidden;
}

*, *::before, *::after {
    box-sizing: inherit;
}

/* Header */
.header {
    text-align: center;
    margin-top: 32px;
    margin-bottom: 24px;
}

/* Header Accent with Vertical Lines */
.header-accent {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    height: auto; /* Tinggi otomatis */
    z-index: 0; /* Pastikan garis berada di lapisan paling bawah */
}

/* Vertical lines */
.header-accent::before,
.header-accent::after,
.header-accent span {
    content: "";
    position: absolute;
    width: 1px; /* Lebar garis */
    height: 100vh; /* Tinggi penuh viewport */
    background-color: #DFDFDF; /* Warna garis */
    z-index: -1; /* Pastikan berada di bawah semua elemen */
}

.header-accent::before {
    left: 15%; /* Garis kiri */
}

.header-accent::after {
    left: 85%; /* Garis kanan */
}

.header-accent span {
    position: absolute;
    left: 50%; /* Garis tengah */
    transform: translateX(-50%);
}

.logo {
    width: 70px;
    height: auto;
    z-index: 1;
}

h1 {
    margin-top: 0px;
    font-size: 18px;
    color: #000;
    letter-spacing: 0.5px;
    font-weight: 400;
}

/* Form Wrapper */
.container {
    position: relative;
    max-width: 600px;
    margin: 24px auto;
    padding: 24px;
    background-color: white;
    border-radius: 20px;
    border: 1px solid #f5f5f5;
    z-index: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.form-wrapper {
    width: 100%;
}

.subtitle {
    color: #666;
    margin-top: -4px;
    font-size: 14px;
    line-height: 1.55;
    letter-spacing: 0.3px;
    margin-bottom: 24px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #666D80;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.required {
    color: red;
}

input {
    width: 100%;
    max-width: 100%;
    padding: 10.5px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 14px;
    letter-spacing: 0.5px;
    font-family: 'Inter', sans-serif;
    box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
}

input:focus {
    outline: none;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.12);
    /* Focus shadow */
    border-color: #666D80;
}

input::placeholder {
    color: #A4ABB8; /* Warna placeholder */
}

input:focus::placeholder {
    color: #A4ABB8; /* Warna placeholder saat input di-fokuskan */
}

select {
    width: 100%;
    max-width: 100%; 
    appearance: none; /* Hilangkan gaya bawaan browser */
    padding: 10.5px 12px; /* Padding kiri dan kanan untuk ruang yang cukup */
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 14px;
    letter-spacing: 0.5px;
    font-family: 'Inter', sans-serif;
    box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
    background-color: white;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"gray\"><path d=\"M10 15l-5.5-5.5h11L10 15z\"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center; /* Chevron posisinya */
    background-size: 16px;
}

select:invalid {
    color: #A4ABB8; /* Warna teks placeholder */
}

select:focus {
    outline: none;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.12);
    border-color: #666D80;
}

/* Styling for the house group */
.house-group {
    display: flex;
    flex-direction: column;
}

.house-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr; /* Blok, No., Nomor Rumah */
    gap: 12px;
}

.house-inputs select,
.house-inputs input {
    padding: 10.5px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
}

.house-inputs select:focus,
.house-inputs input:focus {
    outline: none;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.12);
    border-color: #666D80;
}

/* Upload Group Styling */
.upload-group {
    margin-bottom: 16px;
}

.upload-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border: 2px dashed #DFE1E6;
    border-radius: 12px;
    background-color: #FAFAFA;
    text-align: center;
    position: relative;
}

.upload-wrapper:hover {
    border-color: #bbb;
}

.upload-icon {
    width: 32px;
    height: auto;
    margin-bottom: 8px;
}

.upload-title {
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.4px;
    color: #333;
    margin: 0;
}

.upload-description {
    font-size: 12px;
    color: #666;
    letter-spacing: 0.3px;
    margin: 8px 0 0;
}

.upload-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/*success*/

.uploaded-filename,
.uploaded-filesize,
.replace-file-button {
    font-family: 'Inter', sans-serif;
}

.upload-success {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
    border: 1px solid #ebebeb;
    border-radius: 12px;
    padding: 16px;
    gap: 16px;
    box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease-in-out;
}

.upload-success.hidden {
    display: none;
}

/* Success icon */
.success-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: #ffffff;
    border-radius: 50%;
}

.success-icon {
    width: 28px;
    height: 28px;
}

/* File details */
.file-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-right: 10px;
    overflow: hidden;
}

.uploaded-filename {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Menambahkan "..." di akhir teks yang terpotong */
}

.uploaded-filesize {
    font-size: 12.5px;
    color: #777;
    margin: 0;
}

/* Replace file button */
.replace-file-button {
    background-color: transparent;
    border: 1px solid #ddd;
    color: #6BA37D;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.3s;
}

.replace-file-button:hover {
    background-color: #f0f0f0;
}

/*------------------------*/

input[type="file"] {
    padding: 10px;
    border: 2px dashed #ccc;
    background-color: #FAFAFA;
    text-align: center;
    color: #999;
}

input[type="file"]:hover {
    border-color: #bbb;
}

/* Buttons */
.submit-button,
.confirm-button {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    letter-spacing: 0.5px;
    cursor: pointer;
}

.submit-button {
    background-color: #6BA37D;
    color: white;
}

.confirm-button {
    background-color: #ffffff;
    color: #333;
    border: 1px solid #ddd;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 12px;
}

.hidden {
    display: none !important;
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    .container {
        margin: 10px 10px 0px 10px;
        /* Ensure spacing on smaller devices */
        padding: 18px;
    }

    input,
    select,
    button {
        font-size: 14px;
    }
}

/*snackbar*/

/* Snackbar Styling */
.snackbar {
    width: calc(100% - 24px);
    max-width: 600px;
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease-in-out;
    z-index: 9999;
}

.snackbar.hidden {
    opacity: 0;
    pointer-events: none;
}

.snackbar-content {
    display: flex;
    justify-content: space-between; /* Pastikan ikon tetap di kanan */
    align-items: center;
    width: 100%;
}

.snackbar-icon {
    width: 20px;
    height: 20px;
    margin-left: 16px;
}

.snackbar-message {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    margin: 0;
    flex: 1;
}

/* Security Message Styling */
.security-message {
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    background-color: #F9F9F9;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.05);
}

.security-icon {
    width: 24px;
    height: 24px;
    margin-right: 12px;
}

.message-content p {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: 12.5px;
    letter-spacing: 0.5px;
    line-height: 1.5;
    color: #666D80;
}

.message-content p strong {
    color: #333;
    letter-spacing: 0.5px;
}



/* Team List Styling */
.team-list {
    margin-top: 8px;
    padding: 0;
}

.team-member {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 500;
    color: rgb(42, 42, 42);
    margin-right: 16px;
    text-transform: uppercase;
}

.member-info {
    display: flex;
    flex-direction: column;
}

.member-name {
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    color: #000;
}

.member-role {
    font-size: 12px;
    font-weight: 400;
    color: #666;
    margin: 4px 0 0;
}

/* =======================================================
   === bagian tambahan untuk SVG grid & animasi scan ===
   ======================================================= */

/* --- 1) Kontainer scanner (posisi relatif) --- */
.scanner-container {
    position: relative;
    width: 320px;
    max-width: 90%;
    margin: 1.5rem auto;
    border: 4px solid #5e7bf8;            /* Aksen biru sama seperti kerangka kamera */
    border-radius: 12px;
    background-color: black;              /* Agar kontras dengan SVG grid */
    overflow: hidden;                     /* Memastikan elemen overlay tidak keluar area */
    box-shadow: 0 8px 24px -6px rgba(0,0,0,0.25);
  }
  
  /* --- 2) Area live‐camera dari html5‐qrcode --- */
  .qr-reader {
    width: 100%;
    height: auto;                         /* Tinggi otomatis supaya tidak merusak aspect ratio */
    position: relative;
    z-index: 2;                           /* Di atas grid-bg, tapi di bawah scan‐line */
  }
  
  /* --- 3) SVG Grid di bawah Kamera --- */
  .grid-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    z-index: 3;                           /* Di bawah kamera, tapi di atas background‐container */
    pointer-events: none;                 /* Jangan ganggu input / klik di atasnya */
    opacity: 0.25;                        /* Transparan sedikit agar tidak mengganggu */
  }
  
  /* --- 4) Garis scanner hijau (posisi absolute) --- */
  .scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;                          /* Ketebalan garis */
    background: linear-gradient(
      to bottom,
      rgb(0, 255, 0),
      rgba(0, 255, 0, 0.2)
    );
    opacity: 0;                           /* Awalnya tersembunyi */
    z-index: 5;                           /* Paling atas */
  }
  
  /* --- 5) Kelas saat sedang scanning (menyalakan animasi) --- */
  .scanner-container.scanning .scan-line {
    opacity: 1;                           /* Tampilkan garis */
    animation: scanMove 1.5s linear infinite; /* Jalankan animasi ke bawah & ulang */
  }
  
  /* --- 6) @keyframes untuk scan‐line (naik → turun) --- */
  @keyframes scanMove {
    0%   { top: 0%; }
    50%  { top: 100%; }
    100% { top: 0%; }
  }
  
  /* =======================================================
     === akhir bagian tambahan untuk SVG grid & animasi ===
     ======================================================= */
  
  
  /* --- 7) (sudah ada di file CSS Anda) --- */
  /* Gaya default untuk .scan-status dan .snackbar seperti di instruksi sebelumnya. */
  .scan-status {
    text-align: center;
    font-size: 1rem;
    margin-top: .8rem;
    font-weight: 500;
    color: #6b7280;       /* abu-abu default */
  }
  .scan-status.success { color: #16a34a; }
  .scan-status.error   { color: #dc2626; }
  
  .snackbar {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    min-width: 280px;
    background: #1f2937;
    color: #fff;
    padding: .75rem 1.25rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: .5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
  }
  .snackbar.show {
    opacity: 1;
    pointer-events: auto;
  }
  .snackbar.success   { background-color: #16a34a; }
  .snackbar.error     { background-color: #dc2626; }
  