/* ═══════════════════════════════════════════════
   CONSOLA COLECTIVA — Estilos
   Tema: Minimal luxury / editorial gaming
   ═══════════════════════════════════════════════ */

:root {
  --bg: #f9f8f6;
  --white: #ffffff;
  --ink: #0d0d0d;
  --ink-muted: #6b6b6b;
  --ink-faint: #b8b8b8;
  --accent: #1a1a2e;
  --accent-glow: #4361ee;
  --green: #2d9e6b;
  --green-light: #e6f7f0;
  --amber: #e67e22;
  --amber-light: #fef3e2;
  --red: #c0392b;
  --border: #e8e6e1;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 4px 32px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 60px rgba(0,0,0,0.12);
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Grain texture ── */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
}

/* ── Layout ── */
.container {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

/* ── Header ── */
.site-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  animation: fadeUp 0.6s ease both;
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  letter-spacing: -0.5px;
}

.site-tagline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

/* ── Product Card ── */
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  animation: fadeUp 0.7s 0.1s ease both;
  margin-bottom: 24px;
}

.product-image-wrap {
  position: relative;
  background: linear-gradient(135deg, #e8eaf6 0%, #f3e5f5 50%, #e1f5fe 100%);
  padding: 40px 24px 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  overflow: hidden;
}

.product-image-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 60%, rgba(67,97,238,0.08) 0%, transparent 70%);
}

.product-image {
  max-height: 180px;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 28px rgba(0,0,0,0.18));
  position: relative;
  z-index: 1;
  animation: floatConsole 4s ease-in-out infinite;
}

@keyframes floatConsole {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.product-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-body);
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,0.9);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  letter-spacing: 0.03em;
}

.product-badge.complete {
  background: var(--green-light);
  color: var(--green);
  border-color: rgba(45,158,107,0.2);
}

.product-info {
  padding: 28px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.product-name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.15;
  color: var(--ink);
}

.product-desc {
  margin-top: 6px;
  font-size: 14px;
  color: var(--ink-muted);
  font-weight: 300;
}

/* ── Stats ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-box {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--border);
  transition: transform 0.2s ease;
}

.stat-box:hover { transform: translateY(-1px); }

.stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  font-weight: 500;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.5px;
}

.stat-paid .stat-value { color: var(--green); }
.stat-remaining .stat-value { color: var(--amber); }

/* ── Progress ── */
.progress-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--ink-muted);
}

.progress-labels span:first-child {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--accent-glow);
}

.progress-track {
  height: 10px;
  background: var(--bg);
  border-radius: 100px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4361ee, #7209b7);
  border-radius: 100px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  min-width: 0;
}

.progress-glow {
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: #7209b7;
  border-radius: 50%;
  box-shadow: 0 0 12px 4px rgba(114,9,183,0.4);
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
  50% { opacity: 0.6; transform: translateY(-50%) scale(1.3); }
}

/* ── Payment form ── */
.payment-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  font-weight: 500;
}

.input-group input {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  width: 100%;
}

.input-group input:focus {
  border-color: var(--accent-glow);
  box-shadow: 0 0 0 3px rgba(67,97,238,0.12);
  background: var(--white);
}

.input-group input::placeholder { color: var(--ink-faint); }

.amount-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-sign {
  position: absolute;
  left: 14px;
  color: var(--ink-muted);
  font-size: 15px;
  pointer-events: none;
}

.amount-input-wrap input {
  padding-left: 28px;
}

/* Remove number arrows */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; }
input[type=number] { -moz-appearance: textfield; }

/* ── Quick amounts ── */
.quick-amounts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-btn {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 7px 16px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-btn:hover {
  border-color: var(--accent-glow);
  color: var(--accent-glow);
  background: rgba(67,97,238,0.04);
}

.quick-btn.active {
  background: var(--accent-glow);
  border-color: var(--accent-glow);
  color: var(--white);
}

/* ── Pay button ── */
.pay-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--ink);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 16px 24px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}

.pay-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #4361ee, #7209b7);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.pay-btn:hover::before { opacity: 1; }

.pay-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0,0,0,0.2); }
.pay-btn:active { transform: translateY(0); }
.pay-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.pay-btn-text, .pay-btn-icon {
  position: relative;
  z-index: 1;
}

.pay-btn-icon {
  font-size: 18px;
  transition: transform 0.2s ease;
}

.pay-btn:hover .pay-btn-icon { transform: translateX(4px); }

.form-note {
  font-size: 12px;
  color: var(--red);
  min-height: 16px;
  text-align: center;
}

/* ── Feed ── */
.feed-section {
  animation: fadeUp 0.7s 0.25s ease both;
}

.feed-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.feed-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.3px;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feed-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-faint);
  font-size: 14px;
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--border);
}

.feed-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  border: 1px solid var(--border);
  animation: slideIn 0.4s ease both;
  transition: border-color 0.2s;
}

.feed-item:hover { border-color: var(--accent-glow); }

.feed-item.new-item {
  border-color: var(--accent-glow);
  background: rgba(67,97,238,0.02);
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.feed-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4361ee, #7209b7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.feed-details {
  flex: 1;
  min-width: 0;
}

.feed-name {
  font-weight: 500;
  font-size: 14px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-time {
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 2px;
}

.feed-amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--green);
  white-space: nowrap;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--ink);
  color: var(--white);
  padding: 12px 24px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  z-index: 1000;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success { background: var(--green); }
.toast.error { background: var(--red); }

/* ── Loading overlay ── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(249,248,246,0.92);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.loading-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-glow);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-overlay p {
  font-size: 14px;
  color: var(--ink-muted);
}

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Completed state ── */
.completed .progress-fill {
  background: linear-gradient(90deg, var(--green), #00b894);
}

.completed .progress-glow {
  background: var(--green);
  box-shadow: 0 0 12px 4px rgba(45,158,107,0.4);
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .container { padding: 16px 12px 48px; }

  .product-image-wrap { min-height: 180px; padding: 28px 16px 20px; }
  .product-image { max-height: 150px; }

  .product-info { padding: 20px 20px 24px; }
  .product-name { font-size: 22px; }

  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-value { font-size: 15px; }

  .form-row { grid-template-columns: 1fr; }

  .quick-amounts { gap: 6px; }
  .quick-btn { padding: 6px 12px; font-size: 12px; }

  .pay-btn { padding: 14px 20px; font-size: 15px; }
}

@media (min-width: 480px) {
  .container { padding: 32px 24px 72px; }
}
