/* ─── Page layout (non-map pages) ────────────────────────────
   style.css sets html,body { height:100%; overflow:hidden } for the map.
   Without overriding html, the document cannot scroll. */
html:has(body.page-body) {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body.page-body {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg);
}

.page-main {
  padding-top: calc(var(--header-h) + 40px);
  padding-bottom: 80px;
  min-height: 100vh;
}

.page-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Contribute hero ───────────────────────────────────────── */
.contribute-hero {
  margin-bottom: 40px;
}

.hero-tag {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(200,240,96,0.2);
  border-radius: 20px;
  padding: 4px 12px;
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 16px;
}

.hero-title em {
  font-style: normal;
  color: var(--accent);
}

.hero-sub {
  font-size: 16px;
  color: var(--text-dim);
  line-height: 1.7;
  max-width: 580px;
}

/* ─── Form card ─────────────────────────────────────────────── */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.form-section {
  padding: 28px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-section:last-child { border-bottom: none; }

.form-section-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
}

.req { color: var(--accent); }

.form-input,
.form-textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-muted); }

.form-input:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input.error,
.form-textarea.error { border-color: #ef4444; }

.form-textarea { resize: vertical; min-height: 160px; line-height: 1.7; }

.field-hint { font-size: 11px; color: var(--text-muted); }
.field-hint-inline { font-size: 12px; color: var(--text-muted); font-weight: 400; }

.field-error {
  font-size: 12px;
  color: #ef4444;
  min-height: 16px;
}

.char-count {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
}

/* ─── Photo upload ──────────────────────────────────────────── */
.photo-upload {
  cursor: pointer;
  width: 120px;
}

.photo-preview {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px dashed var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
}

.photo-preview:hover { border-color: var(--accent); }

.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
  padding: 12px;
}

.photo-placeholder svg { width: 32px; height: 32px; opacity: 0.5; }
.photo-hint { font-size: 10px; opacity: 0.6; }

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

/* ─── Institution search ────────────────────────────────────── */
.inst-search-wrap { position: relative; }

.inst-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  z-index: 100;
  display: none;
  box-shadow: var(--shadow);
  max-height: 200px;
  overflow-y: auto;
}

.inst-suggestions.visible { display: block; }

.inst-suggestion {
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.inst-suggestion:last-child { border-bottom: none; }
.inst-suggestion:hover { background: var(--surface); }
.inst-suggestion-country { font-size: 11px; color: var(--text-muted); }

/* ─── Tags grid ─────────────────────────────────────────────── */
.tags-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-dim);
  transition: all 0.15s;
  user-select: none;
}

.tag-option:hover { border-color: var(--border-hover); color: var(--text); }

.tag-option.selected {
  border-color: var(--teal);
  background: var(--teal-dim);
  color: var(--teal);
}

.tag-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}

/* ─── Keyword chips ─────────────────────────────────────────── */
.keyword-input-wrap { display: flex; flex-direction: column; gap: 8px; }

.keyword-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}

.keyword-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text-dim);
}

.keyword-chip button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  padding: 0;
  line-height: 1;
  transition: color 0.15s;
}

.keyword-chip button:hover { color: #ef4444; }

/* ─── Links ─────────────────────────────────────────────────── */
.links-list { display: flex; flex-direction: column; gap: 8px; }

.link-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 8px;
  align-items: center;
}

.link-row .form-input { margin: 0; }

.remove-link-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px 10px;
  font-size: 16px;
  transition: all 0.15s;
}

.remove-link-btn:hover { border-color: #ef4444; color: #ef4444; }

.add-link-btn {
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  padding: 9px 16px;
  font-size: 13px;
  width: 100%;
  transition: all 0.15s;
  font-family: var(--font-body);
}

.add-link-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ─── Submit ─────────────────────────────────────────────────── */
.form-submit {
  padding: 28px 32px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.submit-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.submit-btn {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 32px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  letter-spacing: -0.01em;
}

.submit-btn:hover { opacity: 0.9; }
.submit-btn:active { transform: scale(0.98); }
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.submit-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(13,15,20,0.3);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.submit-spinner.visible { display: block; }

/* ─── Success card ──────────────────────────────────────────── */
.success-card {
  background: var(--surface);
  border: 1px solid rgba(200,240,96,0.2);
  border-radius: 16px;
  padding: 60px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 2px solid rgba(200,240,96,0.3);
  color: var(--accent);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.success-body {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.7;
  max-width: 460px;
}
