/* ============================================================
   ModelDirectory.org — Upload Page Styles
   ============================================================ */

.page-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  padding: 40px 0 32px;
}
.page-header h1 { font-size: 1.8rem; margin-bottom: 8px; }
.page-header p  { color: var(--text-2); font-size: 0.95rem; max-width: 520px; }

/* ── Layout ── */
.upload-page { padding: 40px 0 80px; }
.upload-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}

/* ── Steps ── */
.upload-step {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}

.step-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
}
.step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid rgba(59,130,246,.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; flex-shrink: 0;
}
.step-header h2 { font-size: 1rem; font-weight: 600; }
.step-optional {
  font-size: 0.72rem; font-weight: 500; color: var(--text-3);
  background: var(--bg-4); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 4px; margin-left: 6px;
  vertical-align: middle;
}

/* ── Drop Zone ── */
.drop-zone {
  border: 2px dashed var(--border-2);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition), background var(--transition);
  cursor: pointer;
  overflow: hidden;
}
.drop-zone:not(.has-file):hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.drop-zone-inner {
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 24px; gap: 6px; text-align: center;
}
.drop-icon {
  width: 52px; height: 52px; color: var(--text-3);
  margin-bottom: 8px; transition: color var(--transition);
}
.drop-zone:not(.has-file):hover .drop-icon,
.drop-zone.drag-over .drop-icon { color: var(--accent); }

.drop-title {
  font-size: 0.95rem; font-weight: 600; color: var(--text);
}
.drop-sub { font-size: 0.85rem; color: var(--text-3); }
.drop-browse-btn {
  color: var(--accent); font-size: 0.85rem; font-weight: 500;
  text-decoration: underline; text-underline-offset: 2px;
  transition: color var(--transition);
}
.drop-browse-btn:hover { color: var(--accent-h); }
.drop-formats {
  font-size: 0.75rem; color: var(--text-3);
  margin-top: 4px; letter-spacing: 0.02em;
}

/* Selected state */
.drop-zone-selected {
  padding: 20px 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.selected-file-info {
  display: flex; align-items: center; gap: 12px;
}
.selected-icon { width: 28px; height: 28px; color: var(--accent); flex-shrink: 0; }
.selected-name {
  display: block; font-size: 0.9rem; font-weight: 600; color: var(--text);
}
.selected-size { font-size: 0.78rem; color: var(--text-3); }

.selected-hash-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 12px;
}
.hash-label {
  font-size: 0.72rem; color: var(--text-3); white-space: nowrap;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
}
.hash-value {
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--green);
  word-break: break-all;
}
.change-file-btn {
  align-self: flex-start;
  font-size: 0.8rem; color: var(--text-3);
  text-decoration: underline; text-underline-offset: 2px;
  transition: color var(--transition);
}
.change-file-btn:hover { color: var(--text-2); }

/* Progress bar */
.upload-progress {
  margin-top: 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.progress-bar-wrap {
  height: 6px; background: var(--bg-4);
  border-radius: 999px; overflow: hidden;
}
.progress-bar {
  height: 100%; background: var(--accent);
  border-radius: 999px;
  transition: width .3s ease;
}
.progress-labels {
  display: flex; justify-content: space-between;
  font-size: 0.78rem; color: var(--text-3);
}
.progress-slow-hint {
  font-size: 0.76rem; color: var(--text-3);
  margin-top: 2px;
}

/* Shimmer while uploading */
@keyframes progress-shimmer {
  0%   { background-position:  200% center; }
  100% { background-position: -200% center; }
}
.progress-bar-wrap.active .progress-bar {
  background-image: linear-gradient(90deg, var(--accent), #93c5fd, var(--accent));
  background-size: 200% 100%;
  animation: progress-shimmer 1.8s ease-in-out infinite;
  transition: none;
}

/* Spinning ring for submit button */
@keyframes md-spin {
  to { transform: rotate(360deg); }
}
.btn-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: md-spin .7s linear infinite;
  flex-shrink: 0;
  vertical-align: middle;
}

/* ── Form ── */
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }

label {
  font-size: 0.82rem; font-weight: 600; color: var(--text-2);
}
.req { color: var(--accent); }

textarea {
  font-family: var(--font);
  background: var(--bg-3); border: 1px solid var(--border-2);
  border-radius: var(--radius); color: var(--text);
  font-size: 0.9rem; padding: 10px 14px;
  outline: none; resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
}
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
textarea::placeholder { color: var(--text-3); }

.field-hint {
  font-size: 0.75rem; color: var(--text-3);
}
.char-count { text-align: right; }

