:root {
  --green-dark: #1D4322;
  --green-light: #5DA832;
  --green-bg: #f0f7eb;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --red: #dc2626;
  --red-light: #fef2f2;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--green-bg);
  color: var(--gray-900);
  line-height: 1.55;
  padding: 32px 16px 48px;
  min-height: 100vh;
}

.container {
  max-width: 660px;
  margin: 0 auto;
}

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

.logo {
  height: 68px;
  width: auto;
  margin-bottom: 20px;
}

.form-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 8px;
}

.subtitle {
  color: var(--gray-500);
  font-size: 0.875rem;
  max-width: 500px;
  margin: 0 auto;
}

/* Sections */
.form-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.section-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--green-dark);
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--green-bg);
}

/* Form layout */
.form-row {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.form-row.two-cols { grid-template-columns: 1fr 1fr; }

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

.form-group:last-child,
.form-row .form-group { margin-bottom: 0; }

/* Labels */
label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}

label.required::after {
  content: ' *';
  color: var(--red);
}

/* Inputs */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--gray-900);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

input::placeholder { color: var(--gray-400); }

input:focus,
select:focus {
  border-color: var(--green-light);
  box-shadow: 0 0 0 3px rgba(93, 168, 50, 0.14);
}

input.is-invalid,
select.is-invalid {
  border-color: var(--red);
}

input.is-invalid:focus,
select.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px;
  padding-right: 36px;
  cursor: pointer;
}

.error-msg {
  font-size: 0.8rem;
  color: var(--red);
  margin-top: 5px;
  min-height: 16px;
}

/* Radio */
.radio-group {
  display: flex;
  gap: 20px;
  margin-top: 2px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 400;
  color: var(--gray-700);
  font-size: 0.9375rem;
}

.radio-label input[type="radio"] {
  width: 17px;
  height: 17px;
  accent-color: var(--green-light);
  cursor: pointer;
  flex-shrink: 0;
}

/* File upload */
.file-upload-area {
  position: relative;
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 22px 20px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}

.file-upload-area:hover,
.file-upload-area.drag-over {
  border-color: var(--green-light);
  background: rgba(93, 168, 50, 0.04);
}

.file-upload-area.has-files {
  border-style: solid;
  border-color: var(--green-light);
}

.file-upload-area.is-invalid {
  border-color: var(--red);
  border-style: dashed;
}

.file-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-upload-content svg {
  width: 32px;
  height: 32px;
  color: var(--gray-400);
  margin-bottom: 8px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.file-upload-content p {
  font-size: 0.875rem;
  color: var(--gray-500);
}

.upload-link {
  color: var(--green-light);
  font-weight: 500;
  text-decoration: underline;
}

.file-hint {
  font-size: 0.8rem !important;
  color: var(--gray-400) !important;
  margin-top: 3px;
}

/* File list */
.file-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  color: var(--gray-700);
}

.file-item svg {
  width: 15px;
  height: 15px;
  color: var(--green-light);
  flex-shrink: 0;
}

.file-item .file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item .file-size {
  color: var(--gray-400);
  font-size: 0.78rem;
  flex-shrink: 0;
}

.remove-file {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 2px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.remove-file:hover { color: var(--red); }

/* Footer */
.form-footer {
  text-align: center;
  padding: 8px 0 8px;
}

.privacy-note {
  font-size: 0.8rem;
  color: var(--gray-400);
  margin-bottom: 20px;
}

.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--green-dark);
  color: var(--white);
  border: none;
  padding: 13px 52px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  min-width: 200px;
}

.submit-btn:hover:not(:disabled) { background: #265429; }
.submit-btn:active:not(:disabled) { transform: scale(0.98); }
.submit-btn:disabled { opacity: 0.7; cursor: not-allowed; }

.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.spinner {
  width: 18px;
  height: 18px;
  animation: spin 0.75s linear infinite;
}

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

/* Error banner */
.error-banner {
  background: var(--red-light);
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  color: var(--red);
  font-size: 0.875rem;
  display: none;
}

.error-banner.visible { display: block; }

/* Success page */
.success-section {
  text-align: center;
  padding: 48px 28px;
}

.success-icon {
  width: 68px;
  height: 68px;
  background: var(--green-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  border: 2px solid var(--green-light);
}

.success-icon svg {
  width: 32px;
  height: 32px;
  color: var(--green-light);
  stroke-width: 2.5;
}

.success-section h2 {
  font-size: 1.4rem;
  color: var(--green-dark);
  margin-bottom: 12px;
}

.success-section p {
  color: var(--gray-500);
  font-size: 0.9375rem;
  max-width: 420px;
  margin: 0 auto 10px;
}

.success-note {
  font-size: 0.85rem !important;
  color: var(--gray-400) !important;
}

.back-link {
  display: inline-block;
  margin-top: 28px;
  color: var(--green-light);
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 520px) {
  .form-row.two-cols { grid-template-columns: 1fr; }
  .form-section { padding: 20px 16px; }
  .submit-btn { width: 100%; }
}
