/* =========================================================
   PAYLANCE — Trade-In page (Обмен / Trade-In)
   Ported 1:1 from the "Trade-In Paylance" reference mockup.
   Self-contained: own class prefix .tiw- so it never collides
   with any older Trade-In styles.
   ========================================================= */

.tiw { font-family: 'Manrope', sans-serif; background: #EEF1F5; min-height: 100vh; }
.tiw *, .tiw *::before, .tiw *::after { box-sizing: border-box; }
.tiw input::placeholder, .tiw textarea::placeholder { color: #9AA1AC; }
.tiw-scroll::-webkit-scrollbar { height: 0; width: 0; }
@keyframes tiwIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes tiwOv { from { opacity: 0; } to { opacity: 1; } }

/* ---------- hero ---------- */
.tiw-hero { background: radial-gradient(125% 95% at 16% 18%, #17293F 0%, #0D1826 52%, #080B11 100%); padding: 56px 40px 64px; }
.tiw-hero-inner { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 1.02fr 0.98fr; gap: 56px; align-items: center; }
.tiw-hero-left { display: flex; flex-direction: column; gap: 26px; }
.tiw-badge {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 9px; padding: 9px 15px;
  border-radius: 999px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  color: #B9C4D2; font-size: 12.5px; font-weight: 700; letter-spacing: .14em;
}
.tiw-mode-toggle { align-self: flex-start; display: flex; gap: 5px; padding: 5px; border-radius: 15px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); }
.tiw-seg-btn {
  font-family: 'Manrope', sans-serif; padding: 11px 20px; border-radius: 11px; border: none; cursor: pointer;
  font-size: 14.5px; font-weight: 700; transition: all .15s; background: transparent; color: #AEB9C6;
}
.tiw-seg-btn.active { background: #fff; color: #14161A; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.tiw-h1 { margin: 0; font-size: 60px; line-height: 1.03; font-weight: 800; letter-spacing: -.025em; color: #EAF0F7; }
.tiw-h1 span { color: #3B82F6; }
.tiw-sub { margin: 0; max-width: 460px; font-size: 18px; line-height: 1.55; color: #9DA9B7; font-weight: 500; }
.tiw-chips { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.tiw-chip {
  display: inline-flex; align-items: center; gap: 9px; padding: 11px 17px; border-radius: 12px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); color: #CDD6E0;
  font-size: 14.5px; font-weight: 600;
}

/* ---------- shared card (sell / swap composer) ---------- */
.tiw-card { background: #fff; border-radius: 26px; padding: 30px; box-shadow: 0 30px 70px rgba(0,0,0,.4); animation: tiwIn .35s ease; }
.tiw-card-head { display: flex; align-items: center; gap: 13px; margin-bottom: 26px; }
.tiw-card-icon { width: 44px; height: 44px; border-radius: 13px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.tiw-card-icon--gray { background: #EDF1F6; }
.tiw-card-icon--blue { background: #E8F0FE; }
.tiw-card-title { font-size: 21px; font-weight: 800; color: #14161A; }
.tiw-card-head-col { display: flex; flex-direction: column; }
.tiw-card-sub { font-size: 13.5px; color: #8A93A0; font-weight: 500; }

.tiw-field-label { font-size: 12px; font-weight: 800; letter-spacing: .1em; color: #98A1AD; margin-bottom: 11px; }
.tiw-opt-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.tiw-opt-row--tight { margin-bottom: 12px; }
.tiw-opt {
  font-family: 'Manrope', sans-serif; padding: 10px 16px; border-radius: 11px; cursor: pointer;
  font-size: 14px; font-weight: 600; transition: all .13s; border: 1.5px solid #E7EAEF; background: #F2F4F6; color: #3A414B;
}
.tiw-opt.active { border-color: #2E6BE6; background: #E8F0FE; color: #2E6BE6; }

.tiw-estimate-box { background: #F5F6F8; border-radius: 18px; padding: 24px; text-align: center; }
.tiw-estimate-label { font-size: 12px; font-weight: 800; letter-spacing: .1em; color: #98A1AD; }
.tiw-estimate-price { font-size: 44px; font-weight: 800; color: #14161A; letter-spacing: -.02em; margin: 8px 0; }
.tiw-estimate-note { font-size: 14px; color: #8A93A0; font-weight: 500; }
.tiw-estimate-btn {
  width: 100%; margin-top: 20px; padding: 17px; border: none; border-radius: 14px; background: #14161A;
  color: #fff; font-family: 'Manrope', sans-serif; font-size: 16px; font-weight: 700; cursor: pointer;
}

/* ---------- swap composer ---------- */
.tiw-swap-input {
  width: 100%; padding: 14px 16px; border-radius: 13px; border: 1.5px solid #E4E7EC; background: #F8F9FB;
  font-family: 'Manrope', sans-serif; font-size: 15px; font-weight: 600; color: #14161A; outline: none; margin-bottom: 10px;
}
.tiw-swap-input--want { margin-bottom: 22px; }
.tiw-swap-arrow-wrap { display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.tiw-swap-arrow { width: 38px; height: 38px; border-radius: 50%; background: #F2F4F6; display: flex; align-items: center; justify-content: center; }
.tiw-amount-input {
  width: 100%; padding: 14px 16px; border-radius: 13px; border: 1.5px solid #E4E7EC; background: #F8F9FB;
  font-family: 'Manrope', sans-serif; font-size: 15px; font-weight: 700; color: #14161A; outline: none; margin-bottom: 12px;
}
.tiw-submit-btn {
  width: 100%; margin-top: 8px; padding: 17px; border: none; border-radius: 14px; background: #2E6BE6;
  color: #fff; font-family: 'Manrope', sans-serif; font-size: 16px; font-weight: 700; cursor: pointer;
  box-shadow: 0 8px 22px rgba(46,107,230,.32); transition: opacity .15s;
}
.tiw-submit-btn:disabled { opacity: .75; cursor: default; }

/* ---------- content section (board / steps) ---------- */
.tiw-section { padding: 52px 40px 80px; }
.tiw-section-inner { max-width: 1240px; margin: 0 auto; }
.tiw-section-headrow { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.tiw-h2 { margin: 0 0 6px; font-size: 30px; font-weight: 800; color: #14161A; letter-spacing: -.02em; }
.tiw-section-desc { margin: 0; font-size: 15px; color: #6B7480; font-weight: 500; }
.tiw-count { font-size: 14px; color: #8A93A0; font-weight: 600; }

.tiw-board-filters { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 26px; }
.tiw-board-filters .tiw-opt { flex: 0 0 auto; }

.tiw-board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.tiw-listing { background: #fff; border: 1px solid #E7EAEF; border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.tiw-listing-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tiw-listing-user { display: flex; align-items: center; gap: 11px; }
.tiw-listing-avatar { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 14px; }
.tiw-listing-name { font-size: 14.5px; font-weight: 700; color: #14161A; }
.tiw-listing-meta { font-size: 12.5px; color: #8A93A0; font-weight: 500; }
.tiw-listing-rating { display: inline-flex; align-items: center; gap: 4px; padding: 5px 9px; border-radius: 9px; background: #FFF7E8; color: #B8860B; font-size: 12.5px; font-weight: 700; }
.tiw-listing-rows { display: flex; flex-direction: column; gap: 9px; }
.tiw-listing-row { display: flex; align-items: center; gap: 11px; padding: 13px 15px; border-radius: 14px; }
.tiw-listing-row--give { background: #F6F8FA; }
.tiw-listing-row--want { background: #EEF4FF; }
.tiw-listing-row-label { font-size: 11px; font-weight: 800; letter-spacing: .08em; flex: 0 0 52px; }
.tiw-listing-row--give .tiw-listing-row-label { color: #98A1AD; }
.tiw-listing-row--want .tiw-listing-row-label { color: #7C9BDB; }
.tiw-listing-row-value { flex: 1; font-size: 15px; font-weight: 700; color: #14161A; }
.tiw-cond-badge { flex: 0 0 auto; padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; }
.tiw-listing-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tiw-dop-badge { display: inline-flex; align-items: center; padding: 8px 13px; border-radius: 10px; font-size: 13.5px; font-weight: 700; }
.tiw-propose-btn { padding: 11px 18px; border: none; border-radius: 12px; background: #14161A; color: #fff; font-family: 'Manrope', sans-serif; font-size: 14px; font-weight: 700; cursor: pointer; }
.tiw-empty { grid-column: 1 / -1; padding: 40px; text-align: center; color: #8A93A0; background: #fff; border: 1px dashed #E7EAEF; border-radius: 16px; font-weight: 500; }

.tiw-swap-steps { margin-top: 36px; background: #fff; border: 1px solid #E7EAEF; border-radius: 20px; padding: 28px; display: grid; grid-template-columns: repeat(4,1fr); gap: 22px; }
.tiw-swap-step { display: flex; flex-direction: column; gap: 8px; }
.tiw-swap-step-num { width: 34px; height: 34px; border-radius: 10px; background: #E8F0FE; color: #2E6BE6; font-weight: 800; font-size: 15px; display: flex; align-items: center; justify-content: center; }
.tiw-swap-step-title { font-size: 15.5px; font-weight: 700; color: #14161A; }
.tiw-swap-step-text { font-size: 13.5px; color: #6B7480; font-weight: 500; line-height: 1.5; }

.tiw-sell-steps { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.tiw-sell-step { background: #fff; border: 1px solid #E7EAEF; border-radius: 20px; padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.tiw-sell-step-num { width: 38px; height: 38px; border-radius: 11px; background: #14161A; color: #fff; font-weight: 800; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.tiw-sell-step-title { font-size: 16px; font-weight: 700; color: #14161A; margin-top: 4px; }
.tiw-sell-step-text { font-size: 14px; color: #6B7480; font-weight: 500; line-height: 1.55; }

/* ---------- landing (promo / features / testimonials / faq / cta) ---------- */
.tiw-landing { padding: 0 40px; }
.tiw-landing-inner { max-width: 1240px; margin: 0 auto; }

.tiw-promo-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.tiw-promo-featured {
  position: relative; overflow: hidden; cursor: pointer; border-radius: 24px; padding: 44px;
  background: linear-gradient(115deg, #2E6BE6 0%, #1E4FB0 100%); display: flex; flex-direction: column; justify-content: center; gap: 14px;
}
.tiw-promo-blob-1 { position: absolute; right: -40px; top: -40px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.08); }
.tiw-promo-blob-2 { position: absolute; right: 40px; bottom: -60px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.06); }
.tiw-promo-tag { align-self: flex-start; padding: 7px 14px; border-radius: 999px; background: rgba(255,255,255,.18); color: #fff; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; position: relative; z-index: 1; }
.tiw-promo-title { margin: 0; font-size: 32px; font-weight: 800; color: #fff; letter-spacing: -.02em; line-height: 1.12; max-width: 420px; position: relative; z-index: 1; }
.tiw-promo-desc { margin: 0; font-size: 16px; color: rgba(255,255,255,.85); font-weight: 500; max-width: 400px; position: relative; z-index: 1; }
.tiw-promo-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 16px; font-weight: 700; color: #fff; position: relative; z-index: 1; }
.tiw-promo-stack { display: grid; grid-template-rows: 1fr 1fr; gap: 16px; }
.tiw-promo-small { cursor: pointer; border-radius: 24px; padding: 26px 28px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.tiw-promo-small--dark { background: #14161A; }
.tiw-promo-small--dark .tiw-promo-small-title { color: #fff; }
.tiw-promo-small--dark .tiw-promo-small-desc { color: #9AA6B4; }
.tiw-promo-small--dark .tiw-promo-small-link { color: #5B9BFF; }
.tiw-promo-small--light { background: #E8F0FE; }
.tiw-promo-small--light .tiw-promo-small-title { color: #14161A; }
.tiw-promo-small--light .tiw-promo-small-desc { color: #5A6472; }
.tiw-promo-small--light .tiw-promo-small-link { color: #2E6BE6; }
.tiw-promo-small-title { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.tiw-promo-small-desc { font-size: 14.5px; font-weight: 500; line-height: 1.5; }
.tiw-promo-small-link { margin-top: 4px; font-size: 14.5px; font-weight: 700; }

.tiw-features-head { margin-top: 64px; text-align: center; }
.tiw-features-head h2 { margin: 0 0 10px; font-size: 34px; font-weight: 800; color: #14161A; letter-spacing: -.025em; }
.tiw-features-head p { margin: 0 auto; max-width: 560px; font-size: 16px; color: #6B7480; font-weight: 500; line-height: 1.55; }
.tiw-features-grid { margin-top: 32px; display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.tiw-feature-card { background: #fff; border: 1px solid #E7EAEF; border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.tiw-feature-icon { width: 52px; height: 52px; border-radius: 15px; background: #E8F0FE; display: flex; align-items: center; justify-content: center; }
.tiw-feature-title { font-size: 19px; font-weight: 800; color: #14161A; }
.tiw-feature-desc { font-size: 14.5px; color: #6B7480; font-weight: 500; line-height: 1.55; }

.tiw-testimonials { margin-top: 64px; }
.tiw-testimonials h2 { margin: 0 0 28px; font-size: 34px; font-weight: 800; color: #14161A; letter-spacing: -.025em; }
.tiw-testimonials-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.tiw-testimonial { background: #fff; border: 1px solid #E7EAEF; border-radius: 20px; padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.tiw-stars { display: flex; gap: 2px; }
.tiw-testimonial-text { margin: 0; font-size: 15px; color: #3A414B; font-weight: 500; line-height: 1.6; }
.tiw-testimonial-foot { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.tiw-testimonial-avatar { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 15px; }
.tiw-testimonial-name { font-size: 14.5px; font-weight: 700; color: #14161A; }
.tiw-testimonial-city { font-size: 13px; color: #8A93A0; font-weight: 500; }

.tiw-faq { margin-top: 64px; }
.tiw-faq h2 { margin: 0 0 28px; font-size: 34px; font-weight: 800; color: #14161A; letter-spacing: -.025em; }
.tiw-faq-list { display: flex; flex-direction: column; gap: 12px; }
.tiw-faq-item { cursor: pointer; background: #fff; border: 1px solid #E7EAEF; border-radius: 16px; padding: 20px 22px; font-family: 'Manrope', sans-serif; }
.tiw-faq-row { display: flex; align-items: center; gap: 16px; }
.tiw-faq-q { flex: 1; font-size: 17px; font-weight: 700; color: #14161A; }
.tiw-faq-sign { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px; background: #F2F4F6; color: #14161A; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; transition: all .15s; }
.tiw-faq-item.open .tiw-faq-sign { background: #2E6BE6; color: #fff; }
.tiw-faq-answer { margin: 14px 0 0; font-size: 15px; color: #6B7480; font-weight: 500; line-height: 1.6; }

.tiw-final-cta { margin-top: 64px; background: radial-gradient(120% 140% at 85% 10%, #1D3350 0%, #0D1826 55%, #080B11 100%); border-radius: 26px; padding: 56px 48px; display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.tiw-final-cta-text { display: flex; flex-direction: column; gap: 12px; }
.tiw-final-cta-text h2 { margin: 0; font-size: 36px; font-weight: 800; color: #EAF0F7; letter-spacing: -.025em; line-height: 1.1; }
.tiw-final-cta-text p { margin: 0; max-width: 440px; font-size: 16px; color: #9DA9B7; font-weight: 500; line-height: 1.55; }
.tiw-final-cta-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.tiw-btn-primary { padding: 17px 30px; border: none; border-radius: 14px; background: #2E6BE6; color: #fff; font-family: 'Manrope', sans-serif; font-size: 16px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 22px rgba(46,107,230,.36); }
.tiw-btn-outline { padding: 17px 30px; border-radius: 14px; border: 1.5px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); color: #EAF0F7; font-family: 'Manrope', sans-serif; font-size: 16px; font-weight: 700; cursor: pointer; }

.tiw-spacer { height: 80px; }

/* ---------- propose-exchange modal ---------- */
.tiw-modal-overlay {
  position: fixed; inset: 0; background: rgba(8,11,17,.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 200;
  animation: tiwOv .18s ease; font-family: 'Manrope', sans-serif;
}
.tiw-modal { position: relative; width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto; background: #fff; border-radius: 24px; padding: 28px; animation: tiwIn .22s ease; }
.tiw-modal-close { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 50%; border: none; background: #F2F4F6; color: #14161A; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.tiw-modal-title { font-size: 22px; font-weight: 800; color: #14161A; letter-spacing: -.01em; margin-bottom: 4px; }
.tiw-modal-sub { font-size: 14px; color: #8A93A0; font-weight: 500; margin-bottom: 22px; }
.tiw-modal-sub b { color: #14161A; }
.tiw-modal-opts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.tiw-modal-opts .tiw-opt { text-align: left; width: 100%; }
.tiw-modal-textarea {
  width: 100%; min-height: 88px; resize: vertical; padding: 13px 15px; border-radius: 12px; border: 1.5px solid #E4E7EC;
  background: #F8F9FB; font-family: 'Manrope', sans-serif; font-size: 14.5px; font-weight: 500; color: #14161A; outline: none; margin-bottom: 22px;
}
.tiw-modal-input {
  width: 100%; padding: 13px 15px; border-radius: 12px; border: 1.5px solid #E4E7EC; background: #F8F9FB;
  font-family: 'Manrope', sans-serif; font-size: 15px; font-weight: 700; color: #14161A; outline: none; margin-bottom: 16px;
}
.tiw-modal-actions { display: flex; gap: 10px; }
.tiw-modal-cancel { flex: 0 0 auto; padding: 14px 22px; border-radius: 13px; border: 1.5px solid #E4E7EC; background: #fff; color: #14161A; font-family: 'Manrope', sans-serif; font-size: 15px; font-weight: 700; cursor: pointer; }
.tiw-modal-submit { flex: 1; padding: 14px; border: none; border-radius: 13px; background: #2E6BE6; color: #fff; font-family: 'Manrope', sans-serif; font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 20px rgba(46,107,230,.3); }
.tiw-modal-success { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; padding: 14px 6px; }
.tiw-modal-success-icon { width: 64px; height: 64px; border-radius: 50%; background: #E6F7EF; display: flex; align-items: center; justify-content: center; }
.tiw-modal-success-title { font-size: 22px; font-weight: 800; color: #14161A; }
.tiw-modal-success-text { font-size: 14.5px; color: #6B7480; font-weight: 500; line-height: 1.55; max-width: 360px; }
.tiw-modal-success-btn { margin-top: 6px; padding: 14px 28px; border: none; border-radius: 13px; background: #14161A; color: #fff; font-family: 'Manrope', sans-serif; font-size: 15px; font-weight: 700; cursor: pointer; }

@media (max-width: 980px) {
  .tiw-hero-inner { grid-template-columns: 1fr; }
  .tiw-h1 { font-size: 44px; }
  .tiw-promo-grid { grid-template-columns: 1fr; }
  .tiw-swap-steps, .tiw-sell-steps { grid-template-columns: repeat(2,1fr); }
  .tiw-features-grid, .tiw-testimonials-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .tiw-hero { padding: 40px 20px 48px; }
  .tiw-section, .tiw-landing { padding-left: 20px; padding-right: 20px; }
  .tiw-h1 { font-size: 34px; }
  .tiw-opt-row { gap: 8px; }
  .tiw-swap-steps, .tiw-sell-steps { grid-template-columns: 1fr; }
  .tiw-final-cta { padding: 36px 26px; }
  .tiw-final-cta-btns { width: 100%; }
  .tiw-final-cta-btns button { flex: 1; }
}
