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

:root {
  --bg: #1a1a2e;
  --card: #16213e;
  --card-border: #0f3460;
  --card-border-active: #0891b2;
  --accent: #0891b2;
  --accent-hover: #0e7490;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-disabled: #475569;
  --success: #10b981;
  --success-bg: rgba(16,185,129,0.1);
  --success-border: rgba(16,185,129,0.3);
  --error: #ef4444;
  --error-bg: rgba(239,68,68,0.1);
  --error-border: rgba(239,68,68,0.35);
  --warning: #f59e0b;
  --step-num-bg: #0891b2;
  --step-complete-bg: #10b981;
  --overlay: rgba(26,26,46,0.7);
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  background-image: radial-gradient(circle, rgba(8,145,178,0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px 60px;
  line-height: 1.5;
}

.container {
  width: 100%;
  max-width: 720px;
}

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

.site-header {
  text-align: center;
  margin-bottom: 32px;
}

.site-header .logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

.site-header .logo-row img {
  width: 32px;
  height: 32px;
}

.site-header h1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.site-header .subtitle {
  font-size: 15px;
  color: var(--text-muted);
}

/* ─── Step Cards ─────────────────────────────────────── */

.step-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  margin-bottom: 16px;
  transition: border-color 0.3s, opacity 0.3s;
  overflow: hidden;
}

.step-card.active {
  border-color: var(--card-border-active);
}

.step-card.complete {
  border-color: var(--success-border);
}

.step-card.locked {
  opacity: 0.45;
  pointer-events: none;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 28px;
}

.step-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--step-num-bg);
  color: white;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.3s;
}

.step-card.complete .step-num {
  background: var(--step-complete-bg);
}

.step-title {
  font-size: 17px;
  font-weight: 600;
  flex: 1;
}

.step-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--step-complete-bg);
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-card.complete .step-check {
  display: flex;
}

.step-check svg {
  width: 12px;
  height: 12px;
  stroke: white;
  stroke-width: 3;
  fill: none;
}

.step-body {
  padding: 0 28px 24px;
}

/* ─── Step 1 — Location ──────────────────────────────── */

.address-input-wrap {
  position: relative;
}

.address-input-wrap input {
  width: 100%;
  background: rgba(15, 52, 96, 0.5);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 13px 16px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.address-input-wrap input:focus {
  border-color: var(--accent);
}

.address-input-wrap input::placeholder {
  color: var(--text-muted);
}

.manual-toggle {
  margin-top: 10px;
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
  text-decoration: none;
}

.manual-toggle:hover {
  text-decoration: underline;
}

.manual-toggle svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  transition: transform 0.2s;
}

.manual-toggle.open svg {
  transform: rotate(180deg);
}

.manual-fields {
  display: none;
  gap: 12px;
  margin-top: 12px;
}

.manual-fields.visible {
  display: flex;
}

.manual-field {
  flex: 1;
}

.manual-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.manual-field input {
  width: 100%;
  background: rgba(15,52,96,0.5);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 11px 14px;
  color: var(--text);
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.manual-field input:focus {
  border-color: var(--accent);
}

.manual-field input::placeholder {
  color: var(--text-disabled);
}

.location-confirm {
  background: rgba(15,52,96,0.5);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 14px;
  display: none;
}

.location-confirm.visible {
  display: block;
}

.location-confirm .formatted-addr {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 6px;
}

.location-confirm .coords {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--accent);
}

.use-location-btn {
  width: 100%;
  margin-top: 14px;
  padding: 13px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  display: none;
}

.use-location-btn.visible {
  display: block;
}

.use-location-btn:hover {
  background: var(--accent-hover);
}

.change-location-btn {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  font-family: 'DM Sans', sans-serif;
  padding: 0;
  display: none;
}

.change-location-btn:hover {
  color: var(--accent);
}

.change-location-btn.visible {
  display: inline-block;
}

/* ─── Step 2 — Upload ────────────────────────────────── */

.dropzone {
  border: 2px dashed var(--card-border);
  border-radius: 8px;
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(8,145,178,0.06);
}

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

.dropzone-icon {
  width: 40px;
  height: 40px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 1.5;
  margin: 0 auto 12px;
  display: block;
}

.dropzone-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.dropzone-hint {
  font-size: 13px;
  color: var(--text-muted);
}

.upload-errors {
  margin-top: 10px;
}

.upload-error-item {
  padding: 8px 12px;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: 6px;
  font-size: 13px;
  color: #fca5a5;
  margin-bottom: 6px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.photo-thumb {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: rgba(15,52,96,0.4);
}

.photo-thumb img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  display: block;
}

.photo-thumb .thumb-info {
  padding: 5px 7px;
}

.photo-thumb .thumb-name {
  font-size: 10px;
  font-family: 'Space Mono', monospace;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-thumb .thumb-size {
  font-size: 10px;
  color: var(--text-disabled);
  font-family: 'Space Mono', monospace;
}

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

.photo-thumb .thumb-remove:hover {
  background: var(--error);
}

.upload-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.upload-count {
  font-size: 13px;
  color: var(--text-muted);
}

.clear-all-btn {
  font-size: 13px;
  color: var(--error);
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  padding: 0;
}

.clear-all-btn:hover {
  text-decoration: underline;
}

/* ─── Step 3 — Geotag ────────────────────────────────── */

.geotag-btn {
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.geotag-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

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

.geotag-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

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

.progress-bar-wrap {
  margin-top: 16px;
  display: none;
}

.progress-bar-wrap.visible {
  display: block;
}

.progress-bar-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

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

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

.geotag-success {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--success);
  display: none;
  line-height: 1.5;
}

.geotag-success.visible {
  display: block;
}

.geotag-error {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: 8px;
  font-size: 14px;
  color: #fca5a5;
  display: none;
}

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

/* ─── SEO Info ───────────────────────────────────────── */

.seo-info {
  margin-top: 20px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  overflow: hidden;
}

.seo-info-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--card);
  border: none;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}

.seo-info-toggle:hover {
  color: var(--text);
}

.seo-info-toggle svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.seo-info-toggle.open svg {
  transform: rotate(180deg);
}

.seo-info-body {
  display: none;
  padding: 16px 20px 20px;
  background: var(--card);
  border-top: 1px solid var(--card-border);
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

.seo-info-body.visible {
  display: block;
}

/* ─── Footer ─────────────────────────────────────────── */

footer {
  text-align: center;
  margin-top: 40px;
  font-size: 13px;
  color: var(--text-muted);
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

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

.alert {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-top: 10px;
}

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

/* ─── Spinner ────────────────────────────────────────── */

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

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

@media (max-width: 500px) {
  .step-body, .step-header { padding-left: 18px; padding-right: 18px; }
  .manual-fields { flex-direction: column; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
}
