:root {
  --bg: #0f172a;
  --panel: #111827;
  --muted: #94a3b8;
  --text: #e5e7eb;
  --brand: #22d3ee;
  --brand-strong: #06b6d4;
  --success: #34d399;
  --warning: #f59e0b;
  --danger: #ef4444;
  --ring: rgba(34, 211, 238, .35);
  --card: #0b1220;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  zoom: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial;
  background: radial-gradient(farthest-corner at 80% 0%, rgba(6, 182, 212, .18), transparent 60%), radial-gradient(farthest-corner at 0% 100%, rgba(52, 211, 153, .14), transparent 60%), var(--bg);
  color: var(--text);
  display: flex;
  padding: 24px;
  overflow-y: auto;
}

.app {
  width: 100%;
  max-width: 980px;
  display: grid;
  gap: 24px;
  grid-template-columns: 1.2fr .8fr;
  margin: auto;
}

@media (max-width: 860px) {
  body {
    padding: 16px;
    align-items: flex-start;
  }

  .app {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, 0)), var(--card);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-grow: 1;
}

.balance {
  text-align: right;
  flex-shrink: 0;
}

.balance span {
  font-size: 12px;
  color: var(--muted);
  display: block;
}

.balance strong {
  font-size: 20px;
  color: var(--success);
}

h1 {
  font-size: 20px;
  margin: 0;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.stamp-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-top: 14px;
}

#grid-top {
  margin-bottom: 14px;
}

.stamp {
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, 0)), #0a1322;
  border: 1px dashed rgba(148, 163, 184, .35);
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: transform .18s ease;
  user-select: none;
}

.stamp:hover {
  transform: translateY(-2px);
}

.stamp.redeemable {
  cursor: pointer;
  border-color: var(--success);
  box-shadow: 0 0 15px rgba(52, 211, 153, .4);
  animation: bounce 1.5s ease-in-out infinite;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

.stamp .hint {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}

.stamp .icon {
  font-size: 28px;
  opacity: .75;
}

.stamp.filled {
  border-style: solid;
  border-color: rgba(34, 211, 238, .5);
  background: radial-gradient(120px 120px at 70% 30%, rgba(34, 211, 238, .28), transparent 60%), linear-gradient(180deg, rgba(34, 211, 238, .18), rgba(255, 255, 255, 0)), #07101c;
  box-shadow: inset 0 0 0 2px rgba(34, 211, 238, .15), 0 10px 30px rgba(34, 211, 238, .18);
}

.check {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(.6) rotate(-8deg);
  transition: all .25s cubic-bezier(.2, .7, .2, 1.2);
  font-size: 30px;
}

.stamp.filled .check {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.pulse {
  position: absolute;
  inset: -2px;
  border-radius: 18px;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 0 0 0 var(--ring);
  animation: none;
}

.stamp.pulse-on .pulse {
  opacity: 1;
  animation: pulse .7s ease-out 1;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 var(--ring)
  }

  100% {
    box-shadow: 0 0 0 18px transparent
  }
}

.form {
  display: grid;
  gap: 12px;
  margin-top: 6px;
}

label {
  font-size: 13px;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

input {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, .25);
  background: #0b1425;
  color: var(--text);
  outline: none;
  font-size: 16px;
}

input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--ring);
}

input[type="date"] {
  color-scheme: dark;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button,
.btn-link {
  border: 0;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
  color: #062028;
  font-weight: 700;
  letter-spacing: .2px;
  box-shadow: 0 10px 24px rgba(6, 182, 212, .35);
  transition: transform .15s ease, filter .15s ease;
  text-decoration: none;
  font-size: 14px;
  text-align: center;
}

button:hover,
.btn-link:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.7);
  opacity: .7;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(148, 163, 184, .25);
  box-shadow: none;
}

.progress {
  position: relative;
  height: 24px;
  background: #0a1422;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 14px;
}

.progress>#bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--success), var(--brand));
  transition: width .35s ease;
}

.progress>#counter {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--bg);
}

.note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 14px;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(3, 6, 23, .75);
  padding: 20px;
  z-index: 50;
}

.modal.open {
  display: grid;
}

.modal-content {
  width: 100%;
  max-width: 510px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.modal-content h2 {
  margin: 0 0 4px 0;
}

.modal-content .row {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

#alertModal .modal-content h2 {
  color: var(--danger);
}

.gift {
  background-image: radial-gradient(220px 120px at -10% -10%, rgba(34, 211, 238, .18), transparent 60%), radial-gradient(180px 120px at 110% 110%, rgba(52, 211, 153, .14), transparent 60%);
}

.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed rgba(148, 163, 184, .35);
  background: #0a1322;
  letter-spacing: 1.2px;
  display: inline-block;
  margin: 8px 0;
}

.igm-logo {
  width: 4rem;
  height: 5rem;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #002d34;
  letter-spacing: .5px;
  margin: 0 auto 12px auto;
}

/* --- AJUSTES RESPONSIVOS GERAIS --- */
@media (max-width: 980px) { /* <-- Alterado de 860px para 980px */
  body {
    padding: 16px;
    align-items: flex-start; /* Garante o alinhamento no topo em telas menores */
  }

  .app {
    grid-template-columns: 1fr; /* Força uma única coluna */
    gap: 16px;
    width: 100%; /* Ocupa toda a largura disponível */
    max-width: 500px; /* Adiciona uma largura máxima para não ficar muito largo */
  }
}

/* Estilo para o painel de logout */
.user-info-panel {
  text-align: center;
  margin-top: 20px;
  border-top: 1px solid rgba(148, 163, 184, .20);
  padding-top: 15px;
}

.user-info-panel p {
  margin: 0 0 10px 0;
  font-size: 12px;
}

/* Reutilizando e ajustando o estilo de botão existente */
.user-info-panel button {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, .25);
  color: var(--muted);
  box-shadow: none;
  padding: 8px 14px;
  font-size: 13px;
  width: auto;
}

.user-info-panel button:hover {
  background: var(--ring);
  border-color: var(--brand);
  color: var(--text);
}