/* ═══════════════════════════════════════════════════════════
   RECORDS.CSS — Modal de Registro Povis Propiedades
   Responsive: mobile (< 480px) · tablet (481–768px) · desktop (769px+)
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,600;0,700;1,500&family=DM+Sans:wght@300;400;500&display=swap');

/* ──────────────────────────────────────────
   BACKDROP — fondo esmerilado
────────────────────────────────────────── */
#rm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3000;
  backdrop-filter: blur(20px) brightness(0.38) saturate(0.5);
  -webkit-backdrop-filter: blur(20px) brightness(0.38) saturate(0.5);
  background: rgba(2, 8, 22, 0.60);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
#rm-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* ──────────────────────────────────────────
   MODAL WRAPPER — centrado en pantalla
────────────────────────────────────────── */
#rm-modal {
  position: fixed;
  inset: 0;
  z-index: 3001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease 0.1s;
}
#rm-modal.active {
  opacity: 1;
  pointer-events: auto;
}

/* ──────────────────────────────────────────
   CARD — la tarjeta del formulario
────────────────────────────────────────── */
.rm-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 168, 76, 0.3) transparent;
  background: linear-gradient(150deg, #060f22 0%, #091828 50%, #0c2040 100%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow:
    0 0 0 1px rgba(201, 168, 76, 0.12),
    0 30px 80px rgba(0, 0, 0, 0.85),
    0 8px 32px rgba(0, 0, 10, 0.6);
  transform: translateY(30px) scale(0.97);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.1s;
}
#rm-modal.active .rm-card {
  transform: translateY(0) scale(1);
}

.rm-card::-webkit-scrollbar { width: 4px; }
.rm-card::-webkit-scrollbar-thumb {
  background: rgba(201, 168, 76, 0.25);
  border-radius: 2px;
}

/* Línea dorada superior */
.rm-card::before {
  content: '';
  position: absolute;
  top: 0; left: 8%; right: 8%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, #C9A84C, rgba(232, 201, 122, 0.5), transparent);
}

/* Brillo esquina */
.rm-card::after {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(201, 168, 76, 0.08) 0%, transparent 65%);
  pointer-events: none;
}

/* Estrellas decorativas */
.rm-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 18px;
  background-image:
    radial-gradient(1px 1px at 8%  12%, rgba(255,255,255,0.15) 0%, transparent 100%),
    radial-gradient(1px 1px at 22% 55%, rgba(255,255,255,0.09) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 8%,  rgba(255,255,255,0.12) 0%, transparent 100%),
    radial-gradient(1px 1px at 78% 42%, rgba(255,255,255,0.08) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 75%, rgba(255,255,255,0.11) 0%, transparent 100%),
    radial-gradient(1px 1px at 45% 88%, rgba(255,255,255,0.07) 0%, transparent 100%);
}

/* ──────────────────────────────────────────
   BOTÓN CERRAR
────────────────────────────────────────── */
.rm-close {
  position: sticky;
  top: 1rem;
  float: right;
  margin: 1rem 1rem 0 0;
  width: 36px; height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.95rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.25s;
  z-index: 10;
  flex-shrink: 0;
}
.rm-close:hover {
  border-color: #C9A84C;
  color: #C9A84C;
  background: rgba(201, 168, 76, 0.10);
  transform: rotate(90deg);
}

/* ──────────────────────────────────────────
   INNER PADDING & TIPOGRAFÍA
────────────────────────────────────────── */
.rm-inner {
  padding: 1.2rem 2rem 2.2rem;
  position: relative;
  z-index: 1;
}

.rm-eyebrow {
  font-size: 0.62rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: #C9A84C;
  font-family: "DM Sans", sans-serif;
  margin-bottom: 0.6rem;
  opacity: 0.85;
}

.rm-title {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.4rem, 4vw, 2.1rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.12;
  margin-bottom: 0.45rem;
}
.rm-title em {
  font-style: italic;
  color: #E8C97A;
}

