/* ================================================================
   WIZ — Listing Entry + Demand Wizard
   iOS-style, flat, zero nested borders
   ================================================================ */

/* ---- Variables ---- */
:root {
  --wiz-accent:   #1aa677;
  --wiz-primary:  #04243c;
  --wiz-border:   #e0e0e2;
  --wiz-bg-input: #fafafa;
  --wiz-text:     #1c1c1e;
  --wiz-muted:    #8e8e93;
  --wiz-radius:   10px;
  --wiz-error:    #d93025;
}

/* ================================================================
   PAGE LAYOUT — now uses generic .profile-page from main.css
   ================================================================ */

/* ================================================================
   WIZ SCREEN — the main form container
   ================================================================ */
.wiz-screen {
  background: #fff;
  position: relative;
}

@media (max-width: 767px) {
  .wiz-screen {
    min-height: calc(100dvh - 56px);
    /* action bar ~64px + bottom-nav 68px */
    padding-bottom: calc(64px + 68px + env(safe-area-inset-bottom, 8px));
  }
}

@media (min-width: 768px) {
  .wiz-screen {
    background: #fff;
    border: 1px solid var(--wiz-border);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
  }
}

/* ================================================================
   PROGRESS BAR
   ================================================================ */
.wiz-progress {
  display: flex;
  align-items: center;
  padding: 12px 16px 0;
  margin-bottom: 0;
  position: relative;
}

@media (min-width: 768px) {
  .wiz-progress { padding: 0 0 20px; }
}

.wiz-step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  gap: 3px;
}

/* Connecting line */
.wiz-step-dot::after {
  content: '';
  position: absolute;
  top: 10px;
  left: calc(50% + 11px);
  right: calc(-50% + 11px);
  height: 2px;
  background: var(--wiz-border);
  z-index: 0;
}
.wiz-step-dot:last-child::after { display: none; }
.wiz-step-dot.is-done::after,
.wiz-step-dot.is-active::after { background: var(--wiz-accent); }

.wiz-step-dot .dot-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ebebec;
  color: #888;
  font-size: 0.7rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
  transition: background 0.2s, color 0.2s;
}
.wiz-step-dot .dot-label {
  font-size: 0.6rem;
  color: var(--wiz-muted);
  text-align: center;
  white-space: nowrap;
}

.wiz-step-dot.is-active .dot-circle {
  background: var(--wiz-accent);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(26,166,119,.2);
}
.wiz-step-dot.is-active .dot-label { color: var(--wiz-accent); font-weight: 600; }
.wiz-step-dot.is-done .dot-circle { background: var(--wiz-accent); color: #fff; }

/* ================================================================
   STEP PANEL
   ================================================================ */
.wiz-step-panel { display: none; padding: 14px 16px 4px; }
.wiz-step-panel.is-active { display: block; }

@media (min-width: 768px) {
  .wiz-step-panel { padding: 20px 0 4px; }
}

/* ================================================================
   SECTION HEADER
   ================================================================ */
.wiz-sec-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f2f2f2;
  margin-bottom: 18px;
}
.wiz-sec-head-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #f0fdf8;
  color: var(--wiz-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  flex-shrink: 0;
}
.wiz-sec-head-text strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--wiz-text);
  line-height: 1.2;
}
.wiz-sec-head-text span {
  font-size: 0.72rem;
  color: var(--wiz-muted);
}

/* ================================================================
   FORM FIELDS — label + input, ZERO nested borders
   ================================================================ */
.wiz-field {
  margin-bottom: 10px;
  margin-top: 10px;
}

.wiz-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #444;
  margin-bottom: 5px;
  letter-spacing: -0.01em;
}
.wiz-label .req { color: var(--wiz-error); margin-left: 2px; }

/* THE input — single border, gri bg */
.wiz-input,
.wiz-select,
.wiz-textarea {
  display: block;
  width: 100%;
  background: var(--wiz-bg-input);
  border: 1.5px solid var(--wiz-border);
  border-radius: var(--wiz-radius);
  padding: 10px 13px;
  font-size: 14px!important;    /* Prevents iOS keyboard zoom */
  line-height: 1.3;
  color: var(--wiz-text);
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}

.wiz-input:focus,
.wiz-select:focus,
.wiz-textarea:focus {
  border-color: var(--wiz-accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26,166,119,.12);
}

.wiz-input[readonly] {
  color: var(--wiz-muted);
  cursor: default;
}

.wiz-textarea {
  min-height: 80px;
  resize: none;
}

/* Select dropdown arrow */
.wiz-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%238e8e93' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 12px;
  padding-right: 36px;
  cursor: pointer;
}

/* Inline grid for 2-col fields */
.wiz-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.wiz-grid-2 .wiz-field { margin-bottom: 0; }

/* Sub-section label */
.wiz-sub-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--wiz-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 18px 0 8px;
}

/* ================================================================
   ERROR STATES
   ================================================================ */
.wiz-input.has-error,
.wiz-select.has-error { border-color: var(--wiz-error) !important; }

