/* =========================================================
   RIGO SAEZ VENDE — Mobile-first styles
   ========================================================= */

/* Evita el zoom automático en iOS al enfocar inputs (requiere font-size >= 16px) */
input, select, textarea {
  font-size: 16px;
}

:root {
  --verde:       #4ead33;
  --verde-dark:  #3d9427;
  --azul:        #28316f;
  --azul-dark:   #1e2656;
  --amarillo:    #dbdb07;
  --blanco:      #ffffff;
  --negro:       #111111;
  --gris-bg:     #f2f4f8;
  --gris-borde:  #dde2eb;
  --gris-texto:  #666;
  --sombra-s:    0 1px 4px rgba(40,49,111,.10);
  --sombra-m:    0 2px 12px rgba(40,49,111,.13);
  --radio:       10px;
  --radio-s:     6px;
  --fuente:      'Segoe UI', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--fuente);
  background: var(--gris-bg);
  color: var(--negro);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ─────────────────────────────────────────────── */
header {
  background: var(--azul);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  position: sticky;
  top: 0;
  z-index: 200;
  gap: 12px;
}

header .logo img {
  height: 50px;
  width: auto;
  display: block;
}

header nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Base compartida para todos los botones del nav */
header nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 36px;
  padding: 0 15px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s;
  border: 1.5px solid transparent;
  line-height: 1;
}

/* Catálogo — outlined blanco */
header nav a.nav-link {
  color: rgba(255,255,255,.90);
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.30);
}
header nav a.nav-link:hover,
header nav a.nav-link.active {
  background: rgba(255,255,255,.20);
  color: #fff;
  border-color: rgba(255,255,255,.50);
}

/* Admin — verde sólido */
header nav a.btn-admin {
  background: var(--verde);
  color: #fff;
  border-color: var(--verde);
}
header nav a.btn-admin:hover { background: var(--verde-dark); border-color: var(--verde-dark); }

/* Salir — outlined con icono */
header nav a.btn-logout {
  color: rgba(255,255,255,.85);
  background: transparent;
  border-color: rgba(255,255,255,.30);
  padding: 0 12px;
}
header nav a.btn-logout:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
  border-color: rgba(255,255,255,.50);
}

/* ── Main container ──────────────────────────────────────── */
main { max-width: 1100px; margin: 0 auto; padding: 16px 12px 60px; }

/* ── Hero / Search ───────────────────────────────────────── */
.hero {
  background: var(--azul);
  border-radius: var(--radio);
  padding: 22px 16px 20px;
  margin-bottom: 14px;
}
.hero h1 {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
  text-align: center;
  line-height: 1.3;
}
.hero h1 span { color: var(--amarillo); }

/* Autocomplete wrapper */
.search-wrap {
  position: relative;
  max-width: 540px;
  margin: 0 auto;
}
.search-bar {
  display: flex;
  gap: 0;
  height: 48px;
}
.search-bar input {
  flex: 1;
  padding: 0 16px;
  border: none;
  border-radius: var(--radio) 0 0 var(--radio);
  font-size: 16px;
  outline: none;
  min-width: 0;
}
.search-bar button {
  background: var(--verde);
  color: #fff;
  border: none;
  padding: 0 20px;
  border-radius: 0 var(--radio) var(--radio) 0;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
  flex-shrink: 0;
}
.search-bar button:hover { background: var(--verde-dark); }

/* Dropdown autocomplete */
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #fff;
  border-radius: var(--radio);
  box-shadow: var(--sombra-m);
  z-index: 300;
  max-height: 320px;
  overflow-y: auto;
  display: none;
}
.autocomplete-dropdown.visible { display: block; }

