:root{
  /* Light / “integrado con el navegador” */
  --bg0: #F6F7FB;
  --bg1: #EEF1F7;

  --text: rgba(11,18,32,0.92);
  --muted: rgba(11,18,32,0.62);
  --muted2: rgba(11,18,32,0.42);

  --card: rgba(255,255,255,0.72);
  --cardBorder: rgba(15,23,42,0.10);
  --shadow: 0 20px 70px rgba(20,35,60,0.12);

  --surface1: rgba(15,23,42,0.04);
  --surface2: rgba(15,23,42,0.06);
  --surface3: rgba(15,23,42,0.08);
  --stroke1: rgba(15,23,42,0.12);
  --stroke2: rgba(15,23,42,0.18);

  --danger: rgba(190,18,60,0.92);
  --focus: rgba(59,130,246,0.45);

  --radiusCard: 22px;
  --radiusBtn: 16px;
  --press: 180ms;
}

*{ box-sizing: border-box; }

html, body{
  height: 100%;
}

body{
  margin: 0;
  color: var(--text);
  color-scheme: light;
  background-color: var(--bg0);
  background: radial-gradient(1200px 800px at 30% 10%, rgba(105,155,255,0.22) 0%, transparent 60%),
              radial-gradient(900px 600px at 70% 25%, rgba(110,235,210,0.18) 0%, transparent 55%),
              linear-gradient(180deg, var(--bg0), var(--bg1));
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.bg{
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(700px 380px at 50% 38%, rgba(0,0,0,0.03), transparent 60%),
    radial-gradient(900px 520px at 20% 85%, rgba(110,235,210,0.10), transparent 60%),
    radial-gradient(900px 560px at 80% 88%, rgba(105,155,255,0.10), transparent 60%);
  filter: blur(0px);
  opacity: 1;
}

/* grano sutil (sin imágenes) */
.bg::after{
  content:"";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(0,0,0,0.07) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: 0.06;
  mix-blend-mode: multiply;
}

.top{
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 18px 18px 0;

  display: flex;              /* ✅ */
  justify-content: center;    /* ✅ */
}

.brand{
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.60);
  border: 1px solid var(--cardBorder);
  backdrop-filter: blur(10px);
}

.brandMark{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.04));
  border: 1px solid var(--stroke1);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.brandText{ line-height: 1.05; }
.brandName{
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(11,18,32,0.80);
}
.brandTag{
  font-size: 12px;
  color: var(--muted2);
  margin-top: 4px;
}

.wrap{
  min-height: calc(100% - 86px);
  display: grid;
  place-items: center;
  padding: 18px;
}

.card{
  width: min(440px, 100%);
  padding: 24px 20px 18px;
  border-radius: var(--radiusCard);
  background: var(--card);
  border: 1px solid var(--cardBorder);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

h1{
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.subtitle{
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.pin{
  margin: 12px 0 12px;
}

.pinSlots{
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.slot{
  height: 44px;
  border-radius: 14px;
  background: rgba(255,255,255,0.60);
  border: 1px solid var(--stroke1);
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
  color: rgba(11,18,32,0.82);
  user-select: none;
}

.slot.filled{
  background: rgba(255,255,255,0.72);
  border-color: var(--stroke2);
}

.status{
  min-height: 24px;
  margin: 8px 0 14px;
  font-size: 14px;
  color: rgba(11,18,32,0.82);
}

.status.deny{
  color: var(--danger);
}

.keypad{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  touch-action: manipulation;
}

.key{
  height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 6px;
  border-radius: var(--radiusBtn);
  border: 1px solid var(--stroke1);
  background: rgba(255,255,255,0.58);
  color: rgba(11,18,32,0.92);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform var(--press) ease, background var(--press) ease, border-color var(--press) ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.keySecondary{
  font-size: 14px;
  font-weight: 600;
  color: rgba(11,18,32,0.76);
}

.key:hover{
  background: rgba(255,255,255,0.68);
  border-color: var(--stroke2);
}

.key:active{
  transform: translateY(1px) scale(0.995);
  background: rgba(255,255,255,0.76);
}

.key:focus-visible{
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.key[disabled]{
  opacity: 0.55;
  cursor: not-allowed;
}

.hint{
  margin: 14px 2px 0;
  font-size: 12px;
  color: var(--muted2);
}

.foot{
  margin-top: 18px;
  font-size: 12px;
  color: rgba(11,18,32,0.38);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.dot{
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(11,18,32,0.24);
}

/* Shake discreto */
@keyframes microShake{
  0%{ transform: translateX(0); }
  20%{ transform: translateX(-4px); }
  40%{ transform: translateX(4px); }
  60%{ transform: translateX(-3px); }
  80%{ transform: translateX(3px); }
  100%{ transform: translateX(0); }
}

.card.shake{
  animation: microShake 260ms ease;
}

/* A11y helpers */
.srOnly{
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  .key{ transition: none; }
  .card.shake{ animation: none; }
  .bg::after{ opacity: 0.04; }
}

.brandLogo{
  width: 80px;
  height: 80px;
  display: block;
  margin: 0 auto;   /* ✅ centra la imagen */
}

.card h1,
.card .subtitle{
  text-align: center;
}

/* Keypad: digits + letters (old phone style) */
.keyDigit{
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.keyLetters{
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1;
  color: rgba(11,18,32,0.52);
}

.keyLettersEmpty{
  opacity: 0.0;
  height: 10px; /* keeps consistent vertical rhythm */
}

/* Keep secondary actions comfortably readable */
.key.keySecondary{
  gap: 0;
  padding: 0 10px;
}

@media (max-width: 360px){
  .wrap{ padding: 12px; }
  .card{ padding: 20px 16px 16px; }
  h1{ font-size: 24px; }
  .keypad{ gap: 8px; }
  .key{ height: 52px; }
  .pinSlots{ gap: 8px; }
  .slot{ height: 40px; }
}

.key{
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}