/* === PTI Frontend CSS v2.0 === */
:root { --pti-color: #c0392b; }
.pti-wrap-front { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; max-width: 960px; margin: 0 auto; }

/* Header */
.pti-flag-bar { height: 6px; background: linear-gradient(90deg,#c0392b 33%,#fff 33% 66%,#c0392b 66%); border-radius: 4px 4px 0 0; }
.pti-front-header { background: linear-gradient(135deg,#1a1a2e,#c0392b); border-radius: 12px; padding: 28px 32px; margin-bottom: 20px; text-align: center; }
.pti-front-title { color: #fff; font-size: 22px; font-weight: 700; margin: 12px 0 8px; }
.pti-front-sub { color: rgba(255,255,255,.8); margin: 0; font-size: 14px; }

/* Stats */
.pti-front-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 16px; }
.pti-front-stat { background: #f8f8f8; border-radius: 10px; padding: 14px; text-align: center; border: 1px solid #eee; }
.pti-front-stat-val { font-size: 24px; font-weight: 700; color: #1a1a2e; transition: all .3s; }
.pti-front-stat-lbl { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: .5px; margin-top: 3px; }

/* Notice */
.pti-vote-notice { padding: 10px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 20px; text-align: center; transition: all .3s; border: 1px solid #bee5eb; background: #e8f4fd; color: #0c5460; }
.pti-vote-notice.pti-voted { background: #d4edda; color: #155724; border-color: #c3e6cb; }

/* JotForm */
.pti-jotform-wrap { background: #f9f9f9; border: 1px solid #e8e8e8; border-radius: 12px; padding: 20px; margin-bottom: 24px; }

/* Section title */
.pti-section-title { font-size: 17px; font-weight: 700; color: #1a1a2e; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid #f0f0f0; }

/* === KARTU TOKOH === */
.pti-tokoh-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 14px; margin-bottom: 28px; }

.pti-tokoh-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 14px 10px;
  cursor: pointer;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform .18s, box-shadow .18s, border-color .2s;
  user-select: none;
}
.pti-tokoh-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.pti-tokoh-card.pti-voted { box-shadow: 0 4px 16px rgba(192,57,43,.2); }
.pti-tokoh-card.pti-pulse { animation: ptiPulse .32s ease; }
@keyframes ptiPulse { 0%{transform:scale(1)} 50%{transform:scale(.95)} 100%{transform:scale(1)} }

.pti-voted-badge { position: absolute; top: 6px; right: 6px; background: #27ae60; color: #fff; font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 20px; }

.pti-tokoh-foto { width: 100%; height: 100px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; display: block; }
.pti-tokoh-ava { width: 58px; height: 58px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; color: #fff; margin: 0 auto 10px; }
.pti-tokoh-nama { font-size: 11px; font-weight: 700; color: #1a1a2e; margin-bottom: 3px; line-height: 1.3; }
.pti-tokoh-jabatan { font-size: 9px; color: #999; margin-bottom: 8px; line-height: 1.4; }
.pti-tokoh-pct { font-size: 20px; font-weight: 800; transition: all .35s cubic-bezier(.4,0,.2,1); min-height: 26px; margin-bottom: 5px; }
.pti-tokoh-bar-wrap { background: #f0f0f0; border-radius: 20px; height: 5px; overflow: hidden; margin-bottom: 4px; }
.pti-tokoh-bar { height: 100%; border-radius: 20px; width: 0%; transition: width .55s cubic-bezier(.4,0,.2,1); }
.pti-tokoh-suara { font-size: 10px; color: #aaa; transition: all .3s; }

/* Flash +1 */
.pti-flash { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 22px; font-weight: 800; opacity: 0; pointer-events: none; }
.pti-flash.show { animation: ptiFloat .7s ease forwards; }
@keyframes ptiFloat { 0%{opacity:1;transform:translate(-50%,-50%)} 100%{opacity:0;transform:translate(-50%,-120%)} }

/* Charts */
.pti-chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.pti-chart-box { background: #fff; border: 1px solid #e8e8e8; border-radius: 12px; padding: 16px; }
.pti-chart-label { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.pti-legend { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.pti-leg-item { display: flex; align-items: center; gap: 4px; font-size: 10px; color: #666; }
.pti-leg-sq { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }

/* Ranking */
.pti-ranking { background: #fff; border: 1px solid #e8e8e8; border-radius: 12px; padding: 16px; margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.pti-rank-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #f8f8f8; border-radius: 8px; transition: all .35s; }
.pti-rank-no { font-size: 15px; width: 26px; text-align: center; flex-shrink: 0; }
.pti-rank-ava { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; flex-shrink: 0; }
.pti-rank-nama { font-size: 13px; font-weight: 600; color: #1a1a2e; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pti-rank-prog { flex: 1; background: #e8e8e8; border-radius: 20px; height: 6px; overflow: hidden; min-width: 60px; }
.pti-rank-bar { height: 100%; border-radius: 20px; transition: width .55s cubic-bezier(.4,0,.2,1); }
.pti-rank-pct { font-size: 13px; font-weight: 700; min-width: 38px; text-align: right; transition: all .3s; }

.pti-disclaimer { font-size: 11px; color: #bbb; text-align: center; margin-top: 10px; }

/* Widget sidebar */
.pti-widget { font-family: -apple-system, sans-serif; }
.pti-widget-title { font-size: 15px; font-weight: 700; margin: 0 0 12px; color: #1a1a2e; }
.pti-widget-list { display: flex; flex-direction: column; gap: 8px; }
.pti-widget-row { display: flex; align-items: center; gap: 7px; }
.pti-widget-nama { min-width: 100px; font-size: 12px; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pti-widget-bar-wrap { flex: 1; background: #f0f0f0; border-radius: 10px; height: 6px; overflow: hidden; }
.pti-widget-bar { height: 100%; background: var(--pti-color); border-radius: 10px; transition: width .5s ease; }
.pti-widget-pct { min-width: 38px; text-align: right; font-weight: 700; font-size: 12px; color: var(--pti-color); }
.pti-widget-footer { font-size: 11px; color: #aaa; margin-top: 10px; }

/* Responsive */
@media (max-width: 720px) { .pti-tokoh-grid { grid-template-columns: repeat(3,1fr); } .pti-chart-row { grid-template-columns: 1fr; } }
@media (max-width: 440px) { .pti-tokoh-grid { grid-template-columns: repeat(2,1fr); } }
