/* Find My Phone — Dashboard. Mismos colores que la app (finder/FinderParts.kt). */
:root {
  color-scheme: light;
  --blue: #2F62F2;
  --blue-dark: #2B5BEA;
  --blue-soft: #EEF3FE;
  --ink: #111111;
  --grey: #8E8E93;
  --text2: #555560;
  --bg: #F2F2F7;
  --card: #FFFFFF;
  --line: #E2E2E6;
  --red: #D93025;
  --green: #34A853;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--blue); font-weight: 600; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- Cargando */
.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid #D6DDF5; border-top-color: var(--blue); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- Botones */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 52px; border-radius: 26px; border: 0;
  font-weight: 600; font-size: 17px; font-family: inherit; cursor: pointer;
  transition: transform 0.08s, filter 0.15s, background 0.15s;
  text-decoration: none !important;
}
.btn:active { transform: scale(0.98); }
.btn.primary { color: #fff; background: linear-gradient(#3B6EF5, var(--blue-dark)); box-shadow: 0 8px 20px -10px var(--blue); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.outline { color: #3A3A3C; background: #fff; border: 1.5px solid #D1D1D6; }
.btn.outline:hover { background: #F7F8FB; }
.btn.danger { color: #fff; background: var(--red); }
.btn[disabled] { opacity: 0.7; cursor: default; }
.btn.loading { color: transparent; position: relative; }
.btn.loading::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,0.5); border-top-color: #fff; animation: spin 0.8s linear infinite; }
.g { font-weight: 800; color: #4285F4; font-size: 19px; }
.link.muted { color: var(--grey); font-weight: 500; }
.link { background: none; border: 0; color: var(--red); font-weight: 600; font-size: 15px; font-family: inherit; cursor: pointer; padding: 8px; }

/* ---------------------------------------------------------------- Entrar */
.auth {
  min-height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 28px 16px;
  background: linear-gradient(#EAF4FD, #fff 60%);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--card); border-radius: 28px; padding: 22px 22px 26px;
  box-shadow: 0 20px 50px -30px rgba(30, 60, 140, 0.45);
  text-align: center;
}
.owl { display: block; margin: -4px auto 4px; width: 170px; height: auto; }
.view { display: flex; flex-direction: column; gap: 12px; }
.hero { margin: 4px 0 0; font-size: 38px; line-height: 1.08; letter-spacing: -1px; font-weight: 800; }
.accent { color: var(--blue); }
h2 { margin: 6px 0 2px; font-size: 28px; font-weight: 800; text-align: left; }
.sub { margin: 0 0 10px; color: var(--text2); font-size: 16px; line-height: 1.4; }
.sub.left { text-align: left; }
.hint { margin: -4px 0 0; color: var(--grey); font-size: 13px; text-align: left; }
.switch { margin: 6px 0 0; color: var(--text2); font-size: 15px; }
.forgot { align-self: flex-end; font-size: 15px; }
.error { min-height: 0; margin: 0; color: var(--red); font-size: 14px; text-align: left; }
.error:empty, .ok:empty { display: none; }
.ok { margin: 0; color: var(--green); font-size: 14px; text-align: left; }
input {
  width: 100%; height: 54px; border-radius: 16px; border: 1.5px solid #D6D9E0;
  padding: 0 16px; font-size: 16px; font-family: inherit; color: var(--ink); background: #fff;
}
input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 98, 242, 0.15); }
.pw { position: relative; }
.pw input { padding-right: 70px; }
.eye { position: absolute; right: 8px; top: 9px; height: 36px; padding: 0 10px; border: 0; background: none; color: var(--grey); font-weight: 600; font-size: 14px; font-family: inherit; cursor: pointer; }
.card-note { text-align: left; background: var(--blue-soft); border-radius: 18px; padding: 16px; }
.card-note p { margin: 6px 0 0; color: var(--text2); line-height: 1.4; }
.foot { margin-top: 18px; color: var(--grey); font-size: 13px; }

/* ---------------------------------------------------------------- Dashboard */
.dash { height: 100%; display: flex; flex-direction: column; }
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; }
.brand img { border-radius: 9px; }
.me { display: flex; align-items: center; gap: 6px; color: var(--grey); font-size: 14px; min-width: 0; }
.me span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
.layout { flex: 1; display: flex; min-height: 0; }
.map { flex: 1; min-height: 0; background: #E8F1E4; }
.panel { width: 400px; overflow-y: auto; padding: 18px 16px; background: var(--bg); }
.panel-title { margin: 0 0 12px; }
.devices { display: flex; flex-direction: column; gap: 12px; }

.device {
  background: #fff; border-radius: 22px; padding: 16px; cursor: pointer;
  border: 2px solid transparent; transition: border-color 0.15s;
}
.device.sel { border-color: var(--blue); box-shadow: 0 12px 30px -20px var(--blue); }
.device-head { display: flex; gap: 12px; align-items: center; }
.phone-ico {
  flex: none; width: 46px; height: 46px; border-radius: 50%; background: #F1F3F8; position: relative;
}
.phone-ico::after {
  content: ""; position: absolute; left: 15px; top: 9px; width: 16px; height: 28px; border-radius: 4px;
  border: 2.5px solid #6B7280; background: linear-gradient(#DCE6FB, #fff);
}
.device-info { min-width: 0; }
.device h3 { margin: 0; font-size: 18px; font-weight: 700; }
.addr { margin: 3px 0 0; color: var(--text2); font-size: 14px; line-height: 1.35; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 14px 0; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.lbl { display: block; color: var(--grey); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.val { display: block; margin-top: 3px; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions .btn { height: 46px; font-size: 15px; }
.actions .btn:first-child { grid-column: 1 / -1; }
.ringing { margin: 10px 0 0; color: var(--blue); font-weight: 600; font-size: 14px; text-align: center; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }

.empty { text-align: center; background: #fff; border-radius: 22px; padding: 18px; }
.empty img { width: 140px; height: auto; }
.empty h3 { margin: 6px 0; font-size: 20px; }
.empty p { margin: 0; color: var(--text2); line-height: 1.45; }

/* El pin del mapa, azul como el de la app. */
.pin { position: relative; width: 40px; height: 52px; }
.pin::before {
  content: ""; position: absolute; left: 4px; top: 0; width: 32px; height: 32px;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: #7F9CF0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}
.pin.sel::before { background: var(--blue); }
.pin span { position: absolute; left: 14px; top: 10px; width: 12px; height: 12px; border-radius: 50%; background: #fff; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px;
  background: #1F2430; color: #fff; font-size: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.25); z-index: 1000;
}

/* Dentro de la app: la barra la pone la app. */
body.embedded .top { display: none; }
body.embedded .panel-title { display: none; }

/* ---------------------------------------------------------------- Movil */
@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .map { flex: none; height: 46vh; }
  body.embedded .map { height: 52vh; }
  .panel { width: 100%; flex: 1; }
  .hero { font-size: 34px; }
  .brand span { white-space: nowrap; font-size: 17px; }
  .me span { display: none; }
  .link { white-space: nowrap; }
}
