:root {
  --primary: #0066b2;
  --primary-dark: #004d87;
  --primary-darker: #003a66;
  --primary-light: #e6f0f9;
  --primary-lighter: #f0f7fc;
  --text-primary: #1a1a2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --success: #059669;
  --success-light: #ecfdf5;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --border: #e5e7eb;
  --bg-page: #f0f7fc;
  --bg-card: #ffffff;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.page-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 2rem 1rem;
  text-align: center;
}

.header-content {
  max-width: 520px;
  margin: 0 auto;
}

.logo-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.logo-placeholder {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
}

.logo-divider {
  font-weight: bold;
}

.header-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.header-subtitle {
  margin: 0.5rem 0 1rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.container {
  max-width: 520px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.4s ease-out;
}

.section-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-dark);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.2s;
  background: white;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.readonly-field {
  background-color: #f9fafb;
  cursor: not-allowed;
  color: var(--text-secondary);
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-block {
  width: 100%;
}

.btn-loading {
  opacity: 0.8;
  cursor: not-allowed;
}

.btn-loading::after {
  content: "";
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

.alert {
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  border-left: 4px solid;
}

.alert-danger {
  background-color: var(--danger-light);
  color: var(--danger);
  border-color: var(--danger);
}

.alert-warning {
  background-color: var(--warning-light);
  color: var(--warning);
  border-color: var(--warning);
}

.alert-success {
  background-color: var(--success-light);
  color: var(--success);
  border-color: var(--success);
}

.alert-info {
  background-color: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary);
}

.error-text {
  color: var(--danger);
  font-size: 0.75rem;
  margin-top: 0.25rem;
  display: block;
}

.biodata-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.biodata-item {
  background: var(--bg-page);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
}

.biodata-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.biodata-value {
  font-weight: 600;
  color: var(--text-primary);
}

.photo-frame {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--primary-light);
  margin: 0 auto 1.5rem;
  overflow: hidden;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.consent-group {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--primary-lighter);
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-top: 1.5rem;
  border: 1px solid var(--primary-light);
}

.consent-group input[type="checkbox"] {
  margin-top: 0.25rem;
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--primary);
}

.consent-group label {
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--text-primary);
  font-weight: 500;
  cursor: pointer;
}

.success-icon {
  width: 64px;
  height: 64px;
  background: var(--success-light);
  color: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  animation: pulse 2s infinite;
}

.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.text-muted { color: var(--text-muted); }
.small { font-size: 0.875rem; }

.footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.qr-container {
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  margin: 1.5rem auto;
  max-width: 300px;
}

.kode-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 0.5rem 1.5rem;
  border-radius: 999px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin: 1rem 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(5, 150, 105, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}

@media (min-width: 768px) {
  .page-header { padding: 3rem 1rem; }
  .header-title { font-size: 2rem; }
  .card { padding: 2rem; }
}

@media print {
  .page-header, .footer, .btn-primary { display: none !important; }
  body { background: white; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}
