/* =========================================
   PERFIL: KIOSK TOUCH INDUSTRIAL
   10" + 15" | Linux | Fullscreen | Dedo
========================================= */

:root {
  --touch-min: 80px;
  --touch-ideal: 100px;
  --touch-large: 130px;
}

/* =========================================
   WRAPPER PRINCIPAL
========================================= */

.ui-teclado-codigo__codigo-wrapper {
  width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(1.5rem, 2vw, 3rem);

  display: flex;
  flex-direction: row;

  /* 👇 muda aqui */
  align-items: flex-start; 
  justify-content: center;

  padding-top: clamp(2rem, 38vh, 5rem);
  gap: clamp(2rem, 4vw, 6rem);
}

/* =========================================
   LADO ESQUERDO
========================================= */

.ui-teclado-codigo__lado-esquerdo {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* TÍTULO */
.ui-teclado-codigo__titulo {
  font-size: clamp(2.4rem, 3vw, 3.8rem);
  font-weight: 700;
  margin-bottom: 2.5rem;
  color: #1a1a1a;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* =========================================
   CÓDIGO (DIGITOS)
========================================= */

.ui-teclado-codigo__codigo {
  display: flex;
  gap: clamp(14px, 2vw, 26px);
  margin: 2.5rem 0;
}

.ui-teclado-codigo__digito {
  width: clamp(80px, 6vw, 120px);
  height: clamp(90px, 8vh, 130px);
  border-radius: 18px;
  border: 3px solid #cfcfcf;
  background: #ffffff;
  font-size: clamp(38px, 3vw, 64px);
  font-weight: bold;
  text-align: center;
  line-height: clamp(86px, 8vh, 126px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.18);
  transition: all 0.15s ease;
}

/* =========================================
   TIMER
========================================= */

.process-timer {
  font-size: clamp(2.2rem, 2.5vw, 3.4rem);
  font-weight: 700;
  margin-top: 1rem;
}

/* =========================================
   BOTÃO VOLTAR
========================================= */

.btn-voltar {
  margin-top: 2rem;
  font-size: clamp(1.2rem, 1.4vw, 1.6rem);
  padding: 20px 42px;
  border-radius: 14px;
}

/* =========================================
   LADO DIREITO
========================================= */

.ui-teclado-codigo__lado-direito {
  flex: 0 0 clamp(420px, 28vw, 640px);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* =========================================
   GRID DO TECLADO (3x4)
========================================= */

.ui-teclado-codigo__teclado {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(4, clamp(var(--touch-min), 12vh, var(--touch-large)));
  gap: clamp(14px, 1.6vw, 26px);
  width: 100%;
}

/* =========================================
   TECLAS
========================================= */

.ui-teclado-codigo__tecla {
  width: 100%;
  height: 100%;
  font-size: clamp(30px, 2.6vw, 48px);
  font-weight: 600;
  border-radius: 24px;
  border: none;
  background: #f1f1f1;
  box-shadow: 0 10px 22px rgba(0,0,0,0.22);
  cursor: pointer;
  transition: all 0.12s ease;
  min-height: var(--touch-min);
  touch-action: manipulation;
}

/* Feedback forte para toque */
.ui-teclado-codigo__tecla:active {
  transform: scale(0.92);
  background: #dcdcdc;
  box-shadow: inset 0 6px 14px rgba(0,0,0,0.25);
}

/* ZERO ocupa 2 colunas */
.ui-teclado-codigo__tecla--zero {
  grid-column: span 2;
}

/* BACKSPACE */
.ui-teclado-codigo__tecla--backspace {
  background: #e8e8e8;
  font-size: clamp(24px, 2vw, 36px);
}

/* =========================================
   ERRO
========================================= */

.ui-teclado-codigo--erro {
  animation: shake 0.3s;
}

.ui-teclado-codigo--erro .ui-teclado-codigo__digito {
  border-color: #dc3545;
  background: #ffe9ec;
  color: #dc3545;
}

/* SHAKE */
@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-8px); }
  100% { transform: translateX(0); }
}

/* =========================================
   RESPONSIVO PORTRAIT (caso gire)
========================================= */

@media (orientation: portrait) {

  .ui-teclado-codigo__codigo-wrapper {
    flex-direction: column;
  }

  .ui-teclado-codigo__lado-direito {
    width: 100%;
    max-width: 520px;
  }
}

/* =========================================
   TELAS GRANDES (15")
========================================= */

@media (min-width: 1600px) {

  .ui-teclado-codigo__titulo {
    font-size: 4rem;
  }

  .ui-teclado-codigo__tecla {
    font-size: 52px;
  }

  .ui-teclado-codigo__digito {
    width: 130px;
    height: 140px;
    font-size: 70px;
  }
}

/* =========================================
   CONFIGURAÇÕES KIOSK
========================================= */

/* Bloqueia seleção */
* {
  user-select: none;
  -webkit-user-select: none;
}

/* Remove highlight azul */
button,
.ui-teclado-codigo__tecla {
  -webkit-tap-highlight-color: transparent;
}

/* Esconde cursor */
body {
  cursor: none;
}