*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --navy:     #0B1D3E;
  --blue:     #1A56DB;
  --orange:   #E85D26;
  --white:    #FFFFFF;
  --gray-50:  #F8F9FB;
  --gray-100: #F0F2F5;
  --gray-200: #E2E6ED;
  --gray-300: #CDD3DC;
  --gray-400: #9AA3B0;
  --gray-600: #5A6478;
  --gray-800: #1E2533;
  --green:    #059669;
  --red:      #DC2626;
  --radius:   12px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.07);
  --shadow-md: 0 4px 16px rgba(0,0,0,.11);
  --font:     'Inter', sans-serif;
  --font-d:   'Manrope', sans-serif;
  --t:        .2s ease;
}
html, body { height: 100%; font-family: var(--font); -webkit-font-smoothing: antialiased; color: var(--gray-800); }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ── WRAPPER ─────────────────────────────────── */
.sell-wrapper { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }

/* ── LEFT PANEL ──────────────────────────────── */
.sell-left {
  background: var(--navy); position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 48px 52px;
}
.sell-left-inner { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 40px; max-width: 400px; width: 100%; }
.sell-logo img { height: 44px; width: auto; filter: brightness(0) invert(1); }
.sell-hero-text h2 { font-family: var(--font-d); font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 800; color: white; line-height: 1.2; letter-spacing: -.3px; margin-bottom: 12px; }
.sell-hero-text h2 span { color: #60A5FA; }
.sell-hero-text p { color: rgba(255,255,255,.6); font-size: .95rem; line-height: 1.7; }
.sell-steps { display: flex; flex-direction: column; gap: 20px; }
.sell-step { display: flex; align-items: flex-start; gap: 14px; }
.step-num { width: 32px; height: 32px; border-radius: 50%; background: rgba(26,86,219,.3); border: 1.5px solid rgba(26,86,219,.6); color: #60A5FA; font-weight: 800; font-size: .85rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.step-title { font-weight: 700; font-size: .9rem; color: white; margin-bottom: 2px; }
.step-sub { font-size: .78rem; color: rgba(255,255,255,.45); }
.sell-deco-1 { position: absolute; width: 400px; height: 400px; border-radius: 50%; background: rgba(26,86,219,.1); top: -140px; right: -140px; }
.sell-deco-2 { position: absolute; width: 220px; height: 220px; border-radius: 50%; background: rgba(232,93,38,.08); bottom: -60px; left: -60px; }

/* ── RIGHT PANEL ─────────────────────────────── */
.sell-right { background: var(--white); overflow-y: auto; display: flex; align-items: flex-start; justify-content: center; padding: 48px 40px; }
.sell-right-inner { width: 100%; max-width: 480px; }
.sell-form-header { margin-bottom: 28px; }
.back-link { display: inline-flex; align-items: center; gap: 5px; color: var(--gray-400); font-size: .82rem; font-weight: 500; margin-bottom: 16px; transition: color var(--t); }
.back-link:hover { color: var(--blue); }
.sell-title { font-family: var(--font-d); font-size: 1.6rem; font-weight: 800; color: var(--gray-800); letter-spacing: -.3px; margin-bottom: 5px; }
.sell-sub { color: var(--gray-400); font-size: .875rem; }

/* ── FORM ELEMENTS ───────────────────────────── */
.sell-form { display: flex; flex-direction: column; gap: 0; }
.form-group { margin-bottom: 22px; }
.form-label { font-size: .8rem; font-weight: 600; color: var(--gray-600); margin-bottom: 8px; display: block; letter-spacing: .01em; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 13px; color: var(--gray-400); display: flex; align-items: center; pointer-events: none; }
.form-input {
  width: 100%; border: 1.5px solid var(--gray-200); border-radius: 9px;
  padding: 11px 14px 11px 40px; font-family: var(--font); font-size: .875rem;
  color: var(--gray-800); background: var(--white); outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.form-input::placeholder { color: var(--gray-400); }
.form-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,86,219,.1); }
.form-input.error { border-color: var(--red); box-shadow: 0 0 0 3px rgba(220,38,38,.08); }
.input-prefix .form-input { padding-left: 32px; }
.input-pre { position: absolute; left: 13px; color: var(--gray-600); font-weight: 600; font-size: .9rem; }
.char-count { position: absolute; right: 12px; font-size: .7rem; color: var(--gray-400); }
.form-textarea {
  width: 100%; border: 1.5px solid var(--gray-200); border-radius: 9px;
  padding: 11px 14px; font-family: var(--font); font-size: .875rem;
  color: var(--gray-800); background: var(--white); outline: none; resize: vertical;
  transition: border-color var(--t), box-shadow var(--t); min-height: 100px;
}
.form-textarea::placeholder { color: var(--gray-400); }
.form-textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,86,219,.1); }
.form-textarea.error { border-color: var(--red); }
.textarea-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.textarea-footer .char-count { position: static; }
.field-error { font-size: .75rem; color: var(--red); min-height: 16px; display: block; margin-top: 5px; }

