/**
 * TEMA EKSEKUTIF RESMI & PANDUAN INTERAKTIF APIP NATUNA (EDISI KEDAULATAN 2026)
 * Inspektorat Daerah Kabupaten Natuna
 * 
 * Standar: Executive Light Theme, Pure White Elevation, Anti-AI-Slop, Zero BKPSDM Mimicry.
 * Aksesibilitas WCAG 2.1 AA Compliant, High Contrast Typography.
 */

:root {
  --apip-primary: #047857;
  --apip-primary-hover: #065f46;
  --apip-primary-light: #ecfdf5;
  --apip-accent: #0284c7;
  --apip-accent-light: #f0f9ff;
  --apip-gold: #d97706;
  --apip-gold-light: #fffbeb;
  --apip-danger: #dc2626;
  --apip-danger-light: #fef2f2;
  
  --apip-bg: #f8fafc;
  --apip-card-bg: #ffffff;
  --apip-card-border: #e2e8f0;
  --apip-card-border-hover: #cbd5e1;
  
  --apip-text-main: #0f172a;
  --apip-text-muted: #475569;
  --apip-text-subtle: #64748b;
  
  --apip-radius-sm: 8px;
  --apip-radius-md: 14px;
  --apip-radius-lg: 20px;
  --apip-radius-xl: 28px;
  
  --apip-shadow-subtle: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --apip-shadow-md: 0 12px 24px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -2px rgba(15, 23, 42, 0.04);
  --apip-shadow-lg: 0 25px 50px -12px rgba(15, 23, 42, 0.14);
}

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

body.apip-light-body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--apip-bg);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(4, 120, 87, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(2, 132, 199, 0.04) 0%, transparent 40%);
  color: var(--apip-text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* 1. TOP SOVEREIGN HEADER */
.apip-nav-header {
  background: #ffffff;
  border-bottom: 1px solid var(--apip-card-border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.apip-nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.apip-brand-group {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
}

.apip-logo-shield {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.apip-brand-titles {
  display: flex;
  flex-direction: column;
}

.apip-brand-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--apip-primary);
}

.apip-brand-main {
  font-size: 16px;
  font-weight: 800;
  color: var(--apip-text-main);
  letter-spacing: -0.2px;
}

.apip-brand-sub {
  font-size: 11.5px;
  color: var(--apip-text-subtle);
  font-weight: 500;
}

.apip-partner-strip {
  display: flex;
  align-items: center;
  gap: 14px;
}

.apip-partner-strip img {
  height: 32px;
  width: auto;
  object-fit: contain;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.apip-partner-strip img:hover {
  opacity: 1;
}

.apip-header-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--apip-primary-light);
  border: 1px solid rgba(4, 120, 87, 0.2);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--apip-primary);
}

.apip-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--apip-primary);
  box-shadow: 0 0 0 0 rgba(4, 120, 87, 0.7);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(4, 120, 87, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(4, 120, 87, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(4, 120, 87, 0); }
}

/* 2. MAIN LAYOUT WRAPPER */
.apip-main-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 20px 60px;
  flex: 1;
  width: 100%;
}

/* HERO SECTION */
.apip-hero-section {
  text-align: center;
  margin-bottom: 32px;
}

.apip-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--apip-card-border);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--apip-primary);
  margin-bottom: 12px;
  box-shadow: var(--apip-shadow-subtle);
}

.apip-hero-title {
  font-size: clamp(24px, 3.2vw, 36px);
  font-weight: 900;
  letter-spacing: -0.6px;
  color: var(--apip-text-main);
  margin-bottom: 10px;
}

.apip-hero-title span {
  background: linear-gradient(135deg, var(--apip-primary), var(--apip-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.apip-hero-desc {
  font-size: 14.5px;
  color: var(--apip-text-muted);
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.6;
}

/* 3. 7-APPLICATIONS INTERACTIVE SWITCHER */
.apip-app-selector-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding: 0 4px;
}

.apip-app-selector-title span:first-child {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--apip-text-subtle);
}

.apip-active-badge {
  font-size: 12px;
  font-weight: 800;
  color: var(--apip-primary);
  background: var(--apip-primary-light);
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid rgba(4, 120, 87, 0.2);
}

.apip-app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.apip-app-card {
  background: #ffffff;
  border: 2px solid var(--apip-card-border);
  border-radius: var(--apip-radius-md);
  padding: 16px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: var(--apip-shadow-subtle);
  position: relative;
  overflow: hidden;
}

.apip-app-card:hover {
  border-color: #94a3b8;
  transform: translateY(-2px);
  box-shadow: var(--apip-shadow-md);
}

.apip-app-card.active {
  background: #ffffff;
  border-color: var(--apip-primary);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.15), var(--apip-shadow-md);
}

