:root {
  --background: #0e0e0e;
  --surface: #1c1b1b;
  --surface-high: #2a2a2a;
  --surface-highest: #353534;

  --primary: #ffb800;
  --primary-hover: #ffc633;

  --text: #e5e2e1;
  --muted: #a9a6a3;
  --border: rgba(255, 255, 255, 0.08);

  --success: #32d583;
  --error: #ff6b6b;
}

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

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  min-height: 100dvh;
  overflow: hidden;

  background:
    radial-gradient(
      circle at 50% 10%,
      rgba(255, 184, 0, 0.07),
      transparent 34%
    ),
    linear-gradient(
      180deg,
      #131313 0%,
      var(--background) 100%
    );

  color: var(--text);
  font-family: "Inter", sans-serif;
}

button,
input {
  font: inherit;
}

/* Página */

.login-page {
  min-height: 100dvh;
  width: 100%;

  display: flex;
  align-items: center;
  justify-content: center;

  padding:
    max(24px, env(safe-area-inset-top))
    20px
    max(24px, env(safe-area-inset-bottom));
}

.login-container {
  width: 100%;
  max-width: 390px;

  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Marca */

.brand-header {
  width: 100%;
  text-align: center;

  display: flex;
  flex-direction: column;
  align-items: center;

  margin-bottom: 34px;
}

.brand-icon {
  width: 68px;
  height: 68px;

  display: flex;
  align-items: center;
  justify-content: center;

  margin-bottom: 14px;

  border-radius: 18px;

  background: var(--primary);
  color: #201600;

  box-shadow:
    0 12px 32px rgba(255, 184, 0, 0.16),
    0 0 0 1px rgba(255, 184, 0, 0.12);
}

.brand-icon .material-symbols-outlined {
  font-size: 38px;
}

.title {
  color: var(--primary);

  font-size: 34px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.subtitle {
  margin-top: 8px;

  color: var(--muted);

  font-size: 15px;
  font-weight: 500;
}

.profile-badge {
  display: inline-flex;

  margin-top: 8px;
  padding: 6px 12px;

  border: 1px solid var(--border);
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.035);

  color: var(--text);

  font-size: 12px;
  font-weight: 700;
}

/* PIN */

.pin-section {
  width: 100%;
  max-width: 350px;

  text-align: center;

  margin-bottom: 22px;
}

.pin-title {
  color: var(--muted);

  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.pin-display {
  width: 100%;

  display: flex;
  align-items: center;
  justify-content: center;

  gap: 18px;

  margin: 24px 0 18px;
  padding: 22px 18px;

  border: 1px solid var(--border);
  border-radius: 18px;

  background: rgba(32, 31, 31, 0.82);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 12px 32px rgba(0, 0, 0, 0.18);
}

.pin-dot {
  width: 15px;
  height: 15px;

  flex-shrink: 0;

  border-radius: 999px;

  background: #555453;

  transition:
    background-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.pin-dot.active {
  background: var(--primary);

  transform: scale(1.08);

  box-shadow:
    0 0 0 4px rgba(255, 184, 0, 0.08),
    0 0 16px rgba(255, 184, 0, 0.5);
}

.status {
  min-height: 22px;

  color: var(--muted);

  font-size: 14px;
  font-weight: 500;
}

.status.error {
  color: var(--error);
}

.status.success {
  color: var(--success);
}

/* Teclado */

.keyboard {
  width: 100%;
  max-width: 350px;

  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: 14px;
}

.key {
  width: 100%;
  height: 74px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px solid var(--border);
  border-radius: 18px;

  background: var(--surface);

  color: var(--text);

  font-size: 27px;
  font-weight: 800;

  cursor: pointer;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 8px 20px rgba(0, 0, 0, 0.12);

  transition:
    transform 120ms ease,
    background-color 120ms ease,
    color 120ms ease,
    border-color 120ms ease;
}

.key:hover {
  background: var(--surface-high);
  border-color: rgba(255, 184, 0, 0.16);
}

.key:active {
  transform: scale(0.94);

  background: var(--primary);
  color: #201600;
}

.key .material-symbols-outlined {
  font-size: 27px;
}

.key-secondary {
  background: #171717;
  color: var(--muted);
}

.key.primary {
  border-color: var(--primary);

  background: var(--primary);
  color: #201600;

  box-shadow:
    0 12px 28px rgba(255, 184, 0, 0.19),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.key.primary:hover {
  background: var(--primary-hover);
}

/* Rodapé */

.footer {
  width: 100%;

  margin-top: 30px;

  text-align: center;
}

.connection-status {
  display: flex;
  align-items: center;
  justify-content: center;

  gap: 7px;
}

.connection-dot {
  width: 8px;
  height: 8px;

  border-radius: 999px;

  background: var(--success);

  box-shadow: 0 0 10px rgba(50, 213, 131, 0.55);

  animation: connectionPulse 1.8s infinite ease-in-out;
}

.online {
  color: var(--success);

  font-size: 13px;
  font-weight: 700;
}

.sync-text {
  margin-top: 5px;

  color: var(--text);

  font-size: 12px;
  font-weight: 600;
}

.version {
  margin-top: 5px;

  color: #696765;

  font-size: 11px;
  font-weight: 500;
}

/* Estados */

.shake {
  animation: shake 350ms ease;
}

.fade-out {
  animation: fadeOut 350ms forwards;
}

/* Animações */

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-9px);
  }

  40% {
    transform: translateX(9px);
  }

  60% {
    transform: translateX(-6px);
  }

  80% {
    transform: translateX(6px);
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: scale(1.025);
  }
}

@keyframes connectionPulse {
  0%,
  100% {
    opacity: 0.55;
  }

  50% {
    opacity: 1;
  }
}

/* Celulares menores */

@media (max-height: 760px) {
  .login-page {
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .brand-header {
    margin-bottom: 22px;
  }

  .brand-icon {
    width: 56px;
    height: 56px;
  }

  .brand-icon .material-symbols-outlined {
    font-size: 32px;
  }

  .title {
    font-size: 30px;
  }

  .pin-display {
    margin-top: 18px;
    padding: 18px;
  }

  .key {
    height: 64px;
  }

  .footer {
    margin-top: 20px;
  }
}

/* Tablets e telas maiores */

@media (min-width: 768px) {
  .login-container {
    max-width: 430px;
  }

  .pin-section,
  .keyboard {
    max-width: 380px;
  }

  .key {
    height: 82px;
    font-size: 30px;
  }
}