/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #f0f4f8;
  color: #1a202c;
  min-height: 100vh;
}

/* ── Login page ───────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a3a5c 0%, #c8102e 100%);
  padding: 1rem;
}

.login-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
}

.login-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}
.login-logo .emoji { font-size: 2.5rem; display: block; }
.login-logo h1    { font-size: 1.3rem; font-weight: 700; margin-top: .4rem; }
.login-logo p     { font-size: .8rem;  color: #718096;  margin-top: .2rem; }

.tabs {
  display: flex;
  border-radius: 8px;
  background: #edf2f7;
  padding: 3px;
  margin-bottom: 1.5rem;
}
.tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: .5rem;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
  color: #718096;
}
.tab.active { background: white; color: #1a202c; box-shadow: 0 1px 4px rgba(0,0,0,.1); }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: .35rem; color: #4a5568; }
.form-group input {
  width: 100%;
  padding: .6rem .85rem;
  border: 1.5px solid #cbd5e0;
  border-radius: 8px;
  font-size: .9rem;
  transition: border-color .15s;
  outline: none;
}
.form-group input:focus { border-color: #1a3a5c; }

.btn-primary {
  width: 100%;
  padding: .7rem;
  background: linear-gradient(135deg, #1a3a5c, #c8102e);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: .5rem;
  transition: opacity .15s;
}
.btn-primary:hover    { opacity: .9; }
.btn-primary:disabled { opacity: .6; cursor: default; }

.error-msg {
  background: #fff5f5;
  border: 1px solid #fc8181;
  color: #c53030;
  border-radius: 8px;
  padding: .6rem .85rem;
  font-size: .82rem;
  margin-bottom: 1rem;
}

/* ── Album layout ─────────────────────────────────────────────────────────── */
.app-header {
  background: linear-gradient(135deg, #1a3a5c, #c8102e);
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.app-header h1     { font-size: 1.2rem; font-weight: 700; }
.app-header p      { font-size: .78rem; opacity: .8; margin-top: .1rem; }

.user-info      { display: flex; align-items: center; gap: .75rem; }
.user-greeting  { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.greeting-label { font-size: .72rem; opacity: .75; }
.greeting-name  { font-size: 1rem; font-weight: 700; }
.btn-logout {
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.4);
  color: white;
  padding: .3rem .75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 600;
  transition: background .15s;
}
.btn-logout:hover { background: rgba(255,255,255,.35); }

/* ── Stats bar ────────────────────────────────────────────────────────────── */
.stats-bar {
  background: white;
  padding: .65rem 1.5rem;
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  border-bottom: 1px solid #e2e8f0;
  font-size: .82rem;
}
.stat { display: flex; align-items: center; gap: .4rem; font-weight: 600; }
.dot  { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot-total { background: #718096; }
.dot-tenho { background: #38a169; }
.dot-falta { background: #e53e3e; }

.progress-wrap { background: white; padding: .4rem 1.5rem .65rem; border-bottom: 1px solid #e2e8f0; }
.progress-label { font-size: .72rem; color: #718096; margin-bottom: .3rem; }
.progress-bar   { height: 7px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.progress-fill  { height: 100%; background: #38a169; border-radius: 99px; transition: width .4s; }

/* ── Toolbar ──────────────────────────────────────────────────────────────── */
.toolbar {
  background: white;
  border-bottom: 1px solid #e2e8f0;
  padding: .65rem 1.5rem;
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar input[type="text"],
.toolbar input:not([type]) {
  flex: 1;
  min-width: 150px;
  padding: .38rem .75rem;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: .82rem;
  outline: none;
}
.toolbar input[type="text"]:focus,
.toolbar input:not([type]):focus { border-color: #1a3a5c; }

/* ── Toolbar buttons ──────────────────────────────────────────────────────── */
.toolbar-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  width: 36px;
  height: 36px;
  border: 1.5px solid #cbd5e0;
  border-radius: 7px;
  background: white;
  color: #4a5568;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  flex-shrink: 0;
}
.toolbar-btn:hover         { border-color: #1a3a5c; background: #f7fafc; color: #1a3a5c; }
.toolbar-btn--active       { border-color: #1a3a5c; color: #1a3a5c; background: #eef2f7; }
.toolbar-btn i             { font-size: .85rem; }
.toolbar-btn--whatsapp     { color: #25d366; border-color: #25d366; }
.toolbar-btn--whatsapp:hover { background: #f0fff4; border-color: #1da851; color: #1da851; }

/* ── Toast copiado ───────────────────────────────────────────────────────── */
.toast-copied {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(1rem);
  background: #25d366;
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  padding: .55rem 1.2rem;
  border-radius: 99px;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 1000;
}
.toast-copied.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.btn-chevron { font-size: .6rem !important; }

.active-dot {
  position: absolute;
  top: 3px; right: 3px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #c8102e;
  border: 1.5px solid white;
}

.btn-chevron { transition: transform .2s; }
.btn-chevron.rotated { transform: rotate(180deg); }

/* ── Dropdown ─────────────────────────────────────────────────────────────── */
.filter-dropdown { position: relative; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: .5rem 0;
  min-width: 210px;
  z-index: 50;
}

.dropdown-section { padding: .4rem .85rem; }

.dropdown-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #a0aec0;
  margin-bottom: .35rem;
}

/* Status pills */
.dd-pills { display: flex; gap: .4rem; flex-wrap: wrap; }

.dd-pill.dd-pill--all { flex: 0 0 100%; }

.dd-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  padding: .4rem .5rem;
  border-radius: 7px;
  border: 1.5px solid #e2e8f0;
  background: #f7fafc;
  color: #4a5568;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.dd-pill:hover           { border-color: #a0aec0; }
.dd-pill.active          { background: #edf2f7; border-color: #1a3a5c; color: #1a3a5c; }
.dd-pill--falta:hover    { border-color: #fc8181; }
.dd-pill--falta.active   { background: #fff5f5; border-color: #e53e3e; color: #c53030; }
.dd-pill--tenho:hover    { border-color: #9ae6b4; }
.dd-pill--tenho.active   { background: #f0fff4; border-color: #38a169; color: #276749; }

/* Group grid */
.dd-groups { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; }

.dd-group-all {
  grid-column: 1 / -1;
  padding: .35rem;
  border-radius: 6px;
  border: 1.5px solid #e2e8f0;
  background: #f7fafc;
  color: #4a5568;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.dd-group-all:hover  { border-color: #a0aec0; }
.dd-group-all.active { background: #edf2f7; border-color: #1a3a5c; color: #1a3a5c; }

.dd-group-btn {
  padding: .35rem;
  border-radius: 6px;
  border: 1.5px solid #e2e8f0;
  background: #f7fafc;
  color: #4a5568;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
}
.dd-group-btn:hover  { border-color: #a0aec0; }
.dd-group-btn.active { background: #1a3a5c; border-color: #1a3a5c; color: white; }

.dropdown-divider { height: 1px; background: #e2e8f0; margin: .35rem 0; }

/* ── Section cards ────────────────────────────────────────────────────────── */
.main { padding: 1rem 1.5rem; max-width: 1200px; margin: 0 auto; }

.section-card { background: white; border-radius: 10px; margin-bottom: 1rem; box-shadow: 0 1px 4px rgba(0,0,0,.07); overflow: hidden; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7rem 1rem;
  cursor: pointer;
  user-select: none;
  gap: .5rem;
}
.section-header:hover { background: #f7fafc; }

.section-title  { font-weight: 700; font-size: .9rem; display: flex; align-items: center; gap: .45rem; }
.section-flag   { font-size: 1.1rem; }
.group-badge    { background: #1a3a5c; color: white; font-size: .7rem; font-weight: 800; padding: .1rem .4rem; border-radius: 4px; letter-spacing: .05em; }

.section-badges { display: flex; gap: .4rem; font-size: .72rem; align-items: center; }
.badge { padding: .12rem .45rem; border-radius: 99px; font-weight: 700; }
.badge-tenho { background: #f0fff4; color: #276749; }
.badge-falta { background: #fff5f5; color: #c53030; }

.chevron { font-size: .72rem; color: #a0aec0; transition: transform .2s; margin-left: .3rem; }
.chevron.open { transform: rotate(180deg); }

/* ── Stickers grid ────────────────────────────────────────────────────────── */
.stickers-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding: .75rem 1rem 1rem;
  border-top: 1px solid #f0f4f8;
}

@keyframes shimmer-slide {
  0%   { transform: translateX(-180%) skewX(-15deg); opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translateX(500%) skewX(-15deg); opacity: 0; }
}

.sticker {
  width: 80px;
  height: 44px;
  border-radius: 8px;
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .3rem .5rem;
  cursor: pointer;
  transition: transform .1s, box-shadow .1s;
  user-select: none;
  position: relative;
}
.sticker:hover  { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.sticker:active { transform: scale(.97); }

.sticker.falta {
  background: #f7fafc;
  border-color: #e2e8f0;
  color: #a0aec0;
}
.sticker.tenho {
  background: #38a169;
  border-color: #2f855a;
  color: white;
}

.sticker-num    { font-size: .7rem; font-weight: 800; line-height: 1; }
.sticker-status { font-size: .75rem; }
.sticker-label  { font-size: .55rem; font-weight: 600; line-height: 1.1; flex: 1; text-align: center; padding: 0 .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sticker:has(.sticker-label) { width: 140px; }
.sticker.falta .sticker-status { opacity: .25; }

/* ── Brilhante (figurinha 1 de cada seleção + todas FWC) ──────────────────── */
.sticker.brilhante {
  overflow: hidden;
}
.sticker.brilhante.falta {
  background: linear-gradient(135deg, #edf2f7, #dce9f5);
  border-color: #a8c4d8;
}
.sticker.brilhante.tenho {
  background: linear-gradient(135deg, #1a4731, #276749, #38a169, #52d490);
  border-color: #1a4731;
  box-shadow: 0 2px 10px rgba(56, 161, 105, .4);
}
.sticker.brilhante.tenho::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent       10%,
    rgba(255,220,80,.4)  30%,
    rgba(255,255,255,.75) 50%,
    rgba(160,230,255,.4) 70%,
    transparent       90%
  );
  animation: shimmer-slide 2.6s ease-in-out infinite;
  pointer-events: none;
}

/* ── Seção Coca-Cola ─────────────────────────────────────────────────────── */
.section-coca-cola .section-header {
  background: linear-gradient(135deg, #fff5f5, #fed7d7);
  border-left: 4px solid #c53030;
}
.section-coca-cola .section-header:hover { background: #fed7d7; }

/* ── Seção McDonald's ────────────────────────────────────────────────────── */
.section-mc-donalds .section-header {
  background: linear-gradient(135deg, #fffef0, #fef3c7);
  border-left: 4px solid #d69e2e;
}
.section-mc-donalds .section-header:hover { background: #fef3c7; }

/* ── Coca-Cola vermelha ───────────────────────────────────────────────────── */
.sticker.coca-cola.falta {
  background: #fff5f5;
  border-color: #fc8181;
  color: #c53030;
}
.sticker.coca-cola.falta .sticker-status { opacity: .35; }
.sticker.coca-cola.tenho {
  background: linear-gradient(135deg, #c53030, #e53e3e, #fc8181);
  border-color: #9b2c2c;
  color: #fff;
}

/* ── McDonald's dourada (figurinha 13-D) ──────────────────────────────────── */
.sticker.mc-donalds.falta {
  background: #fffef0;
  border-color: #d69e2e;
  color: #975a16;
}
.sticker.mc-donalds.falta .sticker-status { opacity: .35; }
.sticker.mc-donalds.tenho {
  background: linear-gradient(135deg, #b7791f, #d69e2e, #ecc94b);
  border-color: #975a16;
  color: #744210;
}

/* ── Loading overlay ──────────────────────────────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: #4a5568;
  z-index: 100;
}

/* ── Empty state ──────────────────────────────────────────────────────────── */
.empty-msg { padding: 1.5rem; text-align: center; color: #a0aec0; font-size: .85rem; width: 100%; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .app-header h1 { font-size: 1rem; }
  .main          { padding: .75rem; }
  .sticker       { width: 40px; height: 40px; }
  .stats-bar     { gap: .75rem; }
}