.apip-app-card.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--apip-primary), var(--apip-accent));
}

.apip-card-icon {
  font-size: 24px;
  line-height: 1;
}

.apip-card-name {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--apip-text-main);
}

.apip-card-meta {
  font-size: 11px;
  color: var(--apip-text-subtle);
  font-weight: 600;
}

/* 4. MAIN INTERACTIVE COCKPIT / TABS */
.apip-cockpit-card {
  background: #ffffff;
  border: 1px solid var(--apip-card-border);
  border-radius: var(--apip-radius-lg);
  box-shadow: var(--apip-shadow-lg);
  overflow: hidden;
  margin-bottom: 32px;
}

.apip-tabs-header {
  display: flex;
  border-bottom: 1px solid var(--apip-card-border);
  background: #f8fafc;
  overflow-x: auto;
}

.apip-tab-item {
  flex: 1;
  min-width: 180px;
  padding: 16px 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--apip-text-muted);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.apip-tab-item:hover {
  color: var(--apip-text-main);
  background: #f1f5f9;
}

.apip-tab-item.active {
  color: var(--apip-primary);
  background: #ffffff;
  border-bottom-color: var(--apip-primary);
  font-weight: 800;
}

.apip-tab-content {
  padding: 36px 32px;
}

.apip-pane {
  display: none;
}

.apip-pane.active {
  display: block;
}

/* FORMS */
.apip-form-grid {
  max-width: 580px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.apip-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.apip-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.apip-label-text {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--apip-text-main);
}

.apip-label-hint {
  font-size: 11.5px;
  color: var(--apip-text-subtle);
}

.apip-input-box {
  position: relative;
  display: flex;
  align-items: center;
}

.apip-input-box-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  color: #94a3b8;
  pointer-events: none;
}

.apip-text-input {
  width: 100%;
  height: 48px;
  padding: 10px 16px 10px 44px;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--apip-radius-sm);
  background: #ffffff;
  font-size: 14px;
  color: var(--apip-text-main);
  font-family: inherit;
  transition: all 0.2s ease;
}

.apip-text-input:focus {
  outline: none;
  border-color: var(--apip-primary);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.15);
}

.apip-pw-toggle {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  font-size: 16px;
  color: #94a3b8;
}

.apip-pw-toggle:hover {
  color: var(--apip-text-main);
}

/* CAPTCHA ROW */
.apip-captcha-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f1f5f9;
  border: 1.5px dashed #cbd5e1;
  padding: 10px 16px;
  border-radius: var(--apip-radius-sm);
  margin-bottom: 8px;
}

.apip-captcha-val {
  font-family: "Courier New", Courier, monospace;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 5px;
  color: var(--apip-primary);
  background: #ffffff;
  padding: 4px 14px;
  border-radius: 6px;
  border: 1px solid var(--apip-card-border);
}

