/* NEXEL — app del teléfono. Diseño de NEXEL OS (shell/Tema.qml): cristal oscuro, vino y rosa, Inter + Playfair.
   Este archivo lo puede reprogramar NEXEL (con tu aprobación en /sistema). */
@import url("/static/fuentes/fuentes.css");

:root {
  --fondo: #0D0A0B;
  --cristal: rgba(13, 10, 11, .78);
  --vidrio: rgba(255, 255, 255, .07);
  --vidrio-fuerte: rgba(255, 255, 255, .13);
  --linea: rgba(255, 255, 255, .16);
  --texto: #F4EEF0;
  --tenue: #B09AA1;
  --rojo: #D6334F;
  --vino: #9E2142;
  --rosa: #F7A3B2;
  --salmon: #F0788C;
  --verde: #7CC8A0;
  --ambar: #E3B25C;
  --alerta: #F27C7C;
  --radio: 20px;
  --desenfoque: blur(22px) saturate(170%);
  color-scheme: dark;
}

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

html, body {
  margin: 0;
  height: 100%;
  background: var(--fondo) url("/static/fondo_movil.jpg") center / cover fixed no-repeat;
  color: var(--texto);
  font: 400 15px/1.45 'Inter', system-ui, sans-serif;
}

body { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
body::before { content: ""; position: fixed; inset: 0; background: rgba(13, 10, 11, .55); z-index: -1; }

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; }
[hidden] { display: none !important; }

