/* ==========================================================================
   "Сусіди" — Comprehensive Hand-Drawn Editorial Design System 
   Zero Emojis, HEX Exact (#F5EFE6, #FBF8F2, #2B2118, #1F2A44, #8A7F72, #C9603B, #F3DCCB, #E4D9C8)
   ========================================================================== */

:root {
  --bg-app: #F5EFE6;
  --bg-card: #FBF8F2;
  --text-main: #2B2118;
  --text-navy: #1F2A44;
  --text-muted: #8A7F72;

  --accent-orange: #C9603B;
  --accent-orange-hover: #b04e2b;
  --accent-peach: #F3DCCB;
  --card-border: #E4D9C8;
  --error-color: #B23A2E;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Oswald', 'Archivo Black', 'Outfit', sans-serif;

  --shadow-paper: 0 1px 3px rgba(43, 33, 24, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
}

.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-app);
  padding-bottom: 80px;
  position: relative;
  border-left: 1px solid var(--card-border);
  border-right: 1px solid var(--card-border);
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-app);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px dashed var(--card-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-navy);
  text-transform: uppercase;
}

.header-stamp {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-orange);
  border: 3px double var(--accent-orange);
  padding: 2px 7px;
  border-radius: 2px;
  transform: rotate(-7deg);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--accent-peach);
  box-shadow: 1px 1px 0px rgba(201, 96, 59, 0.2);
}

.header-avatar-btn {
  background: none;
  border: none;
  cursor: pointer;
}

.header-avatar-img {
  width: 38px;
  height: 38px;
  border-radius: 8px; /* Square with smooth 8px corners matching mode cards */
  background: var(--accent-peach);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--card-border);
}

/* Content */
.app-content {
  padding: 16px;
  flex: 1;
}

.view-step {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hidden {
  display: none !important;
}

/* Hero Section */
.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--accent-orange);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-paper);
}

.hero-header-line h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-navy);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.hero-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.45;
}

.dotted-route-path {
  height: 2px;
  border-bottom: 2px dashed var(--accent-orange);
  margin-top: 14px;
  opacity: 0.6;
}

/* Mode Selection List */
.mode-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mode-row-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease-out;
  box-shadow: var(--shadow-paper);
}

.mode-row-card:hover {
  border-color: var(--accent-orange);
  transform: translateY(-1px);
}

.mode-icon-box {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: var(--accent-peach);
  color: var(--accent-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mode-info h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
  line-height: 1.25;
}

.mode-info p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.35;
}

.mode-arrow {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-orange);
}

/* Listing Paper Cards (Reference 1 Layout + Exact Theme Specs) */
.listing-paper-card {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-paper);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: border-color 0.15s ease-out;
}

.listing-paper-card:hover {
  border-color: var(--accent-orange);
}

.card-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price-tag-left {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  background: var(--accent-orange);
  padding: 4px 12px;
  border-radius: 4px 10px 4px 4px;
}

.compatibility-badge-right {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-orange);
  background: var(--accent-peach);
  padding: 5px 12px;
  border-radius: 999px; /* Capsule pill shape */
  display: flex;
  align-items: center;
  gap: 6px;
}

.location-line {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.listing-desc-text {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.45;
}

.btn-full-write {
  width: 100%;
  padding: 12px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  background: var(--accent-orange);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: background 0.15s ease-out;
}

.btn-full-write:hover {
  background: var(--accent-orange-hover);
}

/* Checklist Stat Picker (Boxes with Checkmarks) */
.checklist-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.checkbox-stat-picker {
  display: flex;
  gap: 6px;
}

.stat-box {
  flex: 1;
  padding: 10px 4px;
  background: var(--bg-app);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.stat-box.active {
  background: var(--accent-orange);
  color: #ffffff;
  border-color: var(--accent-orange);
}

/* Multi-step Form & Input Rows */
.paper-form {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-paper);
}

.wizard-step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.step-counter-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-orange);
}

.dotted-progress-bar {
  display: flex;
  gap: 6px;
  align-items: center;
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-orange);
}

.step-dot.active {
  background: var(--accent-orange);
}

.input-icon-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-app);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  margin-bottom: 12px;
}

.input-icon-row.textarea-row {
  align-items: flex-start;
}

.field-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.field-body {
  flex: 1;
}

.field-body label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2px;
  letter-spacing: 0.02em;
}

.field-body input, .field-body textarea {
  width: 100%;
  border: none;
  background: transparent;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  outline: none;
}

.wizard-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn-paper-next, .btn-paper-submit {
  flex: 1;
  padding: 13px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  background: var(--accent-orange);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.btn-paper-prev {
  padding: 13px 18px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  background: var(--bg-app);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  border-radius: 8px;
  cursor: pointer;
}

/* Filter Panel */
.paper-filter-panel {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-top-row {
  display: flex;
  gap: 8px;
}

.search-input-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-app);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 8px 12px;
}

.search-input-box input {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 13px;
  outline: none;
  color: var(--text-main);
}

.btn-reset {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-app);
  border: 1px solid var(--card-border);
  color: var(--accent-orange);
  border-radius: 8px;
  cursor: pointer;
}

.filter-dropdowns-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.filter-dropdowns-grid select {
  padding: 8px;
  font-size: 12.5px;
  background: var(--bg-app);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  color: var(--text-main);
}

/* Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: 480px;
  background: var(--bg-app);
  border-top: 2px dashed var(--card-border);
  display: flex;
  justify-content: space-around;
  padding: 8px;
  z-index: 200;
}

/* Hand-drawn Ruler Slider Component */
.stat-slider-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-orange);
  margin-left: 6px;
}

.stat-ruler-slider-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px dashed var(--card-border);
  border-radius: 8px;
}

.stat-ruler-input {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--card-border);
  outline: none;
}

.stat-ruler-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-orange);
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  cursor: pointer;
}

.stat-ruler-ticks {
  display: flex;
  justify-content: space-between;
  padding: 0 4px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  position: relative;
}

.nav-item.active {
  color: var(--accent-orange);
  font-weight: 700;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  top: -9px;
  width: 12px;
  height: 3px;
  background: var(--accent-orange);
  border-radius: 2px;
}

/* Modals & Empty State */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(43, 33, 24, 0.4);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: var(--bg-card);
  border: 2px solid var(--card-border);
  border-radius: 12px;
  padding: 20px;
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--bg-app);
  border: 1px solid var(--card-border);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-weight: 800;
  cursor: pointer;
}

.paper-empty-state {
  text-align: center;
  padding: 32px 16px;
  background: var(--bg-card);
  border: 1.5px dashed var(--card-border);
  border-radius: 12px;
}

.empty-illustration {
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
}