.apip-btn-refresh {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--apip-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.apip-btn-refresh:hover {
  background: #f8fafc;
  color: var(--apip-text-main);
}

/* BUTTONS */
.apip-btn-primary {
  width: 100%;
  height: 50px;
  background: linear-gradient(135deg, var(--apip-primary), #059669);
  color: #ffffff;
  border: none;
  border-radius: var(--apip-radius-sm);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(4, 120, 87, 0.25);
  font-family: inherit;
}

.apip-btn-primary:hover {
  background: linear-gradient(135deg, var(--apip-primary-hover), var(--apip-primary));
  box-shadow: 0 6px 18px rgba(4, 120, 87, 0.35);
  transform: translateY(-1px);
}

/* REGISTRATION PROMPT & BADGES */
.apip-nip-badge {
  margin-top: 6px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  display: none;
}

.apip-nip-badge.valid {
  display: block;
  background: var(--apip-primary-light);
  color: var(--apip-primary);
  border: 1px solid rgba(4, 120, 87, 0.3);
}

.apip-nip-badge.invalid {
  display: block;
  background: var(--apip-danger-light);
  color: var(--apip-danger);
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.apip-pw-meter {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.apip-pw-bar {
  flex: 1;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  transition: background 0.3s ease;
}

/* 5. GUIDEBOOK & INTERACTIVE TOUR TAB */
.apip-guide-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.apip-guide-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.apip-guide-box {
  border: 1.5px solid var(--apip-card-border);
  border-radius: var(--apip-radius-md);
  padding: 20px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: all 0.2s ease;
}

.apip-guide-box:hover {
  border-color: var(--apip-primary);
  box-shadow: var(--apip-shadow-md);
  transform: translateY(-2px);
}

.apip-guide-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.apip-guide-icon {
  font-size: 28px;
  background: var(--apip-bg);
  padding: 8px;
  border-radius: 10px;
  line-height: 1;
}

.apip-guide-box h4 {
  font-size: 15px;
  font-weight: 800;
  color: var(--apip-text-main);
  margin-bottom: 4px;
}

.apip-guide-box p {
  font-size: 12px;
  color: var(--apip-text-muted);
  line-height: 1.5;
}

.apip-guide-actions {
  display: flex;
  gap: 8px;
}

.apip-btn-tour {
  flex: 1;
  padding: 8px 10px;
  background: var(--apip-primary-light);
  color: var(--apip-primary);
  border: 1px solid rgba(4, 120, 87, 0.3);
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s;
}

.apip-btn-tour:hover {
  background: var(--apip-primary);
  color: #ffffff;
}

.apip-btn-book {
  flex: 1;
  padding: 8px 10px;
  background: #f1f5f9;
  color: var(--apip-text-main);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s;
}

.apip-btn-book:hover {
  background: #e2e8f0;
}

/* 6. MODAL SYSTEM FOR TOURS & GUIDEBOOKS */
.apip-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.apip-modal-backdrop.open {
  display: flex;
}

.apip-modal-card {
  background: #ffffff;
  border-radius: var(--apip-radius-lg);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: modal-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-pop {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.apip-modal-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--apip-card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}

.apip-modal-title-group h3 {
  font-size: 17px;
  font-weight: 800;
  color: var(--apip-text-main);
}

.apip-modal-title-group p {
  font-size: 12px;
  color: var(--apip-text-subtle);
}

.apip-modal-close {
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.apip-modal-close:hover {
  background: #e2e8f0;
  color: var(--apip-text-main);
}

.apip-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  font-size: 13.5px;
  line-height: 1.6;
}

.apip-modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--apip-card-border);
  background: #f8fafc;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* TOUR STEPPER INSIDE MODAL */
.apip-tour-step {
  display: none;
}

.apip-tour-step.active {
  display: block;
}

.apip-step-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--apip-primary);
  background: var(--apip-primary-light);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.apip-step-visual {
  background: #f1f5f9;
  border: 1px solid var(--apip-card-border);
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0;
}

/* 7. LAYANAN PUBLIK NON-LOGIN BANNER */
.apip-public-banner-light {
  background: linear-gradient(135deg, #f0fdf4, #f0f9ff);
  border: 1.5px solid #bbf7d0;
  border-radius: var(--apip-radius-md);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
}

.apip-pub-copy h4 {
  font-size: 14.5px;
  font-weight: 800;
  color: #14532d;
  margin-bottom: 4px;
}

.apip-pub-copy p {
  font-size: 12.5px;
  color: #166534;
}

.apip-pub-links {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.apip-pub-btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.apip-pub-btn.wbs {
  background: #dc2626;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.2);
}

.apip-pub-btn.wbs:hover {
  background: #b91c1c;
}

.apip-pub-btn.econ {
  background: var(--apip-primary);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(4, 120, 87, 0.2);
}

.apip-pub-btn.econ:hover {
  background: var(--apip-primary-hover);
}

/* FOOTER */
.apip-site-footer {
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--apip-card-border);
  background: #ffffff;
  font-size: 12px;
  color: var(--apip-text-subtle);
}

@media (max-width: 768px) {
  .apip-nav-container { flex-direction: column; align-items: flex-start; }
  .apip-partner-strip { display: none; }
  .apip-public-banner-light { flex-direction: column; text-align: center; }
  .apip-tab-content { padding: 24px 16px; }
}
