/* WorkSafe — public submission app styles */
/* Mobile-first. No sidebar. Brand: #bc0000 */

:root {
  --ws-brand:        #bc0000;
  --ws-brand-dark:   #8a0000;
  --ws-brand-light:  #f9e8e8;
  --ws-brand-grey:   #3d3d3d;
  --ws-text:         #1a1a1a;
  --ws-text-muted:   #5a5a5a;
  --ws-border:       #d0d0d0;
  --ws-bg:           #f5f5f5;
  --ws-surface:      #ffffff;
  --ws-success:      #1a7f37;
  --ws-success-bg:   #e8f5ec;
  --ws-danger:       #c0392b;
  --ws-danger-bg:    #fdecea;
  --ws-gold:         #f59e0b;
  --ws-radius:       8px;
  --ws-shadow:       0 2px 8px rgba(0,0,0,0.08);
  --ws-transition:   0.15s ease;
}

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ws-text);
  background: var(--ws-brand-grey);
}

/* ── Header ─────────────────────────────────────────────────────────────────── */

.ws-header {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--ws-brand-grey);
  color: #fff;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.ws-header-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
}

.ws-header-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.ws-header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.ws-header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.ws-logo {
  height: 40px;
  width: auto;
  display: block;
}

.ws-header-tagline {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  font-size: 1.75rem;
  letter-spacing: 0.04em;
  color: #fff;
}

/* ── Main & Footer ───────────────────────────────────────────────────────────── */

.ws-main {
  min-height: calc(100vh - 140px);
  padding-top: 1.25rem;
  padding-bottom: 4rem;
  background: var(--ws-bg);
}

.ws-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

.ws-footer {
  background: var(--ws-brand-grey);
  color: #aaa;
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
  position: sticky;
  bottom: 0;
  z-index: 100;
}

.ws-footer p { margin: 0; }

/* ── Alerts ──────────────────────────────────────────────────────────────────── */

.ws-alerts {
  max-width: 800px;
  margin: 0 auto 1rem;
  padding: 0 1rem;
}

.ws-alert {
  padding: 0.75rem 1rem;
  border-radius: var(--ws-radius);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.ws-alert-danger  { background: var(--ws-danger-bg);  color: var(--ws-danger);  border: 1px solid #f5b7b1; }
.ws-alert-success { background: var(--ws-success-bg); color: var(--ws-success); border: 1px solid #a9dfbf; }
.ws-alert-info    { background: #eaf4fb; color: #1a5276; border: 1px solid #aed6f1; }

/* ── Intro ───────────────────────────────────────────────────────────────────── */

.ws-intro {
  margin-bottom: 1.5rem;
}

.ws-intro h1 {
  margin: 0 0 0.25rem;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ws-text);
}

.ws-intro p {
  margin: 0;
  color: var(--ws-text-muted);
  font-size: 0.95rem;
}

/* ── Category grid ───────────────────────────────────────────────────────────── */

.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 1rem;
  background: var(--ws-surface);
  border: 2px solid var(--ws-border);
  border-radius: var(--ws-radius);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--ws-transition), background var(--ws-transition), box-shadow var(--ws-transition);
  box-shadow: var(--ws-shadow);
  min-height: 100px;
}

.category-card:hover {
  border-color: var(--ws-brand);
  box-shadow: 0 4px 12px rgba(188,0,0,0.12);
}

.category-card[aria-pressed="true"] {
  background: var(--ws-brand-light);
  border-color: var(--ws-brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(188,0,0,0.25);
}

.category-emoji {
  font-size: 1.5rem;
  line-height: 1;
  align-self: center;
  padding-top: 0.25rem;
}

.category-title {
  color: var(--ws-text);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  align-self: center;
  padding-top: 0.5rem;
}

.category-desc {
  color: var(--ws-text-muted);
  font-size: 0.78rem;
  opacity: 0.75;
  line-height: 1.3;
  align-self: center;
}

.category-card[aria-pressed="true"] .category-desc {
  opacity: 0.9;
}

/* ── Observation type card selector ─────────────────────────────────────────── */

.ws-card-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.ws-type-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 1rem;
  background: var(--ws-surface);
  border: 2px solid var(--ws-border);
  border-radius: var(--ws-radius);
  cursor: pointer;
  text-align: left;
  box-shadow: var(--ws-shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  color: var(--ws-text);
}

.ws-type-card:hover {
  border-color: var(--ws-brand);
  box-shadow: 0 4px 12px rgba(188,0,0,0.12);
}

.ws-type-card--selected,
.ws-type-card[aria-pressed="true"] {
  background: var(--ws-brand-light);
  border-color: var(--ws-brand);
  color: var(--ws-text);
  box-shadow: 0 4px 12px rgba(188,0,0,0.25);
}

.ws-type-card-emoji {
  font-size: 1.5rem;
  line-height: 1;
}

.ws-type-card-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.ws-type-card-desc {
  font-size: 0.78rem;
  opacity: 0.75;
  line-height: 1.3;
}

.ws-type-card--selected .ws-type-card-desc,
.ws-type-card[aria-pressed="true"] .ws-type-card-desc {
  opacity: 0.9;
}

/* ── Form shell ──────────────────────────────────────────────────────────────── */

.ws-form {
  background: var(--ws-surface);
  border-radius: var(--ws-radius);
  padding: 1.5rem;
  box-shadow: var(--ws-shadow);
  border: 1px solid var(--ws-border);
  margin-bottom: 2rem;
}

.ws-form[hidden] { display: none; }

.ws-form-title {
  margin: 0 0 1.25rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ws-text);
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--ws-brand-light);
}

