/* Reset Dasar */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins", sans-serif;
  background: #f4f7f9; /* Background lembut, tidak putih solid */
  color: #333;
  line-height: 1.6;
}

/* Variabel Warna untuk Konsistensi */
:root {
  --primary-color: #0066a2; /* Biru Utama (TETAP) */
  --hover-color: #004f7a; /* Biru Gelap untuk Hover (TETAP) */
  --border-color: #0066a2; /* (TETAP) */
  --text-color: #333;
  --light-bg: #ffffff;
  --section-bg: #e9eff4; /* Background section internal lebih terang */
  --success-color: #00a266; /* Hijau modern untuk tombol submit */
  --success-hover: #007a4f;
  --shadow-soft: 0 6px 15px rgba(0, 0, 0, 0.08); /* Bayangan modern */
}

a {
  text-decoration: none;
}

/* === NAVBAR (TETAP SESUAI PERMINTAAN) === */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  padding: 15px 60px;
  border-bottom: 3px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-img {
  width: 40px;
  height: auto;
}

.logo-text {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 1.1rem;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 25px;
  flex-grow: 1;
  justify-content: center;
  transition: all 0.3s ease;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-color);
  transition: color 0.3s;
  font-weight: 500;
}

.nav-links a:hover,
.nav-links .active {
  color: var(--primary-color);
  font-weight: 600;
}

.login-btn {
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  padding: 8px 15px;
  border-radius: 20px;
  text-decoration: none;
  transition: 0.3s;
  flex-shrink: 0;
}

.login-btn:hover {
  background: var(--primary-color);
  color: #fff;
}
/* --- End Navbar --- */

/* === FOOTER (DITINGKATKAN) === */
footer {
  text-align: center;
  padding: 25px;
  background: var(--primary-color);
  color: #fff;
  font-size: 0.95rem;
  position: relative;
  margin-top: 50px;
}

.footer-logo {
  width: 50px;
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.8;
}

/* =================================================== */
/* === STYLE SPESIFIK UNTUK FORM-VOTING.HTML (SANGAT BAGUS) === */
/* =================================================== */

.voting-form-container {
  max-width: 1200px; /* Lebih lebar */
  margin: 60px auto;
  padding: 50px;
  background-color: var(--light-bg);
  border-radius: 15px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15); /* Bayangan dalam dan elegan */
}

.voting-form-container h2 {
  color: var(--text-color);
  font-weight: 700;
  margin-bottom: 5px;
  text-align: center;
  font-size: 2.2rem;
}

.voting-form-container > p {
  font-size: 1.1rem;
  color: #d9534f; /* Warna peringatan lebih menonjol */
  font-weight: 600;
  margin-bottom: 40px;
}

/* === Group Input Data Pribadi (Nama & NRP) === */
.personal-info-group {
  margin-bottom: 40px;
  padding: 30px;
  border-radius: 12px;
  background-color: var(--section-bg);
  border: 1px solid #dcdfe3;
}

.personal-info-group h3 {
  color: var(--primary-color);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 25px;
  text-align: center;
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-color);
  font-size: 1.05rem;
}

.input-group input[type="text"] {
  width: 100%;
  padding: 14px 20px;
  border: 2px solid #ced4da;
  border-radius: 8px;
  font-size: 1em;
  background-color: #fff;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-group input[type="text"]:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 102, 162, 0.3); /* Efek fokus biru */
  outline: none;
}

/* === Group Pilihan Kandidat === */
.choice-group {
  margin-bottom: 50px;
  padding: 30px;
  border-radius: 12px;
  background-color: var(--section-bg);
  border: 1px solid #dcdfe3;
}

.choice-group h3 {
  color: var(--primary-color);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 30px;
  text-align: center;
}

.candidate-options-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
}

/* Style Kartu Voting Kandidat */
.candidate-card-option {
  flex: 0 0 calc(33.33% - 30px);
  max-width: 350px;
  position: relative;
}

