/* Global Styles */
body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  background-color: #f3f4f6;
  color: #1f2937;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding-top: 40px;
  padding-bottom: 40px;
}

.container {
  width: 100%;
  max-width: 600px;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  padding: 32px;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 32px;
}

header h1 {
  font-size: 24px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 8px;
  margin-top: 0;
}

header p {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

/* Upload Section */
.upload-section {
  margin-bottom: 24px;
}

.drop-zone {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  transition: all 0.2s ease;
  background-color: #f9fafb;
}

.drop-zone.dragover {
  border-color: #3b82f6;
  background-color: #eff6ff;
}

.drop-zone p {
  margin: 0 0 16px;
  color: #4b5563;
  font-size: 14px;
}

.drop-zone .or {
  margin: 8px 0;
  color: #9ca3af;
  font-size: 12px;
}

/* Preview Section */
.preview-container {
  position: relative;
  margin-top: 16px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.preview-container img {
  width: 100%;
  display: block;
}

.preview-container .btn.icon {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.9);
  color: #ef4444;
  font-size: 20px;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-container .btn.icon:hover {
  background-color: #ffffff;
  color: #dc2626;
}

/* Loading */
.loading {
  text-align: center;
  padding: 20px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

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

.loading p {
  font-size: 14px;
  color: #6b7280;
}

/* Form Styles */
.ktp-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

input, textarea {
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  color: #111827;
  transition: border-color 0.2s;
  font-family: inherit;
}

input:focus, textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Buttons */
.btn {
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn.primary {
  background-color: #3b82f6;
  color: #ffffff;
}

.btn.primary:hover {
  background-color: #2563eb;
}

.btn.secondary {
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  color: #374151;
}

.btn.secondary:hover {
  border-color: #9ca3af;
  background-color: #f9fafb;
}

.form-actions {
  margin-top: 16px;
  text-align: right;
}

/* Utility */
.hidden {
  display: none !important;
}

/* Camera */
.action-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.camera-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: #000;
  padding: 16px;
  border-radius: 8px;
}

#camera-stream {
  width: 100%;
  max-width: 480px;
  border-radius: 8px;
  background: #000;
}

.camera-controls {
  display: flex;
  gap: 16px;
}