/* ── License Grid ── */
.license-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 20px;
}
.license-card { cursor: pointer; }
.license-card input[type="radio"] { display: none; }
.license-card-inner {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--bg-3); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  transition: all var(--transition);
}
.license-card:hover .license-card-inner {
  border-color: var(--border-2); background: var(--bg-4);
}
.license-card input:checked + .license-card-inner {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.license-name { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.license-desc { font-size: 0.75rem; color: var(--text-3); line-height: 1.4; }
.license-badge {
  font-size: 0.68rem; font-weight: 600; padding: 1px 7px;
  border-radius: 3px; align-self: flex-start; margin-top: 2px;
}
.license-badge.cc0 {
  background: var(--green-dim); color: var(--green);
  border: 1px solid rgba(16,185,129,.25);
}

/* Rights assertion */
.rights-assertion { display: flex; flex-direction: column; gap: 10px; }
.checkbox-label {
  display: flex; align-items: flex-start; gap: 10px;
  cursor: pointer; font-size: 0.83rem; color: var(--text-2); line-height: 1.5;
}
.checkbox-label input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; accent-color: var(--accent); }
.checkbox-label a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ── Provenance ── */
.provenance-toggle-wrap {
  display: flex; align-items: flex-start; gap: 14px;
  margin-bottom: 16px;
}
.toggle-switch {
  position: relative; width: 44px; height: 24px; flex-shrink: 0; cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--bg-4);
  border: 1px solid var(--border-2); border-radius: 999px;
  transition: all var(--transition);
}
.toggle-slider::before {
  content: ''; position: absolute; left: 3px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  background: var(--text-3); border-radius: 50%;
  transition: all var(--transition);
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { background: #fff; transform: translateY(-50%) translateX(20px); }

.toggle-label { font-size: 0.88rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.toggle-sub { font-size: 0.78rem; color: var(--text-3); line-height: 1.5; }

.chain-select-wrap {
  display: flex; align-items: center; gap: 10px;
}
.chain-select-wrap label { font-size: 0.82rem; color: var(--text-3); white-space: nowrap; }
.chain-select-wrap select { max-width: 280px; }

/* ── Submit ── */
.upload-submit-row {
  display: flex; flex-direction: column; gap: 10px;
  align-items: flex-start;
}
.btn-submit {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 32px !important; font-size: 0.95rem !important;
}
.btn-submit:disabled {
  opacity: .45; cursor: not-allowed; transform: none !important;
}
.submit-note { font-size: 0.78rem; color: var(--text-3); max-width: 440px; line-height: 1.5; }

/* ════════════════════════════════════════
   SIDEBAR
════════════════════════════════════════ */
.upload-sidebar {
  position: sticky; top: 76px;
  display: flex; flex-direction: column; gap: 12px;
}
.sidebar-info-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
}
.sidebar-info-card h3 {
  font-size: 0.88rem; margin-bottom: 14px; color: var(--text);
}
.info-card-subtle { background: var(--bg); }
.info-card-subtle p { font-size: 0.82rem; color: var(--text-3); line-height: 1.6; }
.info-card-subtle a { color: var(--accent); }

/* Steps list */
.upload-steps-list {
  list-style: none; display: flex; flex-direction: column; gap: 14px;
}
.upload-steps-list li {
  display: flex; gap: 10px; align-items: flex-start;
}
.step-dot {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg-4); border: 1px solid var(--border-2);
  color: var(--text-3); font-size: 0.7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  margin-top: 1px;
}
.upload-steps-list strong { display: block; font-size: 0.82rem; color: var(--text); margin-bottom: 2px; }
.upload-steps-list p { font-size: 0.76rem; color: var(--text-3); line-height: 1.5; }

/* Formats */
.fmt-support-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.fmt-support-row { display: flex; align-items: center; gap: 10px; font-size: 0.8rem; color: var(--text-3); }
.fmt-tag {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  background: var(--bg-4); border: 1px solid var(--border);
  color: var(--text-3); padding: 2px 7px; border-radius: 4px;
  min-width: 46px; text-align: center; flex-shrink: 0;
}
.fmt-limit { font-size: 0.77rem; color: var(--text-3); }
.fmt-limit strong { color: var(--text-2); }

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 900px) {
  .upload-layout { grid-template-columns: 1fr; }
  .upload-sidebar { position: static; order: -1; }
  .license-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .upload-step { padding: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .license-grid { grid-template-columns: 1fr; }
  .chain-select-wrap { flex-direction: column; align-items: flex-start; }
}

/* ══════════════════════════════════════════════════════════════════
   Proof stamp cards — plan-card aesthetic (step 4)
   ══════════════════════════════════════════════════════════════════ */
.proof-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
  align-items: stretch;
}

/* Card wrapper — position relative for Recommended badge */
.proof-card {
  position: relative;
  cursor: pointer;
}