.wakil-options-wrapper .candidate-card-option {
  flex: 0 0 calc(25% - 30px); /* 4 kartu per baris */
  max-width: 280px;
}

.candidate-card-label {
  display: block;
  border: 3px solid transparent; /* Border transparan default */
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* Transisi lebih kompleks/smooth */
  cursor: pointer;
  text-align: center;
  background-color: var(--light-bg);
  height: 100%;
  box-shadow: var(--shadow-soft); /* Bayangan halus */
}

/* Efek Hover */
.candidate-card-label:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(-5px); /* Efek angkat halus */
}

.candidate-card-option img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid #eee;
}

.candidate-card-option .candidate-info {
  padding: 15px;
}

.candidate-card-option .candidate-info h4 {
  margin-bottom: 5px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-color);
}
.candidate-card-option .candidate-info .urut {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.1em;
}

/* Sembunyikan radio button bawaan */
.candidate-card-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* Efek saat radio button TERPILIH (Sangat Bagus) */
.candidate-card-option input[type="radio"]:checked + .candidate-card-label {
  border-color: var(--success-color); /* Border warna sukses/aktif */
  background-color: #f0fff4; /* Background sangat terang */
  box-shadow: 0 0 0 6px rgba(0, 162, 102, 0.5); /* Efek border luar tegas */
  transform: scale(1.02); /* Sedikit membesar */
}

/* Tombol Kirim */
.submit-btn {
  display: block;
  width: 100%;
  padding: 20px; /* Lebih besar dari sebelumnya */
  background-color: var(--success-color);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.35em;
  font-weight: 700;
  cursor: pointer;
  margin-top: 50px;
  transition: background-color 0.3s ease, transform 0.2s ease,
    box-shadow 0.3s ease;
  box-shadow: 0 6px 15px rgba(0, 162, 102, 0.4);
}

.submit-btn:hover {
  background-color: var(--success-hover);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 162, 102, 0.6);
}

/* =================================================== */
/* === MEDIA QUERIES (Responsif) === */
/* =================================================== */

@media (max-width: 1200px) {
  .voting-form-container {
    max-width: 90%;
  }
}

@media (max-width: 992px) {
  /* Ketua: 2 kartu per baris */
  .candidate-card-option {
    flex: 0 0 calc(50% - 20px);
    max-width: 450px;
  }

  /* Wakil: 3 kartu per baris */
  .wakil-options-wrapper .candidate-card-option {
    flex: 0 0 calc(33.33% - 20px);
    max-width: 300px;
  }
}

/* Untuk perangkat mobile (maksimal 768px) */
@media (max-width: 768px) {
  .navbar {
    padding: 15px 20px;
    flex-wrap: wrap;
    /* Perluas ini agar logo container mengambil 100% dan tombol login hilang*/
  }

  /* === KODE UNTUK MEMPOSISIKAN LOGO DI TENGAH MOBILE === */
  .logo-container {
    width: 100%; /* Ambil seluruh lebar */
    justify-content: center; /* Posisikan isinya di tengah */
    gap: 15px;
    margin-bottom: 10px;
  }

  .login-btn {
    display: none; /* Menyembunyikan tombol Login Admin di mobile */
  }
  /* ================================================== */

  .nav-links {
    display: none; /* Menyembunyikan link di mobile untuk kesederhanaan */
  }

  .voting-form-container {
    padding: 30px 15px;
    margin: 30px auto;
  }

  /* Semua form/pilihan menjadi 1 kolom */
  .candidate-options-wrapper,
  .wakil-options-wrapper {
    flex-direction: column;
    gap: 20px;
  }

  .candidate-card-option,
  .wakil-options-wrapper .candidate-card-option {
    flex: 1 1 100%;
    max-width: none;
  }

  .candidate-card-option img {
    height: 180px;
  }

  .personal-info-group,
  .choice-group {
    padding: 20px;
  }
}

/* Untuk ponsel kecil (maksimal 500px) */
@media (max-width: 500px) {
  .logo-text {
    font-size: 1rem;
  }
}
