/* Reset & Base */
body {
  font-family: system-ui, sans-serif;
  background: #f8f9fc;
  margin: 0;
  padding: 2rem;
  color: #1a1a1a;
}

h1 {
  text-align: center;
  font-size: 1.75rem;
  margin-bottom: 2rem;
}

/* Layout */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 2rem;
}

.main-layout.mandate-shown {
  grid-template-columns: 2fr 1fr 1fr;
}

/* Form styling */
.form-section .container section {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

label {
  font-weight: 600;
  display: block;
  margin-bottom: 0.4rem;
}

input[type="text"],
input[type="email"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}

input[type="file"] {
  padding: 0.25rem;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #0070f3;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0,112,243,0.2);
}

/* Drop zone */
.drop-zone {
  background: #eef1f7;
  padding: 1rem;
  border: 2px dashed #ccc;
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.drop-zone:hover {
  background: #e3e8f0;
}

/* Mandator Grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-grid label {
  font-weight: 500;
}

/* Spinner */
#spinner {
  font-size: 0.9rem;
  margin: 0.5rem 0;
  color: #555;
}

/* Preview Cards */
.preview-section {
  background: white;
  border: 1px solid #ddd;
  padding: 0.75rem;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.preview-section label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: block;
}

.pdf-preview {
  width: 100%;
  height: 600px;
  overflow: auto;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.pdf-preview embed {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Applicant Summary */
.applicant-summary {
  background: #eaf4ff;
  padding: 1rem;
  border-radius: 6px;
  margin-top: 1rem;
  font-family: sans-serif;
  line-height: 1.5;
  font-size: 0.95rem;
}

/* Copy button in JSON */
.copy-button {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 4px;
  width: 24px;
  height: 24px;
  opacity: 0.7;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.copy-button:hover {
  opacity: 1;
}

.copy-button svg {
  width: 100%;
  height: 100%;
}

.request-json-container {
  position: relative;
}

/* Request JSON Block */
#request-json {
  margin: 0;
  padding: 2.5rem 1rem 1rem;
  background: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 4px;
  white-space: pre-wrap;
}

/* Each JSON card */
#request-json > div {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.04);
  position: relative;
  overflow-x: auto;
}

#request-json pre {
  font-size: 0.9rem;
  line-height: 1.4;
  font-family: monospace;
}

/* Buttons */
button {
  background: #0070f3;
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
}

button:hover {
  background: #005ec4;
}

button#edit-applicant {
  margin-top: 1rem;
}

button#save-applicant {
  margin-top: 0.5rem;
}

ul#ep-list {
  padding-left: 1.2rem;
  color: #444;
  margin-top: 0.5rem;
}

.hidden {
  display: none;
}

.drop-zone.drag-over {
  background: #d9e8ff;
  border-color: #3399ff;
}

#json-wrapper {
  transition: max-height 0.3s ease;
  overflow: hidden;
}

#json-wrapper.hidden {
  display: none;
}

.page-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: #111;
}

/* Optional: add a bit of top space on the form-section */
.form-section .container {
  margin-top: 1rem;
}

.submission-results p {
  margin: 0.5rem 0;
  font-weight: 500;
}

button:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
  opacity: 0.6;
}
