* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #f0f4f8 0%, #e1e8ed 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #1e3a5f;
  -webkit-font-smoothing: antialiased;
}

.splash {
  position: fixed;
  inset: 0;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(14, 66, 148, 0.08), transparent 60%),
              linear-gradient(135deg, rgba(240,244,248,0.95) 0%, rgba(225,232,237,0.95) 100%);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 420ms ease;
}
.splash.show { opacity: 1; pointer-events: auto; }
.splash.fade-out { opacity: 0; pointer-events: none; }
.splash-text { font-size: 14px; color: #475569; animation: pulse 2s ease-in-out infinite; }

/* Revela a interface suavemente após o splash */
body .container { opacity: 0; transform: translateY(10px); transition: opacity 360ms ease, transform 360ms ease; }
body.ready .container { opacity: 1; transform: translateY(0); }
body.splashing { overflow: hidden; }

/* Reaparecimento da página após overlay */
.container.reappear { animation: appear 480ms ease both; }
@keyframes appear {
  0% { opacity: 0; transform: translateY(8px) scale(0.995); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.container {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  max-width: 400px;
  width: 100%;
  padding: 40px 32px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(30, 58, 95, 0.08);
}

.logo { width: 150px; height: 150px; margin: 0 auto 20px; }

.tutorial-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.step-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.step-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
}

.step-number {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.step-content {
  flex: 1;
}

.step-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 2px;
  line-height: 1.3;
}

.step-desc {
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
}

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; text-align: left; }
input {
  width: 100%; padding: 10px 12px; border: 1px solid #d0d7de; border-radius: 6px; font-size: 14px; margin-bottom: 6px; transition: border 0.15s; text-align: left;
}
input:focus { outline: none; border-color: #0969da; box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1); }

.hint { font-size: 12px; color: #656d76; margin-bottom: 16px; text-align: left; }

button { width: 100%; padding: 10px; background: #0969da; color: #fff; border: none; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.15s; }
button:hover { background: #0860ca; }
button:disabled { opacity: 0.6; cursor: not-allowed; }

.help { text-align: center; margin-top: 20px; padding-top: 20px; border-top: 1px solid #d0d7de; }
.help a { font-size: 13px; color: #475569; text-decoration: none; }
.help a:hover { color: #3b82f6; }
.footer { text-align: center; margin-top: 16px; font-size: 11px; color: #94a3b8; }
.footer .signature { display: block; margin-top: 6px; font-size: 11px; color: #9aa7b9; }
.footer .signature a { color: inherit; text-decoration: none; border-bottom: 1px dotted rgba(148,163,184,0.6); }
.footer .signature a:hover { color: #64748b; border-bottom-color: #64748b; }

.loader { 
    display: none; 
    padding: 24px 0; 
    text-align: center; 
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.loader.show { display: flex; }

/* Spinner padrão para requisições */
.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #cbd5e1;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-bottom: 8px;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border: 3px solid #cbd5e1;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loader-text {
    font-size: 14px; 
    color: #64748b; 
    font-weight: 500;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Overlay de carregamento alinhado com o splash */
.overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(14, 66, 148, 0.06), transparent 60%),
              linear-gradient(135deg, rgba(240,244,248,0.92) 0%, rgba(225,232,237,0.92) 100%);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  z-index: 9998;
  opacity: 0;
  transition: opacity 240ms ease;
}
.overlay.show { display: flex; opacity: 1; }

.overlay-text { font-size: 14px; color: #475569; }

.result { display: none; margin-top: 20px; padding: 16px; border-radius: 6px; font-size: 13px; }
.result.show { display: block; }
.result.success { background: #ecfdf5; color: #065f46; border: 1px solid #6ee7b7; }
.result.error { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
.result.qr { background: #f8fafc; border: 1px solid #cbd5e1; text-align: center; }

.qr-box { background: #ffffff; padding: 12px; border-radius: 6px; margin: 12px 0; border: 1px solid #cbd5e1; }
.qr-box img { width: 100%; max-width: 220px; }

/* Timer do QR Code - Discreto */
.qr-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 12px 0;
    gap: 6px;
}

.timer-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
    transition: all 0.3s ease;
}

.timer-text {
    color: white;
    font-size: 11px;
    font-weight: 600;
}

.timer-label {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 400;
}

.steps { text-align: left; font-size: 12px; color: #64748b; margin-top: 12px; line-height: 1.6; }
.steps ol { margin: 8px 0 0 16px; }
.instance { font-size: 11px; color: #94a3b8; margin-top: 8px; }

.row { display: flex; gap: 8px; margin-top: 10px; }
.row button { flex: 1; }

@media (max-width: 480px) { .container { padding: 32px 24px; } }