.wiz-field-error {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--wiz-error);
  font-size: 0.73rem;
  margin-top: 4px;
  font-weight: 500;
}

@keyframes wiz-error-shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-4px); }
  40%,80% { transform: translateX(4px); }
}
.has-error { animation: wiz-error-shake 0.35s ease; }

/* ================================================================
   PROPERTY TYPE GRID — 2-col, icon top, text bottom
   ================================================================ */
.wiz-type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

@media (min-width: 768px) {
  .wiz-type-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

.wiz-type-option input[type="radio"] { display: none; }

.wiz-type-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 16px 10px;
  border: 1.5px solid var(--wiz-border);
  border-radius: 12px;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  text-align: center;
  min-height: 76px;
  user-select: none;
}

.wiz-type-face i {
  font-size: 1.5rem;
  color: var(--wiz-primary);
}

.wiz-type-face span {
  font-size: 0.8rem;
  font-weight: 600;
  color: #444;
  line-height: 1.2;
}

.wiz-type-option input:checked + .wiz-type-face {
  border-color: var(--wiz-accent);
  background: #f0fdf8;
  box-shadow: 0 0 0 3px rgba(26,166,119,.12);
}

.wiz-type-option input:checked + .wiz-type-face i,
.wiz-type-option input:checked + .wiz-type-face span {
  color: var(--wiz-accent);
}

/* ================================================================
   FEATURE CHECKBOXES — 2-col grid, checkmark icon feedback
   ================================================================ */
.wiz-feat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.wiz-feat-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1.5px solid var(--wiz-border);
  border-radius: var(--wiz-radius);
  background: var(--wiz-bg-input);
  cursor: pointer;
  font-size: 0.82rem;
  color: #444;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}

.wiz-feat-item input[type="checkbox"] { display: none; }

.wiz-feat-mark {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid #ccc;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  font-size: 0.6rem;
  color: transparent;
}

.wiz-feat-item input:checked ~ .wiz-feat-mark {
  background: var(--wiz-accent);
  border-color: var(--wiz-accent);
  color: #fff;
}

.wiz-feat-item:has(input:checked) {
  border-color: var(--wiz-accent);
  background: #f0fdf8;
  color: var(--wiz-accent);
  font-weight: 600;
}

/* ================================================================
   ADDITIONAL FEATURE GROUPS — flat divider, no card wrapper
   ================================================================ */
.wiz-addon-group {
  margin-bottom: 18px;
}
.wiz-addon-group:last-child { margin-bottom: 0; }

.wiz-addon-group-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--wiz-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid #f2f2f2;
}
.wiz-addon-group-title i { color: var(--wiz-accent); font-size: 0.8rem; }

/* ================================================================
   ENVIRONMENT ROW
   ================================================================ */
.wiz-env-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto auto;
  gap: 7px;
  align-items: center;
  margin-bottom: 8px;
}

@media (max-width: 767px) {
  .wiz-env-row {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .wiz-env-row .wiz-env-row-del {
    grid-column: span 2;
    justify-self: end;
  }
}

/* ================================================================
   PREVIEW STEP — real listing card style
   ================================================================ */
.wiz-preview-card {
  border: 1.5px solid var(--wiz-border);
  border-radius: 14px;
  overflow: hidden;
}
.wiz-preview-header {
  background: var(--wiz-primary);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.wiz-preview-type {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.wiz-preview-location {
  font-size: 0.85rem;
  margin-top: 2px;
  opacity: 0.9;
}
.wiz-preview-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1aa677;
  white-space: nowrap;
  flex-shrink: 0;
}
.wiz-preview-body { padding: 14px 16px; }
.wiz-preview-section {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px dashed #eee;
}
.wiz-preview-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.wiz-preview-section h6 {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--wiz-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 7px;
}
.wiz-preview-section ul { margin: 0; padding: 0; list-style: none; }
.wiz-preview-section ul li {
  font-size: 0.85rem;
  color: var(--wiz-text);
  padding: 3px 0;
}

.wiz-notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 14px;
  background: #fffbe6;
  border: 1px solid #ffe58f;
  border-radius: 10px;
  margin-top: 14px;
  font-size: 0.8rem;
  color: #7a5800;
}
.wiz-notice i { color: #f5a623; font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

/* ================================================================
   ACTION BUTTONS — full width, stacked, fixed above bottom-nav
   ================================================================ */
.wiz-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  margin-top: 20px;
}

@media (max-width: 767px) {
  .wiz-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(53px + env(safe-area-inset-bottom, 8px));
    z-index: 9998;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid #e8e8ea;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    margin-top: 0;
    padding: 10px 14px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    flex-direction: row;
    gap: 10px;
    padding-bottom: 20px;
  }
  .wiz-btn-prev { flex: 1; padding: 13px 10px; }
  .wiz-btn-next { flex: 2; }
  .wiz-btn-submit { flex: 1; }
  /* Geri gizliyken İleri tam genişlik */
  .wiz-btn-prev[style*="display: none"] ~ .wiz-btn-next,
  .wiz-btn-prev[style*="display:none"] ~ .wiz-btn-next {
    flex: 1;
  }
}

