:root {
  /* Paleta alineada con css/tpl-foundation.css (fuente de verdad del sitio).
     Los valores van literales porque esta pagina no carga esa hoja. */
  --primary: #003f7a;
  --primary-hover: #002b54;
  --success: #1d7a4c;
  --success-hover: #145c39;
  --text-main: #14212e;
  --text-muted: #5f7183;
  --bg-light: #f6f9fc;
  --border: #dfe6ee;
  --radius: 8px;
  --font-family: 'Inter', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-light);
  color: var(--text-main);
  line-height: 1.5;
}

/* Header */
.v2-header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 15px 30px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.header-container {
  display: flex;
  align-items: center;
  gap: 15px;
  max-width: 1200px;
  margin: 0 auto;
}

/* El logo es un badge cuadrado: sin width explícito se deformaba. */
.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #0f172a;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.header-brand img {
  width: 46px;
  height: auto;
  border-radius: 9px;
  display: block;
}

.header-title {
  font-weight: 600;
  color: var(--text-muted);
  border-left: 2px solid var(--border);
  padding-left: 15px;
}

/* Antes no había forma de volver al sitio desde el publicador. */
.header-nav {
  margin-left: auto;
  display: flex;
  gap: 22px;
}
.header-nav a {
  color: #475569;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.header-nav a:hover { color: #0f172a; }

@media (max-width: 820px) {
  .header-brand span { display: none; }
  .header-title { font-size: 14px; padding-left: 12px; }
  .header-nav { display: none; }
}

/* Layout */
.v2-container {
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 20px;
}

.wizard-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 40px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  padding: 30px;
}

/* Sidebar */
.wizard-sidebar {
  border-right: 1px solid var(--border);
  padding-right: 20px;
}

.progress-steps {
  list-style: none;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 0;
  opacity: 0.5;
  transition: opacity 0.3s;
}

.step-item.active {
  opacity: 1;
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-light);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.step-item.active .step-number {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.step-text strong {
  display: block;
  font-size: 14px;
}

.step-text small {
  font-size: 12px;
  color: var(--text-muted);
}

/* Wizard Content */
.wizard-content {
  position: relative;
}

.wizard-pane {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.wizard-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

h2 {
  font-size: 22px;
  margin-bottom: 5px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 25px;
}

/* Forms */
.form-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 20px;
}

.form-grid.dual {
  grid-template-columns: 1fr 1fr;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.form-group small {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-family);
  font-size: 15px;
  transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,86,179,0.1);
}

.mt-20 { margin-top: 20px; }

/* Money Input */
.input-icon {
  position: relative;
}
.input-icon span {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: 600;
}
.input-icon input {
  padding-left: 30px;
}

/* Dropzone */
.file-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-light);
  transition: all 0.2s;
}

.file-dropzone:hover {
  border-color: var(--primary);
  background: rgba(0,86,179,0.02);
}

.file-dropzone .icon {
  font-size: 24px;
  margin-bottom: 10px;
  display: block;
}

/* Map */
.v2-map {
  height: 250px;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #eaeaea;
}

/* Actions */
.wizard-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.btn {
  padding: 10px 24px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover { background: var(--primary-hover); }

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover { background: var(--success-hover); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-light);
}

/* Responsive */
@media (max-width: 768px) {
  .wizard-layout {
    grid-template-columns: 1fr;
  }
  .wizard-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 20px;
  }
  .progress-steps {
    display: flex;
    justify-content: space-between;
  }
  .step-text {
    display: none;
  }
  .form-grid.dual {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Claridad de formulario
   ========================================================================== */

/* Casilla + explicación. Antes el input quedaba centrado y lejos del texto. */
.tpl-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.tpl-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  flex-shrink: 0;
  accent-color: #1d4ed8;
  cursor: pointer;
}
.tpl-check span { display: block; }
.tpl-check strong { display: block; font-size: 14px; color: #0f172a; font-weight: 600; }
.tpl-check small { display: block; margin-top: 3px; font-size: 13px; color: #5f7183; line-height: 1.5; }

/* Aviso informativo (reemplaza el bloque morado con jerga) */
.info-note {
  background: #f0f7ff;
  border: 1px solid #cfe2f8;
  border-left: 4px solid #1d4ed8;
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 25px;
}
.info-note strong { display: block; color: #0f172a; font-size: 14px; }
.info-note p { font-size: 13px; margin: 5px 0 0; color: #44607f; line-height: 1.55; }

/* El borrador automático se salía de la barra lateral */
.draft-status { line-height: 1.5; word-break: normal; }

/* Tarjetas de tipo de propiedad: el radio se veía suelto sobre el texto */
.property-type-grid .choice-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left !important;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.property-type-grid .choice-card:hover { border-color: #93b4d8; }
.property-type-grid .choice-card input[type="radio"] {
  width: 18px; height: 18px; margin: 2px 0 0;
  flex-shrink: 0; accent-color: #1d4ed8; cursor: pointer;
}
.property-type-grid .choice-card strong { margin-top: 0 !important; }
.property-type-grid .choice-card:has(input:checked) {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .12);
  background: #f8fbff;
}

/* Resumen de fotos elegidas. Vive fuera del dropzone: el dropzone se reescribe
   para mostrar estado, y el input no puede estar dentro o se destruye con él. */
.fotos-resumen {
  margin: 10px 0 0;
  padding: 10px 12px;
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: #15803d;
  word-break: break-word;
}
.fotos-resumen[hidden] { display: none; }
