/* ==========================================================================
   STYLE PEMILIHAN KETUA RT 01 RW 10 - GOOGLE FORMS AUTHENTIC DESIGN SYSTEM
   Pixel-Perfect Google Forms Aesthetics with Clean Agustusan & Admin Features
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,400;0,500;0,700;1,400&family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
  --font-main: 'Roboto', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  
  /* Google Forms Signature Theme Palette */
  --primary-color: #a8253b;
  --primary-hover: #8b182b;
  --primary-light: #fbebee;
  --primary-focus: #4285f4;

  /* Google Forms Neutrals */
  --bg-page: #f0ebf8; /* Authentic Google Form soft background tint */
  --bg-card: #ffffff;
  --bg-subtle: #f8f9fa;
  --text-main: #202124;
  --text-secondary: #5f6368;
  --text-muted: #70757a;
  --border-color: #dadce0;
  --border-active: #a8253b;
  --danger-color: #d93025;

  /* Google Material Elevation */
  --radius-google: 8px;
  --radius-sm: 4px;
  --shadow-google: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
  --shadow-card: 0 1px 3px 0 rgba(60,64,67,0.12), 0 1px 2px 0 rgba(60,64,67,0.24);
  --shadow-focus: 0 2px 6px 2px rgba(60,64,67,0.15);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding: 16px 12px 60px;
}

/* ==========================================================================
   CONTAINER & NAVIGATION
   ========================================================================== */

.app-wrapper {
  max-width: 1040px; /* Spacious width for Admin & Dashboard */
  margin: 0 auto;
}

/* Centered 770px container specifically for Voter Form to mimic Google Forms */
#tab-voting {
  max-width: 770px;
  margin: 0 auto;
}

/* Tab Panes */
.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block !important;
}

/* Top App Header & Navbar */
.app-navbar {
  background: var(--bg-card);
  border-radius: var(--radius-google);
  box-shadow: var(--shadow-card);
  padding: 10px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border-color);
}

.voter-navbar {
  justify-content: space-between;
}

.voter-badge-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f8f9fa;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.live-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1e8e3e;
  display: inline-block;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-icon {
  width: 34px;
  height: 34px;
  background: var(--primary-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
}

.brand-title h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-title span {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.nav-tabs-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  background: #f1f3f4;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.nav-tab-btn {
  background: transparent;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.nav-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.8);
}

.nav-tab-btn.active {
  background: #ffffff;
  color: var(--primary-color);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   BANNER HERO CARD (Google Forms Signature Top Card)
   ========================================================================== */

.hero-banner-card {
  background: var(--bg-card);
  border-radius: var(--radius-google);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-color);
  margin-bottom: 14px;
  border-top: 10px solid var(--primary-color);
  position: relative;
}

.banner-graphic-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
  color: white;
  padding: 22px 24px;
  position: relative;
}

.banner-text-left {
  position: relative;
  z-index: 2;
}

.pesta-rakyat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(225, 29, 72, 0.9);
  color: #fff;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.banner-text-left h1 {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.25;
  color: #ffffff;
  margin-bottom: 4px;
  letter-spacing: -0.2px;
}

.banner-text-left p.sub-info {
  font-size: 0.88rem;
  color: #cbd5e1;
  font-weight: 400;
}

.banner-slogan-pill {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  font-size: 0.75rem;
  color: #fde047;
  font-style: italic;
}

.banner-content-body {
  padding: 22px 24px;
}

.form-main-title {
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 12px;
  line-height: 1.3;
}

.info-bullet-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.info-item .icon {
  font-size: 1.1rem;
  line-height: 1.3;
}

/* ==========================================================================
   FORM QUESTIONS CARDS (Google Forms Look & Feel)
   ========================================================================== */

.form-question-card {
  background: var(--bg-card);
  border-radius: var(--radius-google);
  padding: 24px 24px 22px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-color);
  border-left: 6px solid transparent;
  transition: border-left-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
  position: relative;
}

.form-question-card:focus-within,
.form-question-card:hover {
  border-left-color: var(--primary-color);
  box-shadow: var(--shadow-google);
}

.question-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 4px;
  line-height: 1.4;
  letter-spacing: 0.1px;
}

.question-title .required-star {
  color: var(--danger-color);
  margin-left: 3px;
  font-weight: 700;
}

.question-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.4;
}