/* ---------- cabecera ---------- */
.cabecera {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--cristal); backdrop-filter: var(--desenfoque); -webkit-backdrop-filter: var(--desenfoque);
  border-bottom: 1px solid var(--linea);
}
.cabecera .logo { width: 34px; height: 34px; border-radius: 10px; }
.cabecera .titulo { flex: 1; min-width: 0; }
.cabecera .titulo b { font: 600 20px/1 'Playfair Display', serif; letter-spacing: .5px; display: block; }
.cabecera .titulo small { color: var(--tenue); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.punto { width: 7px; height: 7px; border-radius: 50%; background: var(--tenue); display: inline-block; }
.punto.vivo { background: var(--verde); box-shadow: 0 0 8px var(--verde); }
.punto.pensando { background: var(--ambar); animation: latido 1s infinite; }
@keyframes latido { 50% { opacity: .3; } }

.boton-icono {
  width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center;
  background: var(--vidrio); border: 1px solid var(--linea); font-size: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
}

.selector-modo {
  background: var(--vidrio); border: 1px solid var(--linea); border-radius: 999px; padding: 7px 12px; font-size: 13px;
}

/* ---------- conversación ---------- */
.chat { flex: 1; overflow-y: auto; padding: 16px 14px 8px; scroll-behavior: smooth; }
.vacio { text-align: center; color: var(--tenue); margin-top: 18vh; }
.vacio img { width: 84px; height: 84px; border-radius: 22px; opacity: .95; box-shadow: 0 10px 40px rgba(214, 51, 79, .35); }
.vacio h2 { font: 500 26px 'Playfair Display', serif; color: var(--texto); margin: 16px 0 4px; }

.mensaje { display: flex; margin: 10px 0; }
.mensaje.tu { justify-content: flex-end; }
.burbuja {
  max-width: 86%; padding: 11px 14px; white-space: pre-wrap; word-wrap: break-word;
  border-radius: var(--radio) var(--radio) var(--radio) 6px;
  background: var(--vidrio); border: 1px solid var(--linea);
  backdrop-filter: var(--desenfoque); -webkit-backdrop-filter: var(--desenfoque);
}
.mensaje.tu .burbuja {
  background: var(--vino); border-color: rgba(255, 255, 255, .22);
  border-radius: var(--radio) var(--radio) 6px var(--radio);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
}
.burbuja .quien { font-size: 11px; color: var(--rosa); letter-spacing: .4px; text-transform: uppercase; margin-bottom: 4px; }
.burbuja.error { border-color: #5A4421; color: var(--ambar); }
.fuentes { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.fuentes a { color: var(--salmon); font-size: 13px; text-decoration: none; }

.escribiendo span { display: inline-block; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: var(--rosa); animation: salto 1.2s infinite; }
.escribiendo span:nth-child(2) { animation-delay: .15s; }
.escribiendo span:nth-child(3) { animation-delay: .3s; }
@keyframes salto { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

/* ---------- barra para escribir ---------- */
.escribir {
  display: flex; gap: 8px; align-items: flex-end;
  padding: 10px 12px; padding-bottom: calc(10px + env(safe-area-inset-bottom));
  background: var(--cristal); backdrop-filter: var(--desenfoque); -webkit-backdrop-filter: var(--desenfoque);
  border-top: 1px solid var(--linea);
}
.escribir textarea {
  flex: 1; resize: none; max-height: 140px; padding: 11px 16px; border-radius: 22px;
  background: var(--vidrio); border: 1px solid var(--linea); outline: none;
}
.escribir textarea:focus { border-color: var(--rojo); }
.enviar {
  width: 46px; height: 46px; border-radius: 999px; background: var(--rojo); color: #fff; font-size: 20px;
  box-shadow: 0 6px 20px rgba(214, 51, 79, .45), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.enviar:disabled { opacity: .5; }

/* ---------- menú lateral ---------- */
.velo { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 10; }
.menu {
  position: fixed; top: 0; bottom: 0; left: 0; width: min(86vw, 360px); z-index: 11;
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px; padding-top: calc(16px + env(safe-area-inset-top)); padding-bottom: calc(16px + env(safe-area-inset-bottom));
  background: var(--cristal); backdrop-filter: var(--desenfoque); -webkit-backdrop-filter: var(--desenfoque);
  border-right: 1px solid var(--linea); overflow-y: auto;
}
.menu h3 { font: 500 13px 'Inter'; color: var(--tenue); text-transform: uppercase; letter-spacing: .8px; margin: 8px 4px 0; }
.boton {
  padding: 11px 16px; border-radius: 999px; background: var(--rojo); color: #fff; font-weight: 500;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}
.boton.secundario { background: var(--vidrio); border: 1px solid var(--linea); color: var(--texto); }
.tarjeta {
  padding: 12px 14px; border-radius: 16px; background: var(--vidrio); border: 1px solid var(--linea);
}
.conversacion { padding: 11px 12px; border-radius: 14px; cursor: pointer; }
.conversacion:active, .conversacion.activa { background: var(--vidrio-fuerte); }
.conversacion small { display: block; color: var(--tenue); font-size: 12px; }
.campo {
  width: 100%; padding: 12px 16px; border-radius: 14px; background: var(--vidrio); border: 1px solid var(--linea); outline: none;
}
.campo:focus { border-color: var(--rojo); }
.nota { font-size: 13px; color: var(--tenue); }
.nota.mal { color: var(--alerta); }
.nota.bien { color: var(--verde); }

/* ---------- inicio de sesión ---------- */
.login {
  position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; justify-content: center; gap: 12px;
  padding: 28px; background: rgba(13, 10, 11, .93) url("/static/fondo_movil.jpg") center / cover; background-blend-mode: multiply; backdrop-filter: var(--desenfoque); -webkit-backdrop-filter: var(--desenfoque);
}
.login img { width: 92px; height: 92px; border-radius: 24px; margin: 0 auto 6px; box-shadow: 0 10px 40px rgba(214, 51, 79, .4); }
.login h1 { font: 600 34px 'Playfair Display', serif; text-align: center; margin: 0 0 12px; }

/* ---------- contactos y chat entre personas ---------- */
.contacto { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 14px; cursor: pointer; }
.contacto:active { background: var(--vidrio-fuerte); }
.contacto .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--vino); display: grid; place-items: center; font-weight: 600; color: #fff; flex: 0 0 auto; }
.contacto .info { flex: 1; min-width: 0; }
.contacto .info b { display: block; }
.contacto .info small { color: var(--tenue); font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contacto .globo { background: var(--rojo); color: #fff; font-size: 12px; min-width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; padding: 0 6px; }
.persona-chat { position: fixed; inset: 0; z-index: 12; display: flex; flex-direction: column; background: var(--fondo) url("/static/fondo_movil.jpg") center / cover fixed; }
.persona-chat::before { content: ""; position: absolute; inset: 0; background: rgba(13, 10, 11, .6); }
.persona-chat > * { position: relative; }

/* ---------- llamada de voz ---------- */
.llamada-pantalla {
  position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 32px; text-align: center;
  background: var(--fondo) url("/static/fondo_movil.jpg") center / cover; color: var(--texto);
}
.llamada-pantalla::before { content: ""; position: absolute; inset: 0; background: rgba(13, 10, 11, .82); }
.llamada-pantalla > * { position: relative; }
.avatar-grande {
  width: 110px; height: 110px; border-radius: 50%; background: var(--vino); display: grid; place-items: center;
  font: 600 44px 'Playfair Display', serif; color: #fff; box-shadow: 0 10px 40px rgba(214, 51, 79, .45);
}
.llamada-pantalla h2 { font: 500 28px 'Playfair Display', serif; margin: 0; }
.llamada-estado { color: var(--tenue); font-size: 16px; }
.llamada-botones { display: flex; gap: 14px; margin-top: 24px; flex-wrap: wrap; justify-content: center; }
.llamada-botones .boton { min-width: 120px; }
.boton.colgar { background: #c0392b; }

.enlace { background: none; color: var(--rosa); font-size: 14px; padding: 8px; }
.login .nota { text-align: center; }

/* ---------- aviso de nueva versión ---------- */
.aviso {
  position: fixed; left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 15;
  padding: 12px 16px; border-radius: 16px; background: var(--vino); border: 1px solid rgba(255, 255, 255, .22);
  display: flex; align-items: center; gap: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}
.aviso span { flex: 1; font-size: 14px; }