.rm-sub {
  font-family: "DM Sans", sans-serif;
  font-size: 0.83rem;
  color: #6a8aad;
  font-weight: 300;
  line-height: 1.65;
  margin-bottom: 1.4rem;
}

.rm-gold-bar {
  width: 44px; height: 2px;
  background: linear-gradient(90deg, #C9A84C, transparent);
  margin-bottom: 1.6rem;
}

/* ──────────────────────────────────────────
   GRID DEL FORMULARIO
────────────────────────────────────────── */
.rm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.82rem;
}

.rm-field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}
.rm-field.full { grid-column: 1 / -1; }

.rm-field label {
  font-size: 0.62rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #C9A84C;
  font-family: "DM Sans", sans-serif;
  font-weight: 500;
}

.rm-field input,
.rm-field select,
.rm-field textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  color: #dce8f5;
  font-family: "DM Sans", "Source Sans Pro", sans-serif;
  font-size: 0.88rem;
  padding: 0.65rem 0.9rem;
  outline: none;
  transition: border-color 0.22s, background 0.22s, box-shadow 0.22s;
  -webkit-appearance: none;
  appearance: none;
  /* Evita zoom en iOS al enfocar inputs */
  font-size: max(16px, 0.88rem);
}

.rm-field input::placeholder,
.rm-field textarea::placeholder {
  color: rgba(108, 140, 175, 0.38);
}

.rm-field input:focus,
.rm-field select:focus,
.rm-field textarea:focus {
  border-color: rgba(201, 168, 76, 0.6);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.09);
}

.rm-field select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='6'%3E%3Cpath d='M1 1l4.5 4 4.5-4' stroke='%23C9A84C' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-color: rgba(255, 255, 255, 0.05);
  padding-right: 2.4rem;
}
.rm-field select option {
  background: #091828;
  color: #dce8f5;
}

.rm-field textarea {
  resize: none;
  height: 66px;
}

/* ──────────────────────────────────────────
   DIVISOR INTERNO
────────────────────────────────────────── */
.rm-divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0.3rem 0;
}
.rm-divider span {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #6a8aad;
  white-space: nowrap;
  font-family: "DM Sans", sans-serif;
}
.rm-divider::before,
.rm-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

/* ──────────────────────────────────────────
   CHECKBOXES
────────────────────────────────────────── */
.rm-cb-wrap { grid-column: 1 / -1; }

.rm-cb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.38rem;
  margin-top: 0.28rem;
}

.rm-cb {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  font-size: 0.78rem;
  color: #6a8aad;
  padding: 0.42rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: all 0.18s;
  font-family: "DM Sans", sans-serif;
  -webkit-user-select: none;
  user-select: none;
  text-decoration: none;
}
.rm-cb:hover {
  color: #dce8f5;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(201, 168, 76, 0.22);
}
.rm-cb input[type="checkbox"] {
  width: 15px; height: 15px;
  padding: 0; margin: 0;
  accent-color: #C9A84C;
  flex-shrink: 0;
  cursor: pointer;
}

/* ──────────────────────────────────────────
   SLIDER PRESUPUESTO
────────────────────────────────────────── */
.rm-field input[type="range"] {
  padding: 0;
  height: 4px;
  border: none;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  accent-color: #C9A84C;
  margin-top: 0.5rem;
  box-shadow: none;
  width: 100%;
  cursor: pointer;
}

.rm-range-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #6a8aad;
  margin-top: 0.35rem;
  font-family: "DM Sans", sans-serif;
}
.rm-range-row strong { color: #E8C97A; }

/* ──────────────────────────────────────────
   BOTÓN SUBMIT
────────────────────────────────────────── */
.rm-submit {
  grid-column: 1 / -1;
  margin-top: 0.9rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #8a6520 0%, #C9A84C 45%, #E8C97A 100%);
  color: #040d1c;
  border: none;
  border-radius: 9px;
  padding: 1rem 1.5rem;
  font-family: "DM Sans", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 22px rgba(201, 168, 76, 0.28);
  /* Toca fácil en móvil */
  min-height: 48px;
}
.rm-submit::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(-100%) skewX(-20deg);
  transition: transform 0.45s ease;
}
.rm-submit:hover::after { transform: translateX(110%) skewX(-20deg); }
.rm-submit:hover { box-shadow: 0 6px 30px rgba(201, 168, 76, 0.42); }
.rm-submit:active { transform: scale(0.99); }

