/* ============================================================================
   Upload page styles. Self-contained — references no tokens from style.css.
   Aesthetic per STYLE.md: parchment + ink, Cinzel + Cormorant + IM Fell.
   ============================================================================ */

* { box-sizing: border-box; }

.upload-body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: #3a2e1f;
  background-color: #e8d5a8;
  background-image:
    radial-gradient(ellipse at center, transparent 40%, rgba(184, 153, 104, 0.28) 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence baseFrequency='0.85' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.12'/></svg>");
  padding: 40px 20px 80px;
  -webkit-font-smoothing: antialiased;
}

.upload-page {
  max-width: 720px;
  margin: 0 auto;
}

/* --- Header ---------------------------------------------------------------- */

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

.upload-eyebrow {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  color: #5c4a32;
  letter-spacing: 0.08em;
  font-size: 14px;
  margin-bottom: 8px;
}

.upload-title {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 36px;
  color: #3a2e1f;
  margin: 0 0 12px;
}

.upload-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #8a7556;
  font-size: 16px;
}
.upload-ornament .line {
  height: 1px;
  background: #8a7556;
  width: 80px;
}

.upload-back {
  display: inline-block;
  margin-top: 16px;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  color: #3a6478;
  text-decoration: none;
  border-bottom: 1px dashed #3a6478;
  padding-bottom: 2px;
}
.upload-back:hover { color: #4a7a8c; border-bottom-style: solid; }

/* --- Card (the framed parchment box) --------------------------------------- */

.upload-card {
  position: relative;
  background: rgba(241, 227, 191, 0.92);
  border: 1px solid #d4b896;
  padding: 36px 32px;
  margin-bottom: 24px;
  box-shadow: 0 2px 6px rgba(58, 46, 31, 0.18), inset 0 0 30px rgba(184, 153, 104, 0.18);
}
.upload-card::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px dashed #5c4a32;
  pointer-events: none;
}

/* --- Password gate --------------------------------------------------------- */

.upload-prompt {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  text-align: center;
  font-size: 18px;
  color: #5c4a32;
  margin: 0 0 16px;
  letter-spacing: 0.02em;
}

#upload-password,
.upload-item-caption {
  display: block;
  width: 100%;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 16px;
  padding: 12px 16px;
  background: #e8d5a8;
  border: 1px solid #d4b896;
  border-radius: 2px;
  color: #3a2e1f;
}
#upload-password { max-width: 320px; margin: 0 auto; text-align: center; letter-spacing: 0.2em; }
#upload-password:focus,
.upload-item-caption:focus {
  outline: none;
  border-color: #4a7a8c;
  box-shadow: 0 0 0 1px #4a7a8c;
}

/* --- Buttons --------------------------------------------------------------- */

#password-confirm,
.upload-pick-btn,
.upload-submit-btn {
  display: block;
  margin-top: 20px;
  margin-left: auto;
  margin-right: auto;
  padding: 12px 32px;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 13px;
  background: #f1e3bf;
  border: 1px solid #5c4a32;
  border-radius: 2px;
  color: #3a2e1f;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.upload-submit-btn { width: 100%; margin-top: 24px; padding: 16px; font-size: 14px; }
#password-confirm:hover:not(:disabled),
.upload-pick-btn:hover,
.upload-submit-btn:hover:not(:disabled) {
  background: #7ba3b3;
  color: #f1e3bf;
}
#password-confirm:disabled,
.upload-submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.error {
  color: #8b3a2a;
  font-style: italic;
  text-align: center;
  margin: 12px 0 0;
  min-height: 1.2em;
  font-family: 'IM Fell English', serif;
  font-size: 14px;
}

/* --- Who-am-I selector ----------------------------------------------------- */

.who-am-i {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 24px;
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 16px;
  color: #5c4a32;
}
.who-am-i label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.who-label { letter-spacing: 0.05em; font-style: normal; }

/* --- Dropzone -------------------------------------------------------------- */

.dropzone {
  border: 2px dashed #b89968;
  background: rgba(232, 213, 168, 0.4);
  padding: 36px 24px;
  text-align: center;
  margin-bottom: 20px;
  transition: background 150ms ease, border-color 150ms ease;
}
.dropzone.hover {
  background: rgba(123, 163, 179, 0.18);
  border-color: #4a7a8c;
}
.dropzone-prompt {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 18px;
  color: #5c4a32;
  margin: 0 0 12px;
}
.dropzone-hint {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 13px;
  color: #8a7556;
  margin: 12px 0 0;
}

/* --- File list ------------------------------------------------------------- */

.upload-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.upload-item {
  border-top: 1px dashed #d4b896;
  padding: 16px 0;
}
.upload-item:first-child { border-top: none; padding-top: 0; }

.upload-item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.upload-item-name {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.05em;
  color: #3a2e1f;
  word-break: break-all;
}
.upload-item-status {
  font-family: 'IM Fell English', serif;
  font-size: 13px;
  color: #5c4a32;
  white-space: nowrap;
  font-style: italic;
}

.upload-item.status-ready    .upload-item-status { color: #6b7548; }
.upload-item.status-uploading .upload-item-status { color: #3a6478; }
.upload-item.status-uploaded .upload-item-status { color: #6b7548; font-weight: 600; }
.upload-item.status-error    .upload-item-status { color: #8b3a2a; }

.upload-item-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  margin: 6px 0 10px;
  font-family: 'IM Fell English', serif;
  font-size: 13px;
  color: #5c4a32;
}
.upload-item-meta .muted { color: #8a7556; font-style: italic; }

.upload-item-coords {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.coord-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'IM Fell English', serif;
  font-size: 12px;
  color: #5c4a32;
  letter-spacing: 0.05em;
}
.coord-input {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 13px;
  color: #3a2e1f;
  background: #e8d5a8;
  border: 1px solid #d4b896;
  border-radius: 2px;
  padding: 4px 8px;
  width: 110px;
}
.coord-input:focus {
  outline: none;
  border-color: #4a7a8c;
  box-shadow: 0 0 0 1px #4a7a8c;
}
.coord-input:disabled {
  background: rgba(232, 213, 168, 0.4);
  color: #8a7556;
}
.coord-hint {
  font-style: italic;
  font-size: 12px;
}

.upload-item-caption:disabled {
  background: rgba(232, 213, 168, 0.4);
  color: #8a7556;
}

.upload-summary {
  margin: 16px 0 0;
  text-align: center;
  font-family: 'IM Fell English', serif;
  font-style: italic;
  color: #5c4a32;
}
.upload-summary a {
  color: #3a6478;
  border-bottom: 1px dashed #3a6478;
  text-decoration: none;
}

/* --- Misc ------------------------------------------------------------------ */

.hidden { display: none !important; }

@media (max-width: 600px) {
  .upload-title { font-size: 28px; }
  .upload-card { padding: 28px 20px; }
}
