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

:root {
  --navy: #1e3a5f;
  --navy-light: #2c5282;
  --accent: #2b6cb0;
  --bg: #f7f8fa;
  --card: #ffffff;
  --text: #1f2937;
  --text-light: #6b7280;
  --border: #d1d5db;
  --border-light: #e5e7eb;
  --error: #dc2626;
  --error-bg: #fef2f2;
  --success: #059669;
  --success-bg: #ecfdf5;
  --radius: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

header {
  background: var(--navy);
  color: white;
  padding: 32px 24px;
  border-radius: var(--radius) var(--radius) 0 0;
  text-align: center;
}

header h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

header p {
  font-size: 14px;
  opacity: 0.85;
}

.form-card {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 32px 24px;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-light);
}

.section-title:not(:first-child) {
  margin-top: 32px;
}

.field {
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

label .required {
  color: var(--error);
  margin-left: 2px;
}

label .optional {
  color: var(--text-light);
  font-weight: 400;
  font-size: 12px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.1);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--bg);
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(43, 108, 176, 0.04);
}

.drop-zone-icon {
  font-size: 32px;
  margin-bottom: 8px;
  display: block;
  opacity: 0.5;
}

.drop-zone-text {
  font-size: 14px;
  color: var(--text-light);
}

.drop-zone-text strong {
  color: var(--accent);
}

.drop-zone-hint {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

/* Image previews */
.previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.preview-item {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid var(--border-light);
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}

.preview-remove:hover {
  background: rgba(220, 38, 38, 0.8);
}

/* Progress bar */
.progress-container {
  display: none;
  margin-top: 16px;
}

.progress-container.active {
  display: block;
}

.progress-bar {
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s;
}

.progress-text {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
  text-align: center;
}

/* Submit */
.submit-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--navy);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 32px;
}

.submit-btn:hover {
  background: var(--navy-light);
}

.submit-btn:disabled {
  background: var(--text-light);
  cursor: not-allowed;
}

/* Feedback */
.feedback {
  display: none;
  padding: 16px;
  border-radius: 6px;
  margin-top: 16px;
  font-size: 14px;
}

.feedback.success {
  display: block;
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #a7f3d0;
}

.feedback.error {
  display: block;
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid #fca5a5;
}

.feedback .complaint-id {
  font-weight: 700;
  font-size: 16px;
}

/* Validation */
.field-error {
  color: var(--error);
  font-size: 12px;
  margin-top: 4px;
  display: none;
}

input:invalid:not(:placeholder-shown),
select:invalid:not([value=""]),
textarea:invalid:not(:placeholder-shown) {
  border-color: var(--error);
}

/* Anonymous notice */
.anon-notice {
  background: #f0f4ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 13px;
  color: #1e40af;
  margin-bottom: 20px;
}

footer {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  color: var(--text-light);
}

@media (max-width: 480px) {
  .container {
    padding: 12px 8px 32px;
  }

  header {
    padding: 24px 16px;
  }

  header h1 {
    font-size: 18px;
  }

  .form-card {
    padding: 24px 16px;
  }

  .previews {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }
}

/* Autocomplete */
.autocomplete-wrapper {
  position: relative;
}

.autocomplete-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.95rem;
  border-bottom: 1px solid #f0f0f0;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background: var(--light-bg);
  color: var(--navy);
}
