@font-face {
  font-family: 'Graphik';
  src: url('/fonts/Inter-Regular.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'Graphik';
  src: url('/fonts/Inter-Medium.ttf') format('truetype');
  font-weight: 500;
}
@font-face {
  font-family: 'Graphik';
  src: url('/fonts/Inter-Bold.ttf') format('truetype');
  font-weight: 700;
}

:root {
  --theme-bg: #FFFFFF;
  --theme-text: #000000;
  --theme-field-bg: #F2F2F2;
  --theme-border: rgba(0, 0, 0, 0.12);
  --accent: #ff7b00;
  --accent-soft: rgba(255, 123, 0, 0.14);
  --accent-border: rgba(255, 123, 0, 0.45);
  --accent-shadow: rgba(255, 123, 0, 0.28);
}
:root[data-theme="dark"] {
  --theme-bg: #161616;
  --theme-text: #FFFFFF;
  --theme-field-bg: #232323;
  --theme-border: rgba(255, 255, 255, 0.14);
}

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

/* Scroll continua funcionando — só a barrinha visual some. */
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
*::-webkit-scrollbar {
  display: none;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--theme-bg);
  color: var(--theme-text);
  font-family: 'Graphik', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.login-screen {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  background: var(--theme-bg);
  overflow: hidden;
}

/* Dois glows desfocados (não só um) — mesma técnica de profundidade do
   popup de erro no app protegido (círculos sobrepostos em laranja),
   aqui espalhados pros dois cantos opostos da tela pra enquadrar o
   cartão sem competir com ele. */
.login-glow {
  position: absolute;
  top: -160px;
  left: 50%;
  transform: translateX(-50%);
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.16;
  filter: blur(90px);
  pointer-events: none;
}

.login-glow::after {
  content: '';
  position: absolute;
  top: 420px;
  left: -120px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.08;
  filter: blur(90px);
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  animation: login-card-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes login-card-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.receipt-logo-icon {
  width: 140px;
  height: auto;
  margin-top: -10px;
  object-fit: contain;
}

.login-brand-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-title {
  margin: 0;
  font-size: 24px;
  font-weight: 550;
}

.login-subtitle {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--theme-text);
  opacity: 0.5;
  line-height: 1.5;
  padding: 0 10px;
}

/* Um único cartão pros dois campos, separados por um fio — a borda
   acende em laranja quando qualquer campo dentro está focado
   (:focus-within), dando feedback sem precisar de JS. */
.login-fields-card {
  display: flex;
  flex-direction: column;
  background: var(--theme-field-bg);
  border: 1px solid transparent;
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.login-fields-card:focus-within {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
}

.login-field-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  opacity: 0.4;
}

.login-field-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-field-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--theme-text);
  opacity: 0.35;
  transition: color 0.18s ease, opacity 0.18s ease;
}

.login-field-row:focus-within .login-field-icon {
  color: var(--accent);
  opacity: 1;
}

.login-field-icon svg {
  width: 100%;
  height: 100%;
}

.login-input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  padding: 0;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  color: var(--theme-text);
  outline: none;
}

.login-input::placeholder {
  color: var(--theme-text);
  opacity: 0.35;
}

.login-field-divider {
  height: 1px;
  margin: 0 16px;
  background: var(--theme-border);
}

.login-eye-btn {
  flex-shrink: 0;
  display: flex;
  background: none;
  border: none;
  width: 22px;
  height: 22px;
  padding: 0;
  opacity: 0.4;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.login-eye-btn:active {
  opacity: 0.7;
  transform: scale(0.9);
}

.login-eye-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-submit-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #FFFFFF;
  border: none;
  border-radius: 16px;
  padding: 16px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  box-shadow: 0 8px 20px var(--accent-shadow);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.login-submit-btn:active {
  transform: scale(0.98);
}

.login-submit-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: login-btn-spin 0.8s linear infinite;
}

.login-submit-btn.loading {
  opacity: 0.85;
  pointer-events: none;
}

.login-submit-btn.loading .login-submit-text {
  display: none;
}

.login-submit-btn.loading .login-submit-spinner {
  display: block;
}

@keyframes login-btn-spin {
  to { transform: rotate(360deg); }
}

.login-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.login-popup-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.login-popup {
  width: 100%;
  max-width: 320px;
  background: var(--theme-bg);
  color: var(--theme-text);
  border: 1px solid var(--theme-border);
  border-radius: 22px;
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.22);
  transform: scale(0.94);
  transition: transform 0.22s cubic-bezier(0.32, 0.72, 0, 1);
}

.login-popup-overlay.visible .login-popup {
  transform: scale(1);
}

.login-popup-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 4px;
}

.login-popup-icon svg {
  width: 26px;
  height: 26px;
}

.login-popup-title {
  font-size: 16px;
  font-weight: 700;
}

.login-popup-message {
  font-size: 13.5px;
  opacity: 0.6;
  line-height: 1.5;
}

.login-popup-btn {
  margin-top: 12px;
  width: 100%;
  background: var(--accent);
  color: #FFFFFF;
  border: none;
  border-radius: 14px;
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
}

[hidden] {
  display: none !important;
}
