:root {
  --bg: #f0f4f8;
  --card: #fff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --radius: 12px;
  --shadow: 0 8px 28px rgba(15, 23, 42, 0.09);
}

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

body {
  font-family: Inter, system-ui, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 20px 14px;
}

.wrapper { width: 100%; max-width: 860px; }

.hero { text-align: center; margin-bottom: 14px; }
.hero h1 { font-size: 1.65rem; font-weight: 700; letter-spacing: -0.02em; }
.hero p  { color: var(--muted); font-size: 0.88rem; margin-top: 3px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

.card-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: #fafbfd;
}
.card-header h2 { font-size: 0.97rem; font-weight: 600; }

.form-body { padding: 14px 20px; display: flex; flex-direction: column; gap: 11px; }

/* Grids */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 11px; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 4px; }
label { font-size: 0.78rem; font-weight: 600; color: #374151; }

input[type="text"],
input[type="tel"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 0.88rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.17s, box-shadow 0.17s;
}
input:focus, select:focus, textarea:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.09);
}
textarea { min-height: 56px; resize: vertical; }

/* Upload */
.upload-box {
  border: 1.5px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  padding: 9px 12px;
}
.upload-box small { display: block; color: var(--muted); margin-top: 4px; font-size: 0.77rem; }

.file-list { list-style: none; padding: 0; }
.file-list li {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 0.81rem;
  background: #fff;
  margin-top: 4px;
}

.type-note {
  font-size: 0.81rem;
  padding: 7px 11px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 7px;
  color: #92400e;
}

/* Buttons */
.actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 2px; }

button {
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.17s, transform 0.07s;
}
button:active { transform: scale(0.99); }
button:disabled { opacity: 0.65; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #fff; min-width: 138px; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary { background: #eef2ff; color: #1e3a8a; }
.btn-secondary:hover { background: #e0e7ff; }

/* Progress */
.progress-wrap {
  padding: 11px 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 9px;
}
.progress-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.81rem;
  font-weight: 600;
  color: #1e3a8a;
  margin-bottom: 7px;
}
.progress-bar { height: 7px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--primary); transition: width 0.25s ease; }
.progress-note { font-size: 0.77rem; color: #475569; margin-top: 5px; }

/* Status */
.status {
  padding: 11px 14px;
  border-radius: 9px;
  font-size: 0.88rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.status.success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.status.error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.status.warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* PDF Actions */
.pdf-actions { display: flex; justify-content: center; padding-top: 4px; }
.btn-pdf {
  background: #1e3a8a;
  color: #fff;
  padding: 9px 24px;
  font-size: 0.92rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-pdf:hover { background: #1e40af; }

.footer-note { text-align: center; color: var(--muted); font-size: 0.8rem; margin-top: 9px; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-box {
  background: #fff;
  border-radius: 14px;
  padding: 28px 30px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  text-align: center;
}
.modal-box h3 { font-size: 1.05rem; margin-bottom: 11px; }
.modal-box p  { color: #374151; font-size: 0.92rem; line-height: 1.6; margin-bottom: 16px; }
.modal-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 0.85rem;
  color: #4b5563;
  margin-bottom: 18px;
  cursor: pointer;
}
.modal-checkbox input { width: 14px; height: 14px; cursor: pointer; accent-color: var(--primary); }

.hidden { display: none !important; }

@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.35rem; }
  .actions { flex-direction: column; }
  .btn-primary, .btn-secondary { width: 100%; }
}