.ws-form-intro {
  margin: -0.5rem 0 1rem;
  color: var(--ws-text-muted);
  font-size: 0.9rem;
}

/* ── Fields ──────────────────────────────────────────────────────────────────── */

.ws-field {
  margin-bottom: 1.25rem;
}

.ws-field:last-of-type {
  margin-bottom: 1.5rem;
}

.ws-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0;
}

.ws-field-row .ws-field {
  margin-bottom: 1.25rem;
}

.ws-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
  color: var(--ws-text);
}

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

.ws-field-hint {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  color: var(--ws-text-muted);
  line-height: 1.3;
}

.ws-input,
.ws-textarea,
.ws-select {
  display: block;
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--ws-text);
  background: #fff;
  border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius);
  transition: border-color var(--ws-transition), box-shadow var(--ws-transition);
  appearance: none;
  -webkit-appearance: none;
}

.ws-input:focus,
.ws-textarea:focus,
.ws-select:focus {
  outline: none;
  border-color: var(--ws-brand);
  box-shadow: 0 0 0 3px rgba(188,0,0,0.12);
}

.ws-textarea { resize: vertical; }

.ws-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a5a5a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
  cursor: pointer;
}

/* ── Radio group ─────────────────────────────────────────────────────────────── */

.ws-radio-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.ws-radio {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: border-color var(--ws-transition), background var(--ws-transition);
  user-select: none;
}

.ws-radio:has(input:checked) {
  border-color: var(--ws-brand);
  background: var(--ws-brand-light);
  color: var(--ws-brand-dark);
}

.ws-radio input[type="radio"] {
  accent-color: var(--ws-brand);
}

/* ── Segmented button group (mirrors severity-group style) ───────────────────── */

.ws-seg-group {
  display: flex;
  width: 100%;
  border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.ws-seg-group input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.ws-seg-group label {
  flex: 1;
  text-align: center;
  padding: 0.45rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border-right: 1px solid var(--ws-border);
  color: var(--ws-text-muted);
  transition: background var(--ws-transition), color var(--ws-transition);
  user-select: none;
}

.ws-seg-group label:last-of-type {
  border-right: none;
}

.ws-seg-group input[type="radio"]:checked + label {
  background: var(--ws-brand-light);
  color: var(--ws-brand);
}

/* ── Location mode tabs ──────────────────────────────────────────────────────── */

.ws-loc-panel {
  margin-top: 0;
}

/* ── JN / Scheme custom search dropdown ─────────────────────────────────────── */

.ws-jn-wrap {
  position: relative;
}

.ws-jn-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--ws-surface);
  border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius);
  box-shadow: var(--ws-shadow);
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  z-index: 200;
}

.ws-jn-results li {
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  color: var(--ws-text);
  cursor: pointer;
  border-bottom: 1px solid var(--ws-border);
}

.ws-jn-results li:last-child {
  border-bottom: none;
}

.ws-jn-results li:hover,
.ws-jn-results li.ws-jn-active {
  background: var(--ws-brand-light);
  color: var(--ws-brand);
}

.ws-jn-results li.ws-jn-empty {
  color: var(--ws-text-muted);
  cursor: default;
  font-style: italic;
}

.ws-jn-results li.ws-jn-empty:hover {
  background: none;
  color: var(--ws-text-muted);
}

/* ── What3Words status indicator ─────────────────────────────────────────────── */

.ws-w3w-status {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  font-weight: 500;
}

.ws-w3w-loading { color: var(--ws-text-muted); }
.ws-w3w-ok      { color: #1a7a3c; }
.ws-w3w-error   { color: var(--ws-brand); }

/* ── Location row ────────────────────────────────────────────────────────────── */

.ws-location-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.ws-location-row .ws-input {
  flex: 1;
}

.ws-gps-btn {
  flex-shrink: 0;
  padding: 0.6rem 0.875rem;
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 500;
  background: #fff;
  border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--ws-transition), background var(--ws-transition);
  color: var(--ws-text);
}

.ws-gps-btn:hover:not(:disabled) {
  border-color: var(--ws-brand);
  background: var(--ws-brand-light);
  color: var(--ws-brand-dark);
}

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

/* ── File input ──────────────────────────────────────────────────────────────── */

