/* GWC Knowledge Hub Ingestion UI — layout and visual styles */

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #1a1a1a;
  background: linear-gradient(180deg, #b8e4e8 0%, #9fd4d9 40%, #8ec9cf 100%);
  background-attachment: fixed;
}

/* Decorative wave pattern at bottom of viewport */
body::after {
  content: "";
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath fill='%237ab8be' fill-opacity='0.35' d='M0,60 C200,100 400,20 600,60 C800,100 1000,20 1200,60 L1200,120 L0,120 Z'/%3E%3Cpath fill='%236aabaf' fill-opacity='0.25' d='M0,80 C300,40 500,100 800,70 C950,55 1100,90 1200,75 L1200,120 L0,120 Z'/%3E%3C/svg%3E")
    no-repeat bottom center;
  background-size: 100% 100%;
  pointer-events: none;
  z-index: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem 4rem;
}

.card {
  width: 100%;
  max-width: 640px;
  background: #fff;
  padding: 2rem 2.5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* View visibility — only one active at a time */
.view {
  display: none;
}

.view.active {
  display: block;
}

h1 {
  margin: 0 0 1rem;
  font-size: 1.75rem;
  font-weight: 700;
}

h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.intro p {
  margin: 0 0 0.75rem;
}

/* Form fields */
.field {
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.field label .required {
  color: #c0392b;
}

.field input[type="text"],
.field input[type="url"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid #ccc;
  border-radius: 2px;
  font: inherit;
  background: #f5f5f5;
}

.field select[multiple] {
  min-height: 6rem;
}

.field textarea {
  min-height: 5rem;
  resize: vertical;
}

.field .hint {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: #555;
}

.field.readonly .value {
  padding: 0.35rem 0;
  color: #333;
}

.field.error input,
.field.error select,
.field.error textarea {
  border-color: #c0392b;
}

.field-error {
  color: #c0392b;
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* File upload drop zone */
.upload-zone {
  border: 2px dashed #4a90a4;
  border-radius: 4px;
  padding: 2rem 1.5rem;
  text-align: center;
  background: #fafafa;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.upload-zone:hover,
.upload-zone.dragover {
  background: #eef7f8;
  border-color: #2d7a8a;
}

.upload-zone .icon {
  font-size: 2.5rem;
  color: #888;
  margin-bottom: 0.5rem;
}

.upload-zone p {
  margin: 0 0 1rem;
  color: #444;
}

.upload-constraints {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #333;
}

.upload-constraints ul {
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
}

.file-list {
  margin-top: 1rem;
  list-style: none;
  padding: 0;
}

.file-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}

.file-list .remove-file {
  background: none;
  border: none;
  color: #c0392b;
  cursor: pointer;
  font-size: 0.85rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  font: inherit;
  font-size: 0.95rem;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid #333;
  background: #fff;
}

.btn-primary {
  background: #80ced6;
  color: #fff;
  border-color: #333;
}

.btn-primary:hover:not(:disabled) {
  background: #6bbfc8;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-block {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 1.5rem auto 0;
  padding: 0.65rem 1.5rem;
  font-size: 1rem;
}

.actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1rem;
}

.link-btn {
  background: none;
  border: none;
  color: #2d7a8a;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: none;
}

.link-btn:hover {
  text-decoration: underline;
}

/* Review page header */
.review-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.review-header .doc-progress {
  font-size: 0.95rem;
  color: #444;
  white-space: nowrap;
}

.doc-filename {
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

.section-title {
  margin: 1.5rem 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

/* Loading overlay */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  z-index: 100;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 1rem;
}

.loading-overlay.visible {
  display: flex;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #ddd;
  border-top-color: #80ced6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.alert {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
}

.alert-warning {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #664d03;
}

.alert-error {
  background: #f8d7da;
  border: 1px solid #f5c2c7;
  color: #842029;
}

.hidden-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.final-submit-text {
  margin-bottom: 0.5rem;
}

.error-code {
  margin-top: 0.5rem;
  font-family: monospace;
}

#turnstile-container {
  margin-top: 1.25rem;
}
