/* ═══════════════════════════════════════════
   HueCub — Upload Page Styles
   Design system v28: ink forest + signal red
   ═══════════════════════════════════════════ */

/* ── Layout ───────────────────────────────── */
.upload-main {
  min-height: calc(100vh - 64px);
  background: #FDFDFC;
  padding: 48px 0 80px;
}

.upload-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Header ───────────────────────────────── */
.upload-header {
  text-align: center;
  margin-bottom: 48px;
}

.upload-title {
  font-family: 'Nunito', 'Noto Sans SC', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: #0C2418;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.upload-subtitle {
  font-size: 1rem;
  color: #6B8F71;
  margin: 0;
  line-height: 1.6;
}

/* ── Form Steps ───────────────────────────── */
.form-step {
  background: #fff;
  border: 1px solid #D1DDD3;
  border-radius: 12px;
  padding: 32px 28px;
  margin-bottom: 20px;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.step-number {
  width: 32px;
  height: 32px;
  background: #047857;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.step-label {
  font-family: 'Nunito', 'Noto Sans SC', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0C2418;
}

/* ── Form Fields ──────────────────────────── */
.form-fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.form-label {
  font-family: 'Nunito', 'Noto Sans SC', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0C2418;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #D1DDD3;
  border-radius: 6px;
  font-family: 'Nunito', 'Noto Sans SC', sans-serif;
  font-size: 0.95rem;
  color: #0C2418;
  background: #FDFDFC;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #6B8F71;
  opacity: 0.7;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: #047857;
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.field-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}

.form-hint {
  font-size: 0.8rem;
  color: #6B8F71;
  line-height: 1.4;
}

.char-count {
  font-size: 0.78rem;
  color: #6B8F71;
  white-space: nowrap;
  margin-left: 8px;
  flex-shrink: 0;
}

/* ── Select wrapper ───────────────────────── */
.select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.select-wrapper .form-select {
  padding-right: 36px;
  cursor: pointer;
}

.select-arrow {
  position: absolute;
  right: 12px;
  pointer-events: none;
  flex-shrink: 0;
}

/* ── Checkbox ─────────────────────────────── */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.checkbox-input {
  display: none;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  border: 1.5px solid #D1DDD3;
  border-radius: 4px;
  background: #FDFDFC;
  flex-shrink: 0;
  margin-top: 2px;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}

.checkbox-input:checked + .checkbox-custom {
  background: #047857;
  border-color: #047857;
}

.checkbox-input:checked + .checkbox-custom::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 6px;
  height: 10px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.checkbox-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.checkbox-main {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0C2418;
}

/* ── Openness Cards ───────────────────────── */
.openness-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.openness-card {
  display: block;
  border: 2px solid #D1DDD3;
  border-radius: 10px;
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  background: #FDFDFC;
}

.openness-card:hover {
  border-color: #6B8F71;
}

.openness-card.selected {
  border-color: #047857;
  background: rgba(4, 120, 87, 0.03);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.08);
}

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

.card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.card-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-title {
  font-family: 'Nunito', 'Noto Sans SC', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0C2418;
}

.card-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.badge-green {
  background: rgba(4, 120, 87, 0.12);
  color: #047857;
}

.badge-gray {
  background: rgba(107, 143, 113, 0.12);
  color: #6B8F71;
}

.card-desc {
  font-size: 0.83rem;
  color: #6B8F71;
  line-height: 1.5;
  margin: 0 0 14px;
}

.card-rules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-rules li {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 0.82rem;
  color: #0C2418;
  line-height: 1.4;
}

.rule-icon {
  font-size: 0.78rem;
  flex-shrink: 0;
}

/* ── Drop Zone ────────────────────────────── */
.dropzone {
  position: relative;
  border: 2px dashed #D1DDD3;
  border-radius: 10px;
  padding: 52px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
  overflow: hidden;
}

.dropzone:hover {
  border-color: #047857;
  background: rgba(4, 120, 87, 0.02);
}

.dropzone.drag-over {
  border-color: #047857;
  background: rgba(4, 120, 87, 0.04);
}

.dropzone-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.dropzone-icon {
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: 4px;
}

.dropzone-text {
  font-family: 'Nunito', 'Noto Sans SC', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #0C2418;
  margin: 0;
}

.dropzone-hint {
  font-size: 0.82rem;
  color: #6B8F71;
  margin: 0 0 8px;
  line-height: 1.4;
}

.btn-select-file {
  display: inline-block;
  padding: 9px 24px;
  background: #FDFDFC;
  border: 1.5px solid #D1DDD3;
  border-radius: 6px;
  font-family: 'Nunito', 'Noto Sans SC', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0C2418;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-top: 4px;
  min-height: 44px;
}

.btn-select-file:hover {
  border-color: #047857;
  background: rgba(4, 120, 87, 0.03);
  color: #047857;
}

.dropzone-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(4, 120, 87, 0.08);
  border-radius: 8px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
}

.overlay-icon {
  font-size: 2.4rem;
}

.dropzone-overlay p {
  font-size: 1rem;
  font-weight: 600;
  color: #047857;
  margin: 0;
}

/* ── Preview Grid ─────────────────────────── */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.preview-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #D1DDD3;
  aspect-ratio: 1;
  background: #f5f5f4;
}

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

.preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(12, 36, 24, 0.6);
  color: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.15s;
}

.preview-remove:hover {
  background: #DC2626;
}

/* ── Submit Section ───────────────────────── */
.submit-step {
  background: none;
  border: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.btn-publish {
  display: inline-block;
  padding: 14px 56px;
  background: #DC2626;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: 'Nunito', 'Noto Sans SC', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  min-height: 50px;
  letter-spacing: 0.01em;
}

.btn-publish:hover:not(:disabled) {
  background: #b91c1c;
}

.btn-publish:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-publish:disabled {
  background: #D1DDD3;
  color: #6B8F71;
  cursor: not-allowed;
}

.submit-note {
  font-size: 0.8rem;
  color: #6B8F71;
  text-align: center;
  margin: 0;
  line-height: 1.5;
}

.submit-link {
  color: #047857;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Responsive ───────────────────────────── */
@media (max-width: 640px) {
  .upload-main {
    padding: 32px 0 64px;
  }

  .upload-title {
    font-size: 1.6rem;
  }

  .form-step {
    padding: 24px 16px;
  }

  .openness-grid {
    grid-template-columns: 1fr;
  }

  .dropzone {
    padding: 40px 16px;
  }

  .preview-grid {
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  }

  .btn-publish {
    width: 100%;
    text-align: center;
  }

  .step-label {
    font-size: 1rem;
  }
}