.rm-privacy {
  grid-column: 1 / -1;
  font-size: 0.67rem;
  color: rgba(106, 138, 173, 0.5);
  text-align: center;
  font-family: "DM Sans", sans-serif;
  line-height: 1.5;
  margin-top: 0.5rem;
}

/* ──────────────────────────────────────────
   THANK YOU STATE
────────────────────────────────────────── */
.rm-thankyou {
  display: none;
  padding: 1.5rem 2rem 2.5rem;
  text-align: center;
  position: relative;
  z-index: 1;
  animation: rmFadeUp 0.6s ease both;
}

@keyframes rmFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.rm-ty-icon {
  width: 66px; height: 66px;
  border: 1.5px solid #C9A84C;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0.5rem auto 1.4rem;
  font-size: 1.6rem;
  color: #C9A84C;
  background: rgba(201, 168, 76, 0.06);
  animation: rmPulse 2.5s ease infinite;
}

@keyframes rmPulse {
  0%,100% { box-shadow: 0 0 0 0   rgba(201, 168, 76, 0.2); }
  50%      { box-shadow: 0 0 0 14px rgba(201, 168, 76, 0);   }
}

.rm-ty-title {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.5rem, 5vw, 1.75rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.6rem;
  line-height: 1.2;
}
.rm-ty-title em { font-style: italic; color: #E8C97A; }

.rm-ty-sub {
  font-family: "DM Sans", sans-serif;
  font-size: 0.86rem;
  color: #6a8aad;
  font-weight: 300;
  line-height: 1.7;
  max-width: 32ch;
  margin: 0 auto 1.4rem;
}

.rm-ty-badge {
  display: inline-block;
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid rgba(201, 168, 76, 0.22);
  border-radius: 50px;
  padding: 0.42rem 1.1rem;
  font-size: 0.72rem;
  color: #E8C97A;
  margin-bottom: 1.5rem;
  font-family: "DM Sans", sans-serif;
}

.rm-ty-links {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.rm-ty-btn {
  padding: 0.82rem 1rem;
  border-radius: 8px;
  font-family: "DM Sans", sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  text-align: center;
  display: block;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rm-ty-gold {
  background: #C9A84C;
  color: #040d1c;
  border: none;
}
.rm-ty-gold:hover { background: #E8C97A; }

.rm-ty-outline {
  background: transparent;
  color: #6a8aad;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.rm-ty-outline:hover { border-color: #C9A84C; color: #C9A84C; }

/* ──────────────────────────────────────────
   BOTÓN FLOTANTE PARA REABRIR
────────────────────────────────────────── */
#rm-trigger {
  position: fixed;
  bottom: 1.8rem;
  right: 1.8rem;
  z-index: 2500;
  display: none;
  background: linear-gradient(135deg, #C9A84C, #E8C97A);
  color: #040d1c;
  border: none;
  border-radius: 50px;
  padding: 0.72rem 1.35rem;
  font-family: "DM Sans", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 28px rgba(201, 168, 76, 0.38);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: rmFadeUp 0.4s ease both;
  min-height: 44px;
}
#rm-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 36px rgba(201, 168, 76, 0.48);
}

/* ══════════════════════════════════════════════
   RESPONSIVE — TABLET  481px – 768px
══════════════════════════════════════════════ */
@media (max-width: 768px) {

  #rm-modal {
    padding: 0.75rem;
  }

  .rm-card {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 16px;
  }

  .rm-inner {
    padding: 1rem 1.5rem 2rem;
  }

  /* 2 columnas en tablet */
  .rm-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .rm-cb-grid {
    grid-template-columns: 1fr 1fr;
  }

  .rm-title {
    font-size: clamp(1.35rem, 3.5vw, 1.8rem);
  }

  #rm-trigger {
    bottom: 1.2rem;
    right: 1.2rem;
    font-size: 0.72rem;
    padding: 0.65rem 1.1rem;
  }
}

/* ══════════════════════════════════════════════
   RESPONSIVE — MOBILE  ≤ 540px
   Panel sube desde abajo (sheet style)
══════════════════════════════════════════════ */
@media (max-width: 540px) {

  /* El modal se alinea abajo en lugar de al centro */
  #rm-modal {
    align-items: flex-end;
    padding: 0;
  }

  .rm-card {
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
    max-width: 100%;
    /* Animación: sube desde abajo */
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.05s;
  }

  #rm-modal.active .rm-card {
    transform: translateY(0);
  }

  /* Handle visual tipo bottom sheet */
  .rm-card::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px; height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
  }

  .rm-inner {
    padding: 0.8rem 1.1rem 2rem;
  }

  /* 1 columna en móvil */
  .rm-grid {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .rm-field.full,
  .rm-divider,
  .rm-cb-wrap,
  .rm-submit,
  .rm-privacy {
    grid-column: 1;
  }

  /* Checkboxes: 2 columnas igual (caben bien) */
  .rm-cb-grid {
    grid-template-columns: 1fr 1fr;
  }

  .rm-close {
    width: 34px; height: 34px;
    margin: 0.8rem 0.8rem 0 0;
  }

  .rm-eyebrow {
    font-size: 0.58rem;
    letter-spacing: 0.28em;
  }

  .rm-title {
    font-size: clamp(1.3rem, 6vw, 1.6rem);
  }

  .rm-sub {
    font-size: 0.8rem;
    margin-bottom: 1rem;
  }

  .rm-gold-bar {
    margin-bottom: 1.2rem;
  }

  /* Inputs más grandes para dedos */
  .rm-field input,
  .rm-field select,
  .rm-field textarea {
    padding: 0.75rem 0.9rem;
    font-size: 16px; /* evita zoom en iOS */
  }

  .rm-submit {
    padding: 1rem;
    font-size: 0.8rem;
    letter-spacing: 0.14em;
  }

  /* Range row: ocultar extremos, solo mostrar valor */
  .rm-range-row span:first-child,
  .rm-range-row span:last-child {
    display: none;
  }

  .rm-range-row {
    justify-content: center;
  }

  /* Thank you en móvil */
  .rm-thankyou {
    padding: 1.2rem 1.1rem 2rem;
  }

  .rm-ty-icon {
    width: 56px; height: 56px;
    font-size: 1.3rem;
    margin-bottom: 1rem;
  }

  .rm-ty-title {
    font-size: clamp(1.3rem, 6vw, 1.6rem);
  }

  .rm-ty-sub {
    font-size: 0.82rem;
    max-width: 100%;
  }

  .rm-ty-badge {
    font-size: 0.68rem;
    padding: 0.38rem 0.9rem;
  }

  #rm-trigger {
    bottom: 1rem;
    right: 1rem;
    font-size: 0.7rem;
    padding: 0.6rem 1rem;
    letter-spacing: 0.08em;
  }
}

/* ══════════════════════════════════════════════
   RESPONSIVE — MÓVIL MUY PEQUEÑO  ≤ 360px
══════════════════════════════════════════════ */
@media (max-width: 360px) {

  .rm-inner {
    padding: 0.7rem 0.9rem 1.8rem;
  }

  .rm-cb-grid {
    grid-template-columns: 1fr;
  }

  .rm-cb {
    font-size: 0.75rem;
    padding: 0.5rem 0.6rem;
  }

  .rm-title {
    font-size: 1.25rem;
  }

  .rm-submit {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
  }
}