.ws-file-input {
  display: block;
  width: 100%;
  padding: 0.5rem;
  font-size: 0.875rem;
  font-family: inherit;
  border: 1px dashed var(--ws-border);
  border-radius: var(--ws-radius);
  background: #fafafa;
  cursor: pointer;
}

.ws-file-input:focus {
  outline: none;
  border-color: var(--ws-brand);
}

/* ── Star ratings ────────────────────────────────────────────────────────────── */

.ws-stars {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: wrap;
}

.ws-star {
  font-size: 1.75rem;
  color: #ccc;
  cursor: pointer;
  transition: color var(--ws-transition), transform var(--ws-transition);
  line-height: 1;
  user-select: none;
}

.ws-star.hovered,
.ws-star.selected {
  color: var(--ws-gold);
}

.ws-star:hover {
  transform: scale(1.15);
}

.ws-star-label {
  font-size: 0.8rem;
  color: var(--ws-text-muted);
  margin-left: 0.5rem;
  font-weight: 500;
  min-width: 80px;
}

.ws-ratings-section {
  margin: 0.25rem 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ws-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Divider ─────────────────────────────────────────────────────────────────── */

.ws-divider {
  border: none;
  border-top: 1px solid var(--ws-border);
  margin: 1.25rem 0;
}

/* ── Submit button ───────────────────────────────────────────────────────────── */

.ws-submit-btn {
  display: inline-block;
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--ws-brand);
  border: none;
  border-radius: var(--ws-radius);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background var(--ws-transition), box-shadow var(--ws-transition);
  box-shadow: 0 2px 6px rgba(188,0,0,0.25);
}

.ws-submit-btn:hover {
  background: var(--ws-brand-dark);
  box-shadow: 0 4px 12px rgba(188,0,0,0.3);
}

.ws-submit-btn:active {
  transform: translateY(1px);
}

/* ── Honeypot ────────────────────────────────────────────────────────────────── */

.ws-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

/* ── Success page ────────────────────────────────────────────────────────────── */

.ws-success-page {
  text-align: center;
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.ws-success-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.ws-success-heading {
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
  color: var(--ws-success);
}

.ws-success-ref {
  font-size: 1.1rem;
  color: var(--ws-text-muted);
  margin: 0 0 0.25rem;
}

.ws-success-type {
  font-size: 1rem;
  color: var(--ws-text-muted);
  margin: 0 0 2rem;
}

.ws-success-message {
  max-width: 520px;
  margin: 0 auto 2rem;
  text-align: left;
  background: var(--ws-surface);
  border-radius: var(--ws-radius);
  padding: 1.25rem;
  border: 1px solid var(--ws-border);
  box-shadow: var(--ws-shadow);
}

.ws-success-message p {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.ws-success-message p:last-child { margin: 0; }

.ws-success-policy {
  color: var(--ws-text-muted);
  font-size: 0.875rem !important;
  padding-top: 0.75rem;
  border-top: 1px solid var(--ws-border);
}

.ws-submit-another {
  display: inline-block;
  width: auto;
  min-width: 200px;
}

/* ── Submission progress bar ─────────────────────────────────────────────────── */

.ws-progress-wrap {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: var(--ws-brand-light);
  border: 1px solid rgba(188,0,0,0.2);
  border-radius: var(--ws-radius);
}

.ws-progress-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ws-brand);
  margin-bottom: 0.5rem;
}

.ws-progress-track {
  height: 6px;
  background: rgba(188,0,0,0.15);
  border-radius: 3px;
  overflow: hidden;
}

.ws-progress-fill {
  height: 100%;
  background: var(--ws-brand);
  border-radius: 3px;
  width: 0%;
  transition: width 0.35s ease;
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */

@media (max-width: 520px) {
  .category-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .category-card {
    padding: 0.75rem;
    min-height: 90px;
  }

  .category-emoji { font-size: 1.25rem; }
  .category-title { font-size: 0.85rem; }
  .category-desc  { font-size: 0.75rem; }

  .ws-field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .ws-location-row {
    flex-direction: column;
  }

  .ws-form {
    padding: 1rem;
  }

  .ws-gps-btn {
    width: 100%;
  }

  .ws-card-selector {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .ws-type-card {
    padding: 0.75rem;
  }

  .ws-type-card-emoji { font-size: 1.25rem; }
  .ws-type-card-title { font-size: 0.85rem; }
  .ws-type-card-desc  { font-size: 0.75rem; }
}

/* ── File queue widget ──────────────────────────────────────────────────── */

.ws-add-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  background: var(--brand-light);
  color: var(--brand-primary);
  border: 1.5px dashed var(--brand-primary);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  justify-content: center;
  transition: background 0.15s;
}

.ws-add-file-btn:hover {
  background: #f5e0e0;
}

.ws-file-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ws-file-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: #f9f9f9;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.82rem;
}

.ws-file-list li .ws-fq-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.ws-file-list li .ws-fq-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text);
}

.ws-file-list li .ws-fq-remove {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 0.2rem;
  line-height: 1;
}

.ws-file-list li .ws-fq-remove:hover {
  color: var(--color-danger);
}