.ac-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--gris-borde);
  transition: background .15s;
  font-size: 14px;
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover { background: #f0f4ff; }
.ac-item:active { background: #e0e8ff; }

.ac-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 2px 7px;
  border-radius: 10px;
  flex-shrink: 0;
}
.ac-tag-finca     { background: #e8f4fd; color: #1a5276; }
.ac-tag-tipo      { background: #fef9e7; color: #8a6914; }
.ac-tag-provincia { background: #eaf4fb; color: #1f618d; }
.ac-tag-zona      { background: #e8f8f5; color: #1a7a5a; }

.ac-valor { color: var(--negro); font-weight: 500; }

/* ── Banco tabs ──────────────────────────────────────────── */
.banco-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.banco-tabs button {
  padding: 8px 18px;
  border: 2px solid var(--gris-borde);
  background: var(--blanco);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  color: #555;
  min-height: 38px;
}
.banco-tabs button:hover { border-color: var(--azul); color: var(--azul); }
.banco-tabs button.active { background: var(--azul); border-color: var(--azul); color: #fff; }
.banco-tabs button[data-banco="global"].active    { background: #1a5276; border-color: #1a5276; }
.banco-tabs button[data-banco="banesco"].active   { background: #c0392b; border-color: #c0392b; }
.banco-tabs button[data-banco="propietario"].active { background: var(--verde); border-color: var(--verde); }

/* ── Panel de filtros ────────────────────────────────────── */
.filters-card {
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra-s);
  margin-bottom: 14px;
  overflow: hidden;
}
.filters-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  color: var(--azul);
}
.filters-toggle .arrow {
  transition: transform .25s;
  color: #aaa;
  font-size: 12px;
}
.filters-toggle.open .arrow { transform: rotate(180deg); }

.filters-body {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--gris-borde);
}
.filters-body.open { display: block; }

.filters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.filters-grid select,
.filters-grid input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--gris-borde);
  border-radius: var(--radio-s);
  font-size: 16px;
  background: #fff;
  color: var(--negro);
  outline: none;
  transition: border-color .2s;
  min-height: 44px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.filters-grid input[type="number"] {
  background-image: none;
  padding-right: 12px;
}
.filters-grid select:focus,
.filters-grid input:focus { border-color: var(--azul); }

.filters-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

/* ── Botones ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radio-s);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  min-height: 44px;
  white-space: nowrap;
}
.btn-primary   { background: var(--verde);     color: #fff; }
.btn-primary:hover  { background: var(--verde-dark); }
.btn-secondary { background: var(--gris-borde); color: #555; }
.btn-secondary:hover { background: #c8cdd8; }
.btn-danger    { background: #e74c3c; color: #fff; }
.btn-danger:hover   { background: #c0392b; }
.btn-azul      { background: var(--azul); color: #fff; }
.btn-azul:hover     { background: var(--azul-dark); }
.btn-sm        { padding: 7px 14px; font-size: 13px; min-height: 36px; }

/* ── Conteo de resultados ────────────────────────────────── */
.results-header {
  font-size: 13px;
  color: var(--gris-texto);
  margin-bottom: 10px;
  padding: 0 2px;
}
.results-header strong { color: var(--negro); }

/* ── Tarjetas de propiedades (mobile-first) ──────────────── */
.props-list { display: flex; flex-direction: column; gap: 10px; }

.prop-card {
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra-s);
  overflow: hidden;
  transition: box-shadow .2s;
}
.prop-card:active { box-shadow: var(--sombra-m); }

.prop-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--gris-bg);
  border-bottom: 1px solid var(--gris-borde);
  gap: 8px;
  flex-wrap: wrap;
}

.prop-card-left  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prop-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--verde);
  white-space: nowrap;
}

.prop-card-body { padding: 12px 14px; }

.prop-finca {
  font-size: 14px;
  color: var(--gris-texto);
  margin-bottom: 5px;
}
.prop-finca strong { color: var(--azul); font-size: 15px; }

.prop-tipo {
  font-size: 16px;
  font-weight: 700;
  color: var(--negro);
  margin-bottom: 6px;
}

.prop-ubicacion {
  font-size: 15px;
  color: #555;
  margin-bottom: 8px;
  line-height: 1.4;
}
.prop-ubicacion .provincia { font-weight: 600; color: var(--azul); }

.prop-medidas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--gris-texto);
  border-top: 1px solid var(--gris-borde);
  padding-top: 8px;
  margin-top: 4px;
}
.prop-medidas span { display: flex; align-items: center; gap: 4px; }