/* Recommended badge — same style as plan-card "Most Popular" */
.proof-card-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
  z-index: 1;
  pointer-events: none;
}

/* Inner card — flex column so price always sits at bottom */
.proof-card .license-card-inner {
  padding: 18px 16px 14px;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
  gap: 0;
  transition: border-color .2s, background .2s, box-shadow .2s;
}

/* Logo row */
.proof-card-logos {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
  line-height: 1;
}
.chain-offchain-logo { color: var(--text-3); }

/* Card title */
.proof-card-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
}

/* Card description */
.proof-card-desc {
  font-size: 0.74rem;
  color: var(--text-3);
  line-height: 1.45;
  flex: 1;
}

/* Price row — always at bottom */
.proof-card-price {
  margin-top: 12px;
  padding-top: 9px;
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  font-size: 0.79rem;
  font-weight: 700;
}
.proof-price-free { color: #10b981; }
.proof-price-t1   { color: var(--accent); }
.proof-price-t2   { color: var(--text-2); }

/* Pre-selected featured card border */
.proof-card-featured .license-card-inner {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-2));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent);
}

/* Radio-selected state via :has() */
.proof-card:has(input:checked) .license-card-inner {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-2));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent);
}

/* Hover on non-selected cards */
.proof-card:not(:has(input:checked)):hover .license-card-inner {
  border-color: var(--border-2);
  background: var(--bg-4);
}

/* Mobile: stack */
@media (max-width: 640px) {
  .proof-grid { grid-template-columns: 1fr; }
}

/* ── Credit exhaustion upgrade modal ── */
.upgrade-modal-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.upgrade-modal-box {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px 28px 24px;
  max-width: 440px; width: 100%; position: relative;
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
  animation: modalSlideUp .22s ease;
}
@keyframes modalSlideUp {
  from { transform: translateY(18px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.upgrade-modal-close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; cursor: pointer;
  font-size: 1.4rem; line-height: 1; color: var(--text-3);
  padding: 4px 8px; border-radius: 6px;
  transition: color .15s, background .15s;
}
.upgrade-modal-close:hover { color: var(--text); background: var(--bg-4); }

.upgrade-modal-header { text-align: center; margin-bottom: 20px; }
.upgrade-modal-icon {
  width: 38px; height: 38px; color: var(--accent);
  margin: 0 auto 12px; display: block;
}
.upgrade-modal-title {
  font-size: 1.15rem; font-weight: 700; margin: 0 0 8px;
  color: var(--text);
}
.upgrade-modal-sub {
  font-size: 0.83rem; color: var(--text-3); margin: 0; line-height: 1.5;
}

/* Stamped models list */
.upgrade-modal-stamped {
  background: var(--bg-3); border-radius: 10px; padding: 12px 14px;
  margin-bottom: 16px;
}
.upgrade-modal-stamped-label {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-3); margin: 0 0 8px;
}
.upgrade-modal-stamped-list {
  list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px;
}
.upgrade-modal-stamped-list li {
  display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--text-2);
}
.upgrade-modal-stamped-list li::before {
  content: '';
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: #8247E5;
}

/* Pro plan box */
.upgrade-modal-plan {
  border: 1px solid var(--accent); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 18px;
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-2));
}
.upgrade-modal-plan-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px;
}
.upgrade-modal-plan-name {
  font-size: 0.85rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--accent);
}
.upgrade-modal-plan-price {
  font-size: 1.5rem; font-weight: 800; color: var(--text);
}
.upgrade-modal-plan-period { font-size: 0.8rem; font-weight: 400; color: var(--text-3); }
.upgrade-modal-plan-perks {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 7px;
}
.upgrade-modal-plan-perks li {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; color: var(--text-2);
}
.upgrade-modal-plan-perks li svg { width: 15px; height: 15px; flex-shrink: 0; }

/* Action buttons */
.upgrade-modal-actions { display: flex; flex-direction: column; gap: 9px; }
.upgrade-modal-cta {
  display: block; text-align: center; padding: 12px;
  background: var(--accent); color: #fff; border-radius: 9px;
  font-size: 0.9rem; font-weight: 700; text-decoration: none;
  transition: opacity .15s;
}
.upgrade-modal-cta:hover { opacity: .88; color: #fff; }
.upgrade-modal-fallback {
  background: none; border: 1px solid var(--border); border-radius: 9px;
  padding: 10px; font-size: 0.82rem; color: var(--text-3); cursor: pointer;
  transition: border-color .15s, color .15s; width: 100%;
}
.upgrade-modal-fallback:hover { border-color: var(--border-2); color: var(--text-2); }


/* ── Bottom progress bar (in submit row) ── */
.upload-progress-bottom {
  width: 100%;
  margin-top: 0;
  margin-bottom: 4px;
}