.wiz-btn-next {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--wiz-accent);
  color: #fff;
  border: none;
  border-radius: var(--wiz-radius);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.wiz-btn-next:hover { opacity: 0.9; }
.wiz-btn-next:active { transform: scale(0.99); }

.wiz-btn-prev {
  display: block;
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--wiz-muted);
  border: 1.5px solid var(--wiz-border);
  border-radius: var(--wiz-radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.wiz-btn-prev:hover { background: #f5f5f7; color: var(--wiz-text); }

.wiz-btn-submit {
  display: block;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #1aa677, #15956a);
  color: #fff;
  border: none;
  border-radius: var(--wiz-radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: opacity 0.15s;
}
.wiz-btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* d-none helper */
.wiz-hidden { display: none !important; }

/* ================================================================
   SUCCESS SCREEN — full screen green checkmark animation
   ================================================================ */
.wiz-success {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #fff;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
}
.wiz-success.is-visible { display: flex; }

.wiz-success-icon {
  margin-bottom: 24px;
}

/* Animated checkmark circle */
.wiz-check-circle {
  width: 88px;
  height: 88px;
}

@keyframes wiz-circle-fill {
  0%   { stroke-dashoffset: 283; opacity: 0; }
  30%  { opacity: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes wiz-check-draw {
  0%   { stroke-dashoffset: 50; }
  100% { stroke-dashoffset: 0; }
}

.wiz-check-circle .circle-bg {
  stroke: #e8f9f3;
  stroke-width: 8;
  fill: none;
}
.wiz-check-circle .circle-ring {
  stroke: var(--wiz-accent);
  stroke-width: 6;
  fill: none;
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  stroke-linecap: round;
  transform-origin: center;
  transform: rotate(-90deg);
  animation: wiz-circle-fill 0.7s cubic-bezier(0.4,0,0.2,1) 0.1s forwards;
}
.wiz-check-circle .check-mark {
  stroke: var(--wiz-accent);
  stroke-width: 6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: wiz-check-draw 0.4s ease 0.8s forwards;
}

.wiz-success h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--wiz-primary);
  margin-bottom: 8px;
}
.wiz-success p {
  font-size: 0.9rem;
  color: var(--wiz-muted);
  max-width: 280px;
  margin: 0 auto 28px;
  line-height: 1.6;
}
.wiz-success-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 320px;
}
.wiz-success-actions a {
  display: block;
  padding: 14px;
  border-radius: var(--wiz-radius);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: opacity 0.15s;
}
.wiz-success-actions a:hover { opacity: 0.88; }
.wiz-success-actions .btn-primary-solid {
  background: var(--wiz-accent);
  color: #fff;
}
.wiz-success-actions .btn-outline-plain {
  border: 1.5px solid var(--wiz-border);
  color: var(--wiz-text);
}

/* ================================================================
   URGENT TOGGLE (demand form)
   ================================================================ */
.wiz-urgent {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: #fffbe6;
  border: 1.5px dashed #f5a623;
  border-radius: var(--wiz-radius);
  cursor: pointer;
  margin-top: 10px;
}
.wiz-urgent input { display: none; }
.wiz-urgent-icon {
  width: 34px; height: 34px;
  background: #fff0c0;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: #d97706; flex-shrink: 0;
}
.wiz-urgent-title { font-weight: 700; font-size: 0.88rem; color: #7a5800; }
.wiz-urgent-desc  { font-size: 0.73rem; color: #b45309; margin-top: 1px; }
.wiz-toggle-switch {
  margin-left: auto;
  width: 42px; height: 24px;
  background: #d1d5db;
  border-radius: 99px;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}
.wiz-toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform 0.2s;
}
.wiz-urgent input:checked ~ .wiz-toggle-switch { background: #f59e0b; }
.wiz-urgent input:checked ~ .wiz-toggle-switch .wiz-toggle-thumb { transform: translateX(18px); }

/* ================================================================
   STEP 3 FEATURE FIELDS (JS-generated) — flat, zero nesting
   ================================================================ */
.wiz-feat-fields .wiz-field {
  background: none;
  border: none;
  padding: 0;
}

/* ================================================================
   DESKTOP TWEAKS
   ================================================================ */
@media (min-width: 768px) {
  .wiz-progress { padding-bottom: 20px; }
  .wiz-step-panel { padding: 16px 0 0; }
  .wiz-type-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .wiz-feat-grid { grid-template-columns: repeat(3, 1fr); }
  .wiz-input, .wiz-select, .wiz-textarea { font-size: 0.92rem; }
  .wiz-actions { flex-direction: row; gap: 10px; }
  .wiz-btn-prev { flex: 1; }
  .wiz-btn-next, .wiz-btn-submit { flex: 2; }
  .wiz-env-row {
    grid-template-columns: 1.3fr 1.3fr 0.7fr 0.5fr auto;
  }
}