/* Google Forms Signature Clean Inputs */
.text-input-field {
  width: 100%;
  padding: 8px 0;
  font-size: 0.95rem;
  font-family: inherit;
  border: none;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  background: transparent;
  color: var(--text-main);
  transition: border-bottom-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.text-input-field:focus {
  border-bottom: 2px solid var(--primary-color);
}

.text-input-field::placeholder {
  color: #80868b;
  font-style: normal;
  font-size: 0.9rem;
}

.textarea-field {
  width: 100%;
  padding: 8px 0;
  font-size: 0.95rem;
  font-family: inherit;
  border: none;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  background: transparent;
  color: var(--text-main);
  transition: border-bottom-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  min-height: 48px;
  resize: vertical;
}

.textarea-field:focus {
  border-bottom: 2px solid var(--primary-color);
}

.textarea-field::placeholder {
  color: #80868b;
  font-size: 0.9rem;
}

/* House Number Prefix Group */
.house-input-group {
  display: flex;
  align-items: center;
  max-width: 280px;
  margin-top: 6px;
  border-bottom: 1px solid var(--border-color);
  transition: border-bottom-color 0.2s ease;
}

.house-input-group:focus-within {
  border-bottom: 2px solid var(--primary-color);
}

.house-prefix-badge {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary-color);
  padding-right: 6px;
  user-select: none;
  white-space: nowrap;
}

.house-number-input {
  border-bottom: none !important;
  font-size: 1rem !important;
  font-weight: 500 !important;
  color: var(--text-main) !important;
  padding: 6px 0 !important;
}

/* Radio Group (Ya/Tidak) Google Forms Style */
.radio-options-vertical {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.radio-simple-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
  color: var(--text-main);
  cursor: pointer;
  padding: 6px 0;
  user-select: none;
}

.radio-simple-label input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

/* Scale 1-5 Radio Buttons (Google Forms Horizontal Grid) */
.satisfaction-scale-group {
  margin-top: 12px;
  padding: 8px 0;
}

.scale-legend-bar {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.scale-radio-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  background: #f8f9fa;
  padding: 12px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.scale-radio-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px;
}

.scale-radio-item input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

.scale-radio-item span.scale-num {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

/* ==========================================================================
   CANDIDATE SELECTION GRID (Google Forms Tile Grid)
   ========================================================================== */

.candidates-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.candidate-radio-card {
  position: relative;
  display: block;
  cursor: pointer;
}

.candidate-radio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.candidate-card-inner {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-google);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.candidate-radio-card:hover .candidate-card-inner {
  border-color: #bdc1c6;
  background: #fcfcfd;
}

.candidate-radio-card input[type="radio"]:checked + .candidate-card-inner {
  border-color: var(--primary-color);
  background: var(--primary-light);
  box-shadow: 0 0 0 1px var(--primary-color);
}

.candidate-badge-no {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #f1f3f4;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

.candidate-radio-card input[type="radio"]:checked + .candidate-card-inner .candidate-badge-no {
  background: var(--primary-color);
  color: #fff;
}

.candidate-thumb-wrapper {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  overflow: hidden;
  margin: 8px 0 10px;
  background: #f1f3f4;
  border: 2px solid #e8eaed;
  display: flex;
  align-items: center;
  justify-content: center;
}

.candidate-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.candidate-info-block {
  margin-bottom: 8px;
}

.candidate-name-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.25;
}

.radio-custom-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #9aa0a6;
  position: relative;
  transition: all 0.2s ease;
}

.candidate-radio-card input[type="radio"]:checked + .candidate-card-inner .radio-custom-dot {
  border-color: var(--primary-color);
}

.candidate-radio-card input[type="radio"]:checked + .candidate-card-inner .radio-custom-dot::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-color);
}

/* ==========================================================================
   FORM ACTION BUTTONS (Google Forms Style)
   ========================================================================== */

.form-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding: 0 4px;
}

.btn-submit-primary {
  background-color: var(--primary-color);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 24px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(60,64,67,0.3);
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-submit-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 1px 3px rgba(60,64,67,0.4);
}