/* Category grid */
.cat-select-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 8px; }
.cat-select-card { cursor: pointer; }
.cat-select-card input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.cat-inner {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 12px 8px; border: 1.5px solid var(--gray-200); border-radius: 10px;
  font-size: .76rem; font-weight: 600; color: var(--gray-600);
  transition: all var(--t); text-align: center;
}
.cat-select-card input:checked + .cat-inner { border-color: var(--blue); background: rgba(26,86,219,.05); color: var(--blue); box-shadow: 0 0 0 3px rgba(26,86,219,.1); }
.cat-select-card input:checked + .cat-inner svg { color: var(--blue); }

/* Condition row */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cond-card { cursor: pointer; }
.cond-card input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.cond-inner {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border: 1.5px solid var(--gray-200); border-radius: 20px;
  font-size: .82rem; font-weight: 600; color: var(--gray-600);
  transition: all var(--t);
}
.cond-card input:checked + .cond-inner { border-color: var(--blue); background: rgba(26,86,219,.05); color: var(--blue); }
.cond-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Photo upload */
.photo-upload-area {
  border: 2px dashed var(--gray-200); border-radius: 10px;
  padding: 0; min-height: 120px; cursor: pointer;
  transition: border-color var(--t), background var(--t);
  overflow: hidden;
}
.photo-upload-area:hover { border-color: var(--blue); background: rgba(26,86,219,.02); }
.photo-upload-prompt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 28px 20px; color: var(--gray-400); font-size: .82rem; }
.photo-upload-prompt span:first-of-type { font-weight: 600; color: var(--gray-600); }
.photo-sub { font-size: .72rem; }
.photo-preview-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 10px; }
.photo-thumb { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb-remove {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.55);
  color: white; display: flex; align-items: center; justify-content: center;
  font-size: .75rem; line-height: 1; transition: background var(--t);
}
.photo-thumb-remove:hover { background: rgba(220,38,38,.8); }

/* Submit */
.btn-submit-listing {
  width: 100%; background: var(--blue); color: white; font-size: .95rem; font-weight: 700;
  padding: 14px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  gap: 8px; transition: opacity var(--t), transform var(--t); margin-top: 8px;
}
.btn-submit-listing:hover { opacity: .88; }
.btn-submit-listing:active { transform: scale(.99); }
.btn-spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.sell-note { margin-top: 14px; font-size: .76rem; color: var(--gray-400); line-height: 1.6; text-align: center; }
.sell-note a { color: var(--blue); }

/* ── SUCCESS OVERLAY ─────────────────────────── */
.success-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  z-index: 500; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.success-overlay.show { opacity: 1; pointer-events: auto; }
.success-card {
  background: var(--white); border-radius: 20px; padding: 40px 36px;
  text-align: center; max-width: 380px; width: calc(100% - 40px);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  transform: translateY(16px); transition: transform .3s;
}
.success-overlay.show .success-card { transform: translateY(0); }
.success-icon { margin: 0 auto 18px; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; }
.success-title { font-family: var(--font-d); font-size: 1.4rem; font-weight: 800; color: var(--gray-800); margin-bottom: 8px; }
.success-sub { color: var(--gray-400); font-size: .875rem; line-height: 1.7; margin-bottom: 24px; }
.btn-go-market {
  display: inline-block; background: var(--blue); color: white;
  font-weight: 700; font-size: .9rem; padding: 12px 28px; border-radius: 10px;
  transition: opacity var(--t);
}
.btn-go-market:hover { opacity: .88; }

/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 820px) {
  .sell-wrapper { grid-template-columns: 1fr; }
  .sell-left { padding: 36px 28px; min-height: auto; }
  .sell-right { padding: 32px 24px; }
}
@media (max-width: 480px) {
  .cat-select-grid { grid-template-columns: repeat(2, 1fr); }
  .chip-row { gap: 6px; }
  .photo-preview-grid { grid-template-columns: repeat(4, 1fr); }
}