/** Estructura: shell, área de contenido, barra inferior y pantalla de bloqueo. */

/* --- Shell ---------------------------------------------------------------- */

.app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  opacity: 0;
  transition: opacity 240ms var(--ease);
}

/* Aparece al desbloquear, no antes: evita el destello del contenido detrás
   de la pantalla de PIN. */
.app--unlocked {
  opacity: 1;
}

.view {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  /* El padding inferior reserva la altura de la barra más el área segura del
     gesto de inicio de Android. */
  padding:
    calc(var(--safe-top) + var(--space-5))
    var(--space-4)
    calc(var(--tabbar-height) + var(--safe-bottom) + var(--space-5));
}

.view__title {
  font-size: var(--text-2xl);
}

.view > * {
  animation: rise 280ms var(--ease) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* --- Barra inferior ------------------------------------------------------- */

.tabbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  height: calc(var(--tabbar-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  border-top: 1px solid var(--border);
  background: rgba(7, 9, 15, 0.82);
  backdrop-filter: blur(16px);
}

.tabbar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 100%;
  color: var(--text-faint);
  transition: color var(--duration) var(--ease);
}

.tabbar__item--active {
  color: var(--accent);
}

.tabbar__icon {
  width: 22px;
  height: 22px;
}

.tabbar__label {
  font-size: 0.6875rem;
  letter-spacing: 0.01em;
}

/* Botón central de añadir: es la acción más frecuente, así que se eleva sobre
   la barra y se destaca con el acento. */
.tabbar__item--primary {
  position: relative;
  color: #04120f;
}

.tabbar__item--primary .tabbar__icon {
  position: absolute;
  top: -18px;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 14px;
  border-radius: var(--radius-full);
  background: var(--accent);
  box-shadow: var(--shadow-glow);
  transition: transform var(--duration) var(--ease);
}

.tabbar__item--primary:active .tabbar__icon {
  transform: scale(0.93);
}

.tabbar__item--primary .tabbar__label {
  margin-top: 30px;
  color: var(--text-faint);
}

.tabbar__item--primary.tabbar__item--active .tabbar__label {
  color: var(--accent);
}

/* --- Pantalla de bloqueo -------------------------------------------------- */

.lock {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: var(--space-5);
  background: var(--bg);
  background-image: radial-gradient(90% 55% at 50% 0%, rgba(124, 108, 255, 0.18), transparent 60%);
}

.lock--visible {
  display: grid;
}

.lock__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 20rem;
  text-align: center;
}

.lock__brand {
  margin-bottom: var(--space-6);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: var(--accent);
}

.lock__title {
  font-size: var(--text-xl);
}

.lock__subtitle {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.lock__dots {
  display: flex;
  gap: var(--space-4);
  margin: var(--space-6) 0 var(--space-3);
}

.lock__dot {
  width: 13px;
  height: 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  transition: background var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.lock__dot--on {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.lock__message {
  min-height: 1.5em;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.lock__message--error {
  color: var(--negative);
}

.lock__disclaimer {
  margin-top: var(--space-5);
  font-size: var(--text-xs);
  color: var(--text-faint);
}

/* --- Teclado numérico ----------------------------------------------------- */

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  width: 100%;
  /* El ancho se limita aquí, no en la tecla: así cada tecla llena su columna y
     los huecos son los del `gap`, no el sobrante de un tamaño máximo. */
  max-width: 17rem;
  margin: var(--space-5) auto 0;
}

.keypad__key {
  /* Cuadrada y generosa: se usa con el pulgar y a veces con prisa. */
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-family: var(--font-numeric);
  font-size: var(--text-xl);
  color: var(--text);
  background: var(--surface);
  transition: background var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.keypad__key:active {
  transform: scale(0.94);
  background: var(--surface-strong);
}

.keypad__key--action {
  display: grid;
  place-items: center;
  border-color: transparent;
  background: none;
  color: var(--text-muted);
}

.keypad__icon {
  width: 26px;
  height: 26px;
}

.keypad__spacer {
  /* Hueco a la izquierda del cero, para que quede centrado. */
}
