/* ==========================================================================
   Desain Modern & Bersih - Seleksi Atlet Panahan Kota Kendari 2026
   2 Kartu Terpadu (Header + Form Isian) & Background Target Miring
   ========================================================================== */

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: rgba(79, 70, 229, 0.08);
  --primary-glow: rgba(79, 70, 229, 0.15);
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.1);
  --error: #ef4444;

  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --bg-input: #f8fafc;
  --bg-input-focus: #ffffff;

  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --border-card: #e2e8f0;
  --border-input: #cbd5e1;
  --border-focus: #6366f1;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-card: 0 4px 16px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-card-hover: 0 10px 24px -4px rgba(15, 23, 42, 0.08);

  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  padding: 32px 16px 56px;
  -webkit-font-smoothing: antialiased;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ==========================================================================
   Background Face Target Miring & Besar Menutupi Latar Belakang
   ========================================================================== */

.bg-target-layer {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg) scale(1.35);
  width: 1000px;
  height: 1000px;
  max-width: 140vw;
  max-height: 140vw;
  pointer-events: none;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.08; /* Tipis & samar */
  filter: blur(2.5px); /* Agak samar / blur */
}

.bg-target-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

/* Kontainer Formulir */
.form-container {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Kartu Modern
   ========================================================================== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: all 0.25s ease;
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
}

.card-body {
  padding: 28px 26px;
}

/* ==========================================================================
   1. Kartu Header (Gambar Terpadu dengan Judul)
   ========================================================================== */

.header-card {
  border-top: none;
}

.card-image-wrap {
  width: 100%;
  overflow: hidden;
  border-bottom: 1px solid var(--border-card);
  background-color: #000000;
}

.banner-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.header-card:hover .banner-image {
  transform: scale(1.015);
}

.header-body {
  padding: 24px 26px;
}

.form-title {
  font-size: 23px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.3px;
  line-height: 1.35;
  margin-bottom: 8px;
}

.form-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   2. Kartu Isian Formulir (Semua Input Bergabung Menjadi 1 Card)
   ========================================================================== */

.form-main-card .card-body {
  padding: 30px 28px;
}

.form-group {
  margin-bottom: 24px;
  transition: all 0.2s ease;
}

.form-group:last-of-type {
  margin-bottom: 28px;
}

/* Judul Kolom Pertanyaan */
.label-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 10px;
  letter-spacing: -0.1px;
}

.star {
  color: var(--error);
  font-weight: 700;
  margin-left: 2px;
}

/* Input Modern */
.input-text,
.input-date,
.input-select {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  background-color: var(--bg-input);
  border: 1.5px solid var(--border-input);
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.2s ease;
}

.input-text:focus,
.input-date:focus,
.input-select:focus {
  background-color: var(--bg-input-focus);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3.5px var(--primary-glow);
}

.input-text::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

/* Batas Lebar Input */
.form-group .input-text {
  max-width: 420px;
}

.form-group .input-date {
  max-width: 240px;
  cursor: pointer;
}

.select-wrapper {
  max-width: 320px;
  position: relative;
}

.input-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
}

/* Pilihan Radio Modern */
.radio-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.radio-item {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  position: relative;
  user-select: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s ease;
  width: fit-content;
}

.radio-item:hover {
  background-color: var(--primary-light);
}

.radio-item input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-circle {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-input);
  border-radius: 50%;
  margin-right: 12px;
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  background-color: #ffffff;
  transition: all 0.2s ease;
}

.radio-circle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.radio-item:hover .radio-circle {
  border-color: var(--primary);
}

.radio-item input[type="radio"]:checked ~ .radio-circle {
  border-color: var(--primary);
}

.radio-item input[type="radio"]:checked ~ .radio-circle::after {
  transform: translate(-50%, -50%) scale(1);
}

.radio-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
}

/* Opsi "Yang lain:" */
.other-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.other-radio-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.input-other {
  border: none;
  border-bottom: 1.5px solid var(--border-input);
  padding: 6px 4px;
  font-family: var(--font-family);
  font-size: 14px;
  color: var(--text-main);
  outline: none;
  width: 240px;
  background: transparent;
  transition: border-color 0.2s ease;
}

.input-other:focus {
  border-bottom-color: var(--primary);
}

/* Tampilan Error */
.error-text {
  display: none;
  color: var(--error);
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
}

.form-group.has-error .error-text {
  display: block;
}

.form-group.has-error .input-text,
.form-group.has-error .input-date,
.form-group.has-error .input-select {
  border-color: var(--error) !important;
  background-color: #fffaf9;
}

/* Alert Banner Error */
.error-banner {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  margin-top: 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Tombol Aksi */
.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-card);
  padding-top: 22px;
  margin-top: 10px;
}

.btn {
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 12px 28px;
  border: none;
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-submit {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.28);
}

.btn-submit:hover {
  background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.35);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-reset {
  background: transparent;
  color: var(--text-muted);
  padding: 10px 16px;
}

.btn-reset:hover {
  color: var(--text-main);
  background-color: var(--border-card);
}

/* ==========================================================================
   Tampilan Sukses dengan Cek List Hijau Animasi
   ========================================================================== */

.success-card {
  text-align: center;
  margin-top: 32px;
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.success-body {
  padding: 48px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Ikon Cek List Hijau Animasi */
.success-icon-wrap {
  width: 76px;
  height: 76px;
  margin-bottom: 22px;
}

.checkmark-svg {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: block;
  stroke-width: 3.5;
  stroke: var(--success);
  stroke-miterlimit: 10;
  box-shadow: inset 0px 0px 0px var(--success);
  animation: fillCircle 0.4s ease-in-out 0.4s forwards, scalePop 0.3s ease-in-out 0.8s both;
}

.checkmark-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 3.5;
  stroke-miterlimit: 10;
  stroke: var(--success);
  animation: strokeCircle 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: strokeCheck 0.35s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes strokeCircle {
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes strokeCheck {
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes fillCircle {
  100% {
    box-shadow: inset 0px 0px 0px 38px var(--success-light);
  }
}

@keyframes scalePop {
  0%, 100% {
    transform: none;
  }
  50% {
    transform: scale3d(1.1, 1.1, 1);
  }
}

.success-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}

.success-desc {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.btn-submit-again {
  background: var(--bg-input);
  color: var(--primary);
  border: 1.5px solid #c7d2fe;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
}

.btn-submit-again:hover {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Responsif Layar HP */
@media (max-width: 600px) {
  body {
    padding: 16px 12px 36px;
  }

  .header-body,
  .form-main-card .card-body {
    padding: 22px 18px;
  }

  .form-title {
    font-size: 20px;
  }

  .form-group .input-text,
  .form-group .input-date,
  .select-wrapper,
  .input-other {
    max-width: 100%;
    width: 100%;
  }

  .form-actions {
    flex-direction: column-reverse;
    gap: 12px;
  }

  .btn-submit,
  .btn-reset {
    width: 100%;
    text-align: center;
  }
}

/* ==========================================================================
   Kartu & Tabel Rekap Jumlah Pendaftar (Model Ramping & Kompak)
   ========================================================================== */

.form-hint-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 14px 4px 10px;
}

.form-hint-title svg {
  color: var(--primary);
  flex-shrink: 0;
}

.stats-card {
  position: relative;
  margin-bottom: 14px;
}

.stats-body {
  padding: 10px 14px;
}

.stats-top-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 6px;
}

.stats-counter-info {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.stats-counter-info strong {
  color: var(--primary);
  font-weight: 700;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-card);
  background: #ffffff;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.stats-table thead th {
  background: #f8fafc;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 5px 12px;
  border-bottom: 1px solid var(--border-card);
}

.stats-table thead th.th-divisi {
  text-align: left;
  width: 50%;
}

.stats-table thead th.th-gender {
  text-align: center;
  width: 25%;
}

.stats-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.15s ease;
}

.stats-table tbody tr:last-child {
  border-bottom: none;
}

.stats-table tbody tr:hover {
  background-color: #f8fafc;
}

.stats-table td {
  padding: 4px 12px;
  vertical-align: middle;
}

.td-divisi {
  display: flex;
  align-items: center;
  gap: 7px;
}

.badge-divisi {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 22px;
  padding: 0 5px;
  background: #eef2ff;
  color: #4338ca;
  font-weight: 700;
  font-size: 12px;
  border-radius: 4px;
  border: 1px solid #c7d2fe;
}

.divisi-desc {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.td-count {
  text-align: center;
}

.pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 21px;
  padding: 0 7px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
}

.pill-count.count-putri {
  background: #fdf2f8;
  color: #db2777;
  border: 1px solid #fbcfe8;
}

.pill-count.count-putra {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.pill-count.is-zero {
  opacity: 0.45;
  background: #f8fafc !important;
  color: #94a3b8 !important;
  border-color: #e2e8f0 !important;
}

@media (max-width: 600px) {
  .form-hint-title {
    font-size: 12px;
    margin: 10px 2px 6px;
  }
  .stats-card {
    margin-bottom: 10px;
  }
  .stats-body {
    padding: 8px 10px;
  }
  .stats-table thead th {
    padding: 4px 8px;
    font-size: 10px;
  }
  .stats-table td {
    padding: 3px 8px;
  }
  .badge-divisi {
    min-width: 30px;
    height: 19px;
    font-size: 11px;
    padding: 0 4px;
  }
  .divisi-desc {
    font-size: 11px;
  }
  .pill-count {
    min-width: 24px;
    height: 19px;
    font-size: 11px;
    padding: 0 5px;
  }
}