.btn-submit-primary:disabled {
  background-color: #dadce0 !important;
  color: #80868b !important;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-clear-secondary {
  background: transparent;
  color: var(--primary-color);
  border: none;
  font-size: 0.88rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.btn-clear-secondary:hover {
  background: rgba(168, 37, 59, 0.08);
}

/* Google Forms Footer Disclaimer */
.form-footer-disclaimer {
  text-align: center;
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 30px;
  line-height: 1.5;
}

/* ==========================================================================
   ADMIN & HASIL STYLING (Modern Card Design)
   ========================================================================== */

.admin-header-box {
  background: #ffffff;
  border-radius: var(--radius-google);
  padding: 18px 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.export-action-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-google);
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.export-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.status-badge.connected {
  background: #e6f4ea;
  color: #137333;
}

.btn-export {
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  transition: all 0.15s ease;
}

.btn-export.green {
  background: #188038;
  color: white;
}
.btn-export.green:hover { background: #137333; }

.btn-export.blue {
  background: #1a73e8;
  color: white;
}
.btn-export.blue:hover { background: #1557b0; }

.btn-export.red {
  background: #d93025;
  color: white;
}
.btn-export.red:hover { background: #b3261e; }

.btn-export.gray {
  background: #f1f3f4;
  color: #3c4043;
  border: 1px solid #dadce0;
}
.btn-export.gray:hover { background: #e8eaed; }

/* Admin Candidate Grid */
.admin-candidate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.admin-candidate-item {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-google);
  padding: 16px 14px;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.admin-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.admin-no-tag {
  font-size: 0.75rem;
  font-weight: 700;
  background: #f1f3f4;
  color: #3c4043;
  padding: 2px 8px;
  border-radius: 4px;
}

.btn-icon-edit {
  background: none;
  border: none;
  color: #1a73e8;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.admin-avatar-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 10px;
  border: 2px solid #e8eaed;
}

.admin-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-item-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 10px;
}

.btn-secondary-sm {
  background: #f8f9fa;
  border: 1px solid var(--border-color);
  color: #3c4043;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}
.btn-secondary-sm:hover { background: #f1f3f4; }

/* Quick Count & Top 3 Podium */
.results-header-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-summary-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-google);
  padding: 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.stat-icon-wrapper.red { background: #fbebee; color: #a8253b; }
.stat-icon-wrapper.blue { background: #e8f0fe; color: #1a73e8; }
.stat-icon-wrapper.green { background: #e6f4ea; color: #188038; }

.stat-content h4 {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
}

.stat-val {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
}

.top3-podium-section {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-google);
  padding: 24px 20px;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
  text-align: center;
}

.section-section-title h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.section-section-title p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.podium-stage-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.podium-col {
  flex: 1;
  min-width: 180px;
  max-width: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.podium-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-google);
  padding: 14px 10px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-card);
  margin-bottom: 8px;
}

.podium-card.gold-border {
  border-color: #f9ab00;
  box-shadow: 0 2px 8px rgba(249, 171, 0, 0.25);
  background: #fffdf5;
}

.podium-rank-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 8px;
}
.podium-rank-badge.gold { background: #fef7e0; color: #b06000; }
.podium-rank-badge.silver { background: #f1f3f4; color: #5f6368; }
.podium-rank-badge.bronze { background: #fce8e6; color: #c5221f; }

.podium-avatar-box {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 8px;
  border: 2px solid #dadce0;
  position: relative;
}

.podium-avatar-box.large {
  width: 85px;
  height: 85px;
  border-color: #f9ab00;
}

.podium-avatar-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.podium-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.podium-score {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.podium-percent-badge {
  font-weight: 700;
  color: #188038;
  margin-left: 4px;
}
.podium-percent-badge.gold {
  color: #b06000;
}

.podium-stand {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #ffffff;
  border-radius: 6px 6px 0 0;
}
.stand-1 { height: 65px; background: #f9ab00; font-size: 1.5rem; }
.stand-2 { height: 45px; background: #9aa0a6; font-size: 1.3rem; }
.stand-3 { height: 32px; background: #c58c65; font-size: 1.1rem; }

/* ==========================================================================
   WINNER CELEBRATION CARD (UCAPAN SELAMAT KETUA RT TERPILIH)
   ========================================================================== */

.winner-celebration-hero {
  background: linear-gradient(135deg, #7f1d1d 0%, #1e1b4b 50%, #0f172a 100%);
  border-radius: var(--radius-google);
  color: #ffffff;
  padding: 32px 20px;
  text-align: center;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(127, 29, 29, 0.35), 0 0 0 3px rgba(245, 158, 11, 0.4);
  position: relative;
  overflow: hidden;
  animation: winnerGlow 3s ease-in-out infinite alternate;
}

@keyframes winnerGlow {
  0% { box-shadow: 0 10px 30px rgba(127, 29, 29, 0.35), 0 0 0 3px rgba(245, 158, 11, 0.4); }
  100% { box-shadow: 0 14px 40px rgba(234, 88, 12, 0.5), 0 0 0 4px rgba(245, 158, 11, 0.8); }
}

.winner-celebration-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.95);
  color: #78350f;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 6px 18px;
  border-radius: 50px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.winner-hero-title {
  font-size: 1.65rem;
  font-weight: 900;
  color: #fef08a;
  margin-bottom: 4px;
  line-height: 1.25;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.winner-hero-subtitle {
  font-size: 0.95rem;
  color: #cbd5e1;
  font-weight: 500;
  margin-bottom: 20px;
}

.winner-main-card {
  background: rgba(255, 255, 255, 0.98);
  color: #0f172a;
  border-radius: 16px;
  padding: 24px 20px;
  max-width: 520px;
  margin: 0 auto 20px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.winner-avatar-ring {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 12px;
}

.winner-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #f59e0b;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.4);
}

.winner-crown-icon {
  position: absolute;
  top: -14px;
  right: -6px;
  font-size: 32px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
  animation: crownBounce 2s infinite ease-in-out;
}

@keyframes crownBounce {
  0%, 100% { transform: translateY(0) rotate(12deg); }
  50% { transform: translateY(-6px) rotate(12deg); }
}

.winner-tag-elected {
  display: inline-block;
  background: #16a34a;
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  border-radius: 50px;
  margin-bottom: 6px;
}

.winner-name-text {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 2px;
}

.winner-number-text {
  font-size: 0.9rem;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 12px;
}

.winner-stats-pill {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.stat-badge-votes {
  background: #fef2f2;
  color: #b91c1c;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  border: 1px solid #fecaca;
}

.stat-badge-percent {
  background: #ecfdf5;
  color: #047857;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  border: 1px solid #a7f3d0;
}

.winner-wish-quote {
  font-size: 0.86rem;
  font-style: italic;
  color: #475569;
  line-height: 1.5;
  background: #f8fafc;
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 3px solid #f59e0b;
}

.winner-actions-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-confetti-burst {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  border: none;
  border-radius: 50px;
  padding: 10px 22px;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-confetti-burst:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
}

.btn-goto-admin {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background 0.2s;
  font-family: inherit;
}

.btn-goto-admin:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Dual Charts */
.charts-dual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.chart-card-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-google);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.chart-card-header h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-chart-dl {
  background: #f1f3f4;
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #3c4043;
  cursor: pointer;
}

.chart-container-inner {
  position: relative;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Custom Table */
.table-card-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-google);
  padding: 16px;
  box-shadow: var(--shadow-card);
  overflow-x: auto;
  margin-bottom: 20px;
}

.custom-responsive-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.custom-responsive-table th {
  background: #f8f9fa;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.custom-responsive-table td {
  padding: 12px;
  border-bottom: 1px solid #f1f3f4;
  color: var(--text-main);
}

.table-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.table-candidate-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Progress bar in table */
.progress-container {
  background: #f1f3f4;
  border-radius: 20px;
  height: 14px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.progress-bar {
  background: #1a73e8;
  height: 100%;
  border-radius: 20px;
  transition: width 0.4s ease;
}

.progress-bar.top3-bar {
  background: #a8253b;
}

.progress-label {
  position: absolute;
  right: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #3c4043;
}

/* Rank Badges */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 700;
}
.rank-badge.rank-1 { background: #fef7e0; color: #b06000; }
.rank-badge.rank-2 { background: #f1f3f4; color: #5f6368; }
.rank-badge.rank-3 { background: #fce8e6; color: #c5221f; }
.rank-badge.rank-normal { background: #f8f9fa; color: #80868b; }

/* Text quotes & tags in table */
.text-quote {
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.feedback-quote {
  color: #0f172a;
}

.cand-choice-tag {
  background: #fbebee;
  color: #a8253b;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
}

.rating-stars-badge {
  font-size: 0.82rem;
  font-weight: 600;
  color: #b45309;
  white-space: nowrap;
}

/* Photo Upload Section in Modal */
.upload-photo-preview-section {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  background: #f8f9fa;
  padding: 12px;
  border-radius: var(--radius-google);
  border: 1px solid var(--border-color);
}

.preview-thumb-large {
  width: 75px;
  height: 75px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-color);
  background: #ffffff;
}

/* Modals & Dialogs */
.custom-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(32, 33, 36, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.custom-modal-backdrop.active {
  display: flex !important;
}

.modal-dialog-box {
  background: #ffffff;
  border-radius: var(--radius-google);
  width: 100%;
  max-width: 480px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: modalFade 0.2s ease-out;
}

@keyframes modalFade {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-dialog-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-dialog-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.modal-dialog-body {
  padding: 20px;
}

.modal-dialog-body .text-input-field {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  background: #ffffff;
}

.modal-dialog-body .text-input-field:focus {
  border: 1px solid var(--primary-color);
  box-shadow: 0 0 0 2px rgba(168, 37, 59, 0.15);
}

.modal-dialog-footer {
  padding: 14px 20px;
  background: #f8f9fa;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Success Modal Illustration */
.success-illustration-box {
  margin-bottom: 18px;
}

.success-icon-big {
  width: 56px;
  height: 56px;
  background: #e6f4ea;
  color: #137333;
  font-size: 28px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.success-info-card {
  background: #f8f9fa;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-google);
  padding: 14px;
  margin: 14px 0;
  text-align: left;
}

/* Toast Notifications */
.toast-stack-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast-item {
  background: #202124;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 4px;
  font-size: 0.88rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s ease;
}

.toast-item.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-item.toast-success { border-left: 4px solid #34a853; }
.toast-item.toast-error { border-left: 4px solid #ea4335; }
.toast-item.toast-warning { border-left: 4px solid #fbbc04; }

/* Responsive adjustments */
@media (max-width: 600px) {
  body { padding: 8px 6px 40px; }
  .form-question-card { padding: 18px 16px; }
  .banner-graphic-header { padding: 18px 16px; }
  .banner-text-left h1 { font-size: 1.3rem; }
  .candidates-selection-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .candidate-thumb-wrapper { width: 70px; height: 70px; }
  .export-action-toolbar { flex-direction: column; align-items: flex-start; }
  .export-btn-group { width: 100%; }
}

/* ==========================================================================
   BERITA ACARA PRINT STYLING (1 LEMBAR PAS A4 RESMI)
   ========================================================================== */

#printBeritaAcaraArea {
  display: none;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 1cm 1.5cm 1cm 1.5cm;
  }

  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: Arial, 'Segoe UI', Tahoma, sans-serif !important;
    font-size: 9.5pt !important;
    line-height: 1.35 !important;
    width: 100% !important;
  }

  /* Sembunyikan SEMUA elemen web saat cetak/PDF kecuali Berita Acara */
  .app-wrapper,
  .custom-modal-backdrop,
  .toast-stack-container,
  header,
  nav,
  main,
  section,
  footer,
  button,
  .nav-tabs-group,
  .admin-header-box {
    display: none !important;
  }

  #printBeritaAcaraArea {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
    page-break-after: avoid !important;
    page-break-inside: avoid !important;
  }

  .print-header {
    text-align: center;
    border-bottom: 2px solid #000000;
    padding-bottom: 6px;
    margin-bottom: 10px;
  }

  .print-header h2 {
    font-size: 13pt;
    font-weight: 800;
    margin-bottom: 3px;
    text-transform: uppercase;
    color: #000000;
    letter-spacing: 0.5px;
  }

  .print-header h4 {
    font-size: 10pt;
    font-weight: 700;
    margin-bottom: 2px;
    color: #000000;
  }

  .print-header p {
    font-size: 8.5pt;
    color: #333333;
    margin: 0;
  }

  .print-winner-box {
    border: 1.5px solid #000000;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #fafafa;
    page-break-inside: avoid;
  }

  .print-winner-box h4 {
    font-size: 9.5pt;
    font-weight: 700;
    margin-bottom: 4px;
    color: #000000;
  }

  .print-winner-box ol {
    margin-left: 18px;
    font-size: 9pt;
    line-height: 1.4;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 6px;
    margin-bottom: 8px;
    font-size: 8.5pt;
    page-break-inside: avoid;
  }

  .print-table th,
  .print-table td {
    border: 1px solid #000000;
    padding: 4px 6px;
    color: #000000;
  }

  .print-table th {
    background-color: #e5e7eb !important;
    font-weight: 700;
    text-align: center;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-sign-container {
    margin-top: 14px;
    page-break-inside: avoid;
  }

  .print-sign-grid {
    display: table !important;
    width: 100% !important;
    table-layout: fixed !important;
    margin-top: 8px !important;
  }

  .sign-col {
    display: table-cell !important;
    vertical-align: top !important;
    text-align: center !important;
    width: 33.33% !important;
    padding: 0 4px !important;
  }

  .sign-title {
    font-size: 8.5pt !important;
    font-weight: 600 !important;
    color: #000000 !important;
    min-height: 26px !important;
    line-height: 1.3 !important;
    margin-bottom: 4px !important;
  }

  .sign-space {
    height: 70px !important; /* Ruang sangat luas untuk tanda tangan & stempel basah */
  }

  .sign-name {
    font-size: 8.5pt !important;
    font-weight: 700 !important;
    color: #000000 !important;
    white-space: nowrap !important;
  }
}
