/*
 * Tampilan modern halaman siswa (index, vote, detail).
 * Hanya menimpa gaya, tidak mengubah struktur halaman.
 * Hapus <link> ke file ini untuk kembali ke tampilan lama.
 */

body {
   font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
   background: #011b3b linear-gradient(160deg, #011b3b 0%, #06295a 55%, #0b3a7a 100%) fixed;
   color: #f4f7fc;
   -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
   font-family: inherit;
   font-weight: 700;
   letter-spacing: -0.01em;
}

h2 {
   font-size: 1.9rem;
   line-height: 1.25;
}

a {
   color: #7db4ff;
}

hr {
   max-width: none;
   border-bottom: 1px solid rgba(255, 255, 255, 0.14);
   margin: 18px auto;
}

/* tombol */
.button {
   border-radius: 10px;
   font-weight: 600;
   padding: 12px 20px;
   background-color: #2f7cf6;
   transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.button:hover,
.button:focus {
   background-color: #1f68dc;
   box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

.button:active {
   transform: translateY(1px);
}

.button.large {
   padding: 14px 32px;
   font-size: 1.1rem;
}

.button.alert {
   background-color: #e5484d;
   color: #fff;
}

.button.alert:hover,
.button.alert:focus {
   background-color: #cc3a3f;
   color: #fff;
}

.button.success {
   background-color: #12a150;
   color: #fff;
}

.button.success:hover,
.button.success:focus {
   background-color: #0e8a44;
   color: #fff;
}

.button.secondary {
   background-color: #e8ecf3;
   color: #1d2a3f;
}

.button.secondary:hover,
.button.secondary:focus {
   background-color: #d8deea;
   color: #1d2a3f;
}

.button[disabled] {
   opacity: 0.6;
}

/* kartu */
.callout {
   border: 0;
   border-radius: 16px;
   padding: 20px;
   color: #16233a;
   box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.callout.alert {
   background-color: #ffe9ea;
   border-left: 5px solid #e5484d;
   border-radius: 12px;
   padding: 14px 18px;
   box-shadow: none;
}

.callout.warning {
   background-color: #fff6dc;
}

.callout img {
   border-radius: 12px;
}

/* halaman login */
.index-header {
   padding-top: 48px;
   font-size: 2rem;
}

.form {
   margin-top: 40px;
   padding: 28px 24px;
   background-color: rgba(255, 255, 255, 0.07);
   border: 1px solid rgba(255, 255, 255, 0.14);
   border-radius: 18px;
}

.info-login {
   display: block;
   font-size: 1.25rem;
   font-weight: 600;
   line-height: 1.4;
   margin-bottom: 6px;
}

label {
   margin-bottom: 8px;
   font-size: 1rem;
   font-weight: 600;
   color: #dbe6f7;
}

input[type="number"],
input[type="text"] {
   height: 50px;
   padding: 10px 14px;
   font-size: 1.15rem;
   border: 2px solid transparent;
   border-radius: 10px;
   box-shadow: none;
}

input[type="number"]:focus,
input[type="text"]:focus {
   border-color: #2f7cf6;
   box-shadow: 0 0 0 4px rgba(47, 124, 246, 0.3);
}

#content-slider {
   margin-top: 40px;
   border-radius: 18px;
}

footer {
   margin-top: 8%;
   padding-bottom: 20px;
   font-size: 0.85rem;
   opacity: 0.6;
}

/* hitung mundur */
.countdown {
   display: inline-block;
   padding: 3px 14px;
   font-weight: 700;
   font-variant-numeric: tabular-nums;
   letter-spacing: 0.04em;
   color: #fff;
   background-color: rgba(255, 255, 255, 0.14);
   border: 1px solid rgba(255, 255, 255, 0.2);
   border-radius: 999px;
   transition: background-color 0.3s ease;
}

.countdown.hampir-habis {
   background-color: #e5484d;
   border-color: #e5484d;
   animation: denyut 1s ease-in-out infinite;
}

/* hitung mundur besar berbentuk kotak (halaman tunggu) */
.countdown-kotak {
   display: flex;
   justify-content: center;
   gap: 12px;
   margin: 18px 0 8px 0;
   padding: 0;
   background: none;
   border: 0;
   border-radius: 0;
}

.countdown-kotak.hampir-habis {
   background: none;
   animation: none;
}

.cd-kotak {
   min-width: 92px;
   padding: 16px 10px 12px 10px;
   background-color: rgba(255, 255, 255, 0.09);
   border: 1px solid rgba(255, 255, 255, 0.18);
   border-radius: 16px;
   box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.cd-kotak b {
   display: block;
   font-size: 2.8rem;
   font-weight: 700;
   line-height: 1;
}

.cd-kotak small {
   display: block;
   margin-top: 8px;
   font-size: 0.72rem;
   font-weight: 600;
   letter-spacing: 0.12em;
   text-transform: uppercase;
   color: #a9c2e8;
}

.hampir-habis .cd-kotak {
   background-color: #e5484d;
   border-color: #e5484d;
   animation: denyut 1s ease-in-out infinite;
}

.hampir-habis .cd-kotak small {
   color: #ffe1e2;
}

@keyframes denyut {
   50% {
      opacity: 0.7;
   }
}

/* daftar & profil calon */
.nomor {
   display: inline-block;
   margin-bottom: 12px;
   padding: 4px 16px;
   font-size: 0.95rem;
   font-weight: 700;
   color: #1f68dc;
   background-color: #e6f0ff;
   border-radius: 999px;
}

.callout .img {
   object-fit: cover;
}

.callout .button {
   margin-top: 6px;
}

table {
   border-collapse: separate;
   border-spacing: 0;
   border-radius: 14px;
   overflow: hidden;
   color: #16233a;
}

table tbody {
   border: 0;
}

table td {
   padding: 12px 16px;
   vertical-align: top;
}

table td:first-child {
   width: 160px;
   font-weight: 600;
   color: #4a5a75;
}

/* dialog konfirmasi */
.konfirmasi {
   background-color: rgba(1, 14, 32, 0.8);
   -webkit-backdrop-filter: blur(4px);
   backdrop-filter: blur(4px);
}

.konfirmasi .callout {
   padding: 24px;
}

.konfirmasi hr {
   border-bottom-color: #e3e8f0;
}

@media screen and (max-width: 39.9375em) {
   h2 {
      font-size: 1.45rem;
   }

   .index-header {
      padding-top: 28px;
      font-size: 1.5rem;
   }

   .form {
      margin-top: 24px;
      padding: 22px 18px;
   }

   .countdown-kotak {
      gap: 8px;
   }

   .cd-kotak {
      min-width: 0;
      flex: 1;
      max-width: 84px;
      padding: 12px 4px 10px 4px;
      border-radius: 12px;
   }

   .cd-kotak b {
      font-size: 1.9rem;
   }

   .cd-kotak small {
      font-size: 0.62rem;
      letter-spacing: 0.06em;
   }

   table td:first-child {
      width: 110px;
   }
}

/* ---------- penyempurnaan tampilan ---------- */

/* halaman muncul halus */
body {
   animation: muncul 0.35s ease-out;
}

@keyframes muncul {
   from {
      opacity: 0;
   }
}

a:focus-visible,
button:focus-visible,
.button:focus-visible,
input:focus-visible {
   outline: 3px solid #ffd24d;
   outline-offset: 2px;
}

/* bilah identitas pemilih (vote.php) */
.topbar {
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 12px;
   max-width: 62.5rem;
   margin: 14px auto 0 auto;
   padding: 10px 14px;
   background-color: rgba(255, 255, 255, 0.08);
   border: 1px solid rgba(255, 255, 255, 0.14);
   border-radius: 14px;
}

.topbar-pemilih {
   display: flex;
   align-items: center;
   gap: 12px;
   min-width: 0;
   text-align: left;
   line-height: 1.25;
}

.topbar-pemilih strong,
.topbar-pemilih small {
   display: block;
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
}

.topbar-pemilih small {
   font-size: 0.8rem;
   color: #a9c2e8;
}

.topbar-avatar {
   flex: none;
   width: 40px;
   height: 40px;
   line-height: 40px;
   text-align: center;
   font-weight: 700;
   color: #06295a;
   background-color: #ffd24d;
   border-radius: 50%;
}

.topbar-keluar {
   flex: none;
   padding: 8px 14px;
   font-size: 0.85rem;
   font-weight: 600;
   color: #fff;
   border: 1px solid rgba(255, 255, 255, 0.3);
   border-radius: 999px;
   transition: background-color 0.15s ease;
}

.topbar-keluar:hover,
.topbar-keluar:focus {
   color: #fff;
   background-color: rgba(255, 255, 255, 0.14);
}

/* kartu calon : foto seragam, tombol penuh, terangkat saat disorot */
section .callout {
   padding: 16px;
   transition: transform 0.18s ease, box-shadow 0.18s ease;
}

section .callout:hover {
   transform: translateY(-4px);
   box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.callout .img {
   width: 100%;
   max-width: none;
   height: 260px;
   min-height: 0;
   max-height: none;
   object-fit: cover;
   background-color: #eef2f9;
}

section .callout > p {
   margin: 12px 0 10px 0;
   font-weight: 700;
   line-height: 1.3;
}

section .callout .button {
   display: block;
   width: 100%;
   margin: 8px 0 0 0;
}

.button.tombol-sekunder {
   background-color: #eef2f9;
   color: #1f4fa3;
}

.button.tombol-sekunder:hover,
.button.tombol-sekunder:focus {
   background-color: #dfe7f5;
   color: #1f4fa3;
   box-shadow: none;
}

/* tanda centang halaman terima kasih */
.centang {
   width: 88px;
   height: 88px;
   margin: 10px auto 22px auto;
   line-height: 88px;
   font-size: 2.8rem;
   font-weight: 700;
   color: #fff;
   background-color: #12a150;
   border-radius: 50%;
   box-shadow: 0 0 0 10px rgba(18, 161, 80, 0.22);
   animation: letup 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes letup {
   from {
      transform: scale(0.4);
      opacity: 0;
   }
}

@media (prefers-reduced-motion: reduce) {
   body,
   .centang,
   .countdown.hampir-habis,
   .hampir-habis .cd-kotak {
      animation: none;
   }

   section .callout:hover {
      transform: none;
   }
}

@media screen and (max-width: 39.9375em) {
   .topbar {
      margin-top: 10px;
   }

   .topbar-keluar {
      padding: 7px 12px;
      font-size: 0.78rem;
   }

   .callout .img {
      height: 220px;
   }
}

/* ---------- penanda langkah pemilih ---------- */
.langkah {
   display: flex;
   justify-content: center;
   gap: 8px;
   max-width: 520px;
   margin: 18px auto 6px auto;
   padding: 0;
   list-style: none;
}

.langkah li {
   display: flex;
   align-items: center;
   gap: 8px;
   flex: 1;
   justify-content: center;
   padding: 8px 10px;
   font-size: 0.85rem;
   font-weight: 600;
   color: #9fb6da;
   background-color: rgba(255, 255, 255, 0.06);
   border: 1px solid rgba(255, 255, 255, 0.1);
   border-radius: 999px;
   white-space: nowrap;
}

.langkah li span {
   flex: none;
   width: 24px;
   height: 24px;
   line-height: 24px;
   text-align: center;
   font-size: 0.8rem;
   color: #06295a;
   background-color: #9fb6da;
   border-radius: 50%;
}

.langkah li.aktif {
   color: #fff;
   background-color: rgba(47, 124, 246, 0.35);
   border-color: #2f7cf6;
}

.langkah li.aktif span {
   background-color: #ffd24d;
}

.langkah li.sudah {
   color: #c9f2da;
}

.langkah li.sudah span {
   color: #fff;
   background-color: #12a150;
}

.bantuan {
   margin: 14px 0 0 0;
   font-size: 0.9rem;
   color: #a9c2e8;
}

.callout.warning {
   border-left: 5px solid #f5a524;
   border-radius: 12px;
   box-shadow: none;
}

@media screen and (max-width: 39.9375em) {
   .langkah {
      gap: 4px;
   }

   .langkah li {
      padding: 6px 4px;
      font-size: 0.72rem;
      gap: 5px;
   }

   .langkah li span {
      width: 20px;
      height: 20px;
      line-height: 20px;
      font-size: 0.7rem;
   }
}