/* ── Datos de propietario (visibles en cualquier tarjeta) ── */
.prop-owner-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--azul);
  margin-bottom: 4px;
  margin-top: 2px;
}
.prop-contact {
  font-size: 14px;
  color: var(--gris-texto);
  margin-bottom: 6px;
}
.prop-contact-link {
  color: var(--verde);
  text-decoration: none;
  font-weight: 600;
}
.prop-contact-link:hover { text-decoration: underline; }
.prop-descripcion {
  font-size: 15px;
  color: #444;
  margin-top: 8px;
  border-top: 1px solid var(--gris-borde);
  padding-top: 8px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.prop-price-consultar {
  font-size: 14px !important;
  color: var(--gris-texto) !important;
  font-style: italic;
}

/* ── Lista de propietarios en admin ─────────────────────── */
.propietario-list-wrap {
  margin-top: 24px;
  border-top: 2px solid var(--gris-borde);
  padding-top: 20px;
}
.propietario-list-wrap h3 {
  font-size: 16px;
  color: var(--azul);
  margin-bottom: 14px;
  font-weight: 700;
}
.propietario-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gris-borde);
  flex-wrap: wrap;
}
.propietario-item:last-child { border-bottom: none; }
.propietario-item-info { flex: 1; min-width: 0; }
.propietario-item-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--azul);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.propietario-item-tipo {
  font-size: 11px;
  font-weight: 600;
  background: var(--gris-bg);
  color: var(--gris-texto);
  padding: 2px 8px;
  border-radius: 10px;
}
.propietario-item-ubic {
  font-size: 13px;
  color: var(--gris-texto);
  margin-top: 3px;
}
.propietario-item-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--verde);
  margin-top: 3px;
}
.propietario-item-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Pie de tarjeta (botón WhatsApp) ────────────────────── */
.prop-card-footer {
  padding-top: 10px;
  border-top: 1px solid var(--gris-borde);
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.btn-wa {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: var(--radio-s);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  min-height: 38px;
}
.btn-wa:hover  { background: #1ebe5d; }
.btn-wa:active { background: #17a84f; }

/* ── Modal WhatsApp ──────────────────────────────────────── */
.wa-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.wa-modal-card {
  background: #fff;
  border-radius: var(--radio);
  box-shadow: 0 8px 40px rgba(0, 0, 0, .30);
  width: 100%;
  max-width: 460px;
  padding: 24px 20px 20px;
  max-height: 90vh;
  overflow-y: auto;
}

.wa-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.wa-modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--azul);
}

.wa-modal-subtitle {
  font-size: 13px;
  color: var(--gris-texto);
  margin-bottom: 14px;
}

.wa-modal-preview {
  background: var(--gris-bg);
  border-radius: var(--radio-s);
  border: 1px solid var(--gris-borde);
  padding: 12px 14px;
  font-size: 13px;
  color: #333;
  line-height: 1.65;
  margin-bottom: 16px;
  white-space: pre-wrap;
  max-height: 180px;
  overflow-y: auto;
  font-family: var(--fuente);
}

.wa-modal-field { margin-bottom: 16px; }
.wa-modal-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #555;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.wa-phone-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--gris-borde);
  border-radius: var(--radio-s);
  overflow: hidden;
  transition: border-color .2s;
}
.wa-phone-wrap:focus-within { border-color: #25D366; }

.wa-phone-prefix {
  padding: 0 14px;
  font-size: 15px;
  color: #333;
  background: var(--gris-bg);
  border-right: 1.5px solid var(--gris-borde);
  height: 48px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
#wa-phone {
  flex: 1;
  border: none;
  padding: 0 14px;
  font-size: 17px;
  height: 48px;
  outline: none;
  font-family: var(--fuente);
  letter-spacing: .5px;
}

.wa-hint {
  font-size: 11.5px;
  color: #999;
  margin-top: 6px;
}

.wa-modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-wa-send {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: var(--radio-s);
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
  min-height: 48px;
}
.btn-wa-send:hover { background: #1ebe5d; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.badge-global      { background: #d6eaf8; color: #1a5276; }
.badge-banesco     { background: #fadbd8; color: #922b21; }
.badge-propietario { background: #d5f5e3; color: #1e8449; }
.badge-disponible  { background: #d5f5e3; color: #1e8449; }
.badge-ocupada     { background: #fdebd0; color: #935116; }
.badge-oferta      { background: #fef9e7; color: #9a7d0a; }

/* ── Paginación ──────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.pagination button {
  min-width: 40px;
  height: 40px;
  border: 1.5px solid var(--gris-borde);
  background: var(--blanco);
  border-radius: var(--radio-s);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  padding: 0 12px;
}
.pagination button:hover  { border-color: var(--azul); color: var(--azul); }
.pagination button.active { background: var(--azul); border-color: var(--azul); color: #fff; }
.pagination button:disabled { opacity: .35; cursor: default; }

/* ── Loading / Empty ─────────────────────────────────────── */
.loading {
  text-align: center;
  padding: 50px 20px;
  color: #999;
}
.spinner {
  display: inline-block;
  width: 30px; height: 30px;
  border: 3px solid var(--gris-borde);
  border-top-color: var(--azul);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin-bottom: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 60px 20px; color: #bbb; }
.empty-state p { font-size: 15px; margin-top: 12px; }

/* ═══════════════════════════════════════════════════════════
   ADMIN
   ═══════════════════════════════════════════════════════════ */
.admin-tabs {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-bottom: 2px solid var(--gris-borde);
  margin-bottom: 20px;
  gap: 2px;
  scrollbar-width: none;
}
.admin-tabs::-webkit-scrollbar { display: none; }

.admin-tabs button {
  padding: 12px 20px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all .2s;
  white-space: nowrap;
  min-height: 48px;
}
.admin-tabs button:hover  { color: var(--azul); }
.admin-tabs button.active { color: var(--azul); border-bottom-color: var(--azul); }

.tab-content         { display: none; }
.tab-content.active  { display: block; }

.upload-zone {
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra-s);
  padding: 20px 16px;
  max-width: 580px;
}
.upload-zone h2     { font-size: 17px; color: var(--azul); margin-bottom: 6px; }
.upload-zone p.subtitle { color: #777; font-size: 13px; margin-bottom: 18px; line-height: 1.5; }

.drop-area {
  border: 2px dashed var(--gris-borde);
  border-radius: var(--radio);
  padding: 32px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  margin-bottom: 14px;
}
.drop-area:hover, .drop-area.dragover { border-color: var(--verde); background: #f0fff4; }
.drop-area svg   { color: #ccc; margin-bottom: 10px; }
.drop-area p     { font-size: 14px; color: #999; }
.drop-area p strong { color: var(--azul); }
.drop-area input[type="file"] { display: none; }

.file-list { margin-bottom: 14px; }
.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gris-borde);
  color: #444;
}
.file-item:last-child { border-bottom: none; }
.file-item svg { color: var(--verde); flex-shrink: 0; }

.alert {
  padding: 12px 14px;
  border-radius: var(--radio-s);
  font-size: 13px;
  margin-top: 14px;
  display: none;
  line-height: 1.5;
}
.alert.show    { display: block; }
.alert-success { background: #d5f5e3; color: #1e8449; border: 1px solid #a9dfbf; }
.alert-error   { background: #fadbd8; color: #922b21; border: 1px solid #f1948a; }
.alert-warning { background: #fef9e7; color: #9a7d0a; border: 1px solid #f7dc6f; }

/* ── Formulario propietario ──────────────────────────────── */
.form-card {
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra-s);
  padding: 20px 16px;
  max-width: 760px;
}
.form-card h2 { font-size: 17px; color: var(--azul); margin-bottom: 18px; }

.form-section {
  background: var(--gris-bg);
  border-radius: var(--radio-s);
  padding: 14px 12px;
  margin-bottom: 12px;
}
.form-section h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #999;
  margin-bottom: 12px;
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  margin-bottom: 5px;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--gris-borde);
  border-radius: var(--radio-s);
  font-size: 16px;
  outline: none;
  transition: border-color .2s;
  font-family: var(--fuente);
  min-height: 44px;
}
.form-field textarea { resize: vertical; min-height: 80px; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { border-color: var(--azul); }
.form-field.full { grid-column: 1 / -1; }

/* ── Stats ───────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra-s);
  padding: 16px 12px;
  text-align: center;
}
.stat-card .stat-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--azul);
  line-height: 1;
  margin-bottom: 5px;
}
.stat-card .stat-label {
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.stat-card.global      .stat-num { color: #1a5276; }
.stat-card.banesco     .stat-num { color: #922b21; }
.stat-card.propietario .stat-num { color: #1e8449; }

/* ═══════════════════════════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════════════════════════ */
.login-body {
  background: #1a2040;
  min-height: 100vh;
  overflow-x: hidden;
}

.login-fondo {
  position: fixed;
  inset: 0;
  background-image: url('../img/fondo.webp');
  background-size: cover;
  background-position: center center;
  z-index: 0;
}

.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 28, 70, 0.60);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 1;
  padding: 40px 16px 40px;
  overflow-y: auto;
}

.login-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.45);
  width: 100%;
  max-width: 380px;
  margin-top: 36px;
  overflow: hidden; /* el border-radius recorta ambas secciones */
}

/* Sección superior azul — solo el logo */
.login-card-top {
  background: var(--azul);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 28px 28px;
}

.login-logo {
  height: 72px;
  width: auto;
  display: block;
}

/* Sección inferior blanca — formulario */
.login-card-body {
  padding: 28px 28px 32px;
  text-align: center;
}

.login-titulo {
  font-size: 15px;
  font-weight: 700;
  color: var(--azul);
  margin-bottom: 24px;
  letter-spacing: .1px;
}

.login-form { text-align: left; }

.login-field { margin-bottom: 16px; }

.login-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #555;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.login-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--gris-borde);
  border-radius: var(--radio-s);
  font-size: 16px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  font-family: var(--fuente);
  min-height: 48px;
}
.login-field input:focus {
  border-color: var(--azul);
  box-shadow: 0 0 0 3px rgba(40,49,111,.1);
}

.login-btn {
  width: 100%;
  margin-top: 8px;
  min-height: 50px;
  font-size: 15px;
}

.login-error {
  background: #fadbd8;
  color: #922b21;
  border: 1px solid #f1948a;
  border-radius: var(--radio-s);
  padding: 11px 14px;
  font-size: 13px;
  margin-bottom: 20px;
  text-align: left;
  line-height: 1.4;
}

/* ── Bienvenido (separador con raya) ────────────────────── */
.header-bienvenido {
  font-size: 12.5px;
  color: rgba(255,255,255,.72);
  white-space: nowrap;
  display: none;
  padding-right: 16px;
  margin-right: 6px;
  border-right: 1.5px solid rgba(255,255,255,.25);
  flex-shrink: 0;
}
.header-bienvenido strong { color: #fff; font-weight: 700; }

/* En móvil: texto "Salir" oculto, solo icono */
.btn-logout-text { display: none; }

@media (min-width: 560px) {
  .header-bienvenido { display: inline; }
  .btn-logout-text   { display: inline; }
}

/* ═══════════════════════════════════════════════════════════
   TABLET (≥ 600px)
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 600px) {
  main { padding: 20px 16px 60px; }

  .hero { padding: 28px 24px; }
  .hero h1 { font-size: 20px; }

  .filters-grid { grid-template-columns: 1fr 1fr; }

  .form-grid { grid-template-columns: 1fr 1fr; }
  .stats-row { grid-template-columns: repeat(4, 1fr); }
  .stat-card .stat-num { font-size: 32px; }

  /* Cards en tablet: layout horizontal */
  .prop-card-body {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0 16px;
  }
  .prop-medidas,
  .prop-ubicacion,
  .prop-owner-name,
  .prop-contact,
  .prop-descripcion,
  .prop-card-footer  { grid-column: 1 / -1; }
  .prop-medidas { border-top: none; padding-top: 0; margin-top: 0; }
}

/* ═══════════════════════════════════════════════════════════
   IPAD PORTRAIT / TABLETA ANCHA (≥ 768px)
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  .stats-row { grid-template-columns: repeat(4, 1fr); }
}

/* ═══════════════════════════════════════════════════════════
   DESKTOP (≥ 900px)
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 900px) {
  header { height: 70px; padding: 0 28px; gap: 16px; }
  header .logo img { height: 56px; }
  header nav { gap: 8px; }
  header nav a { height: 38px; font-size: 13.5px; }
  .header-bienvenido { font-size: 13px; }

  main { padding: 24px 20px 60px; }

  .hero { padding: 32px 32px; }
  .hero h1 { font-size: 22px; }

  /* Filtros siempre abiertos en desktop */
  .filters-toggle  { display: none; }
  .filters-body    { display: block !important; padding: 0 20px 18px; border-top: none; }
  .filters-card    { padding-top: 16px; }
  .filters-grid    { grid-template-columns: repeat(4, 1fr); }

  /* Form grid en desktop */
  .form-grid { grid-template-columns: repeat(3, 1fr); }

  /* Tarjetas en desktop: layout más compacto tipo lista */
  .prop-card {
    display: grid;
    grid-template-columns: 1fr;
  }
  .prop-card-header { flex-wrap: nowrap; }

  .upload-zone  { padding: 28px; }
  .form-card    { padding: 28px; }
  .form-section { padding: 16px; }
}
