:root {
  --primary: #AF9B6D;
  --primary-hover: #8f7d54;
  --success: #22c55e;
  --error: #ef4444;
  --bg: #f7f7f6;
  --bg-card: #ffffff;
  --text: #1c1a16;
  --text-muted: #4c463b;
  --border: #cec5b7;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.app-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.screen { width: 100%; max-width: 560px; margin: 0 auto; padding: 20px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
}

.card h2 { font-size: 1.8rem; margin-bottom: 12px; }
.card p { color: var(--text-muted); line-height: 1.6; margin-bottom: 20px; }

/* Buttons */
.btn {
  display: inline-block; border: none; border-radius: 10px; cursor: pointer;
  font-size: 1rem; font-weight: 600; padding: 12px 24px;
  transition: all 0.2s ease; text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border) !important; }
.btn-outline:hover { background: rgba(255,255,255,0.05); }
.btn-lg { font-size: 1.15rem; padding: 16px 32px; }

/* Hero / Landing */
.hero { text-align: center; }
.hero-title { font-size: 2.8rem; font-weight: 800; line-height: 1.2; margin-bottom: 8px; }
.hero-subtitle { display: block; font-size: 1.3rem; font-weight: 400; color: var(--primary); margin-top: 8px; }
.hero-desc { font-size: 1.1rem; color: var(--text-muted); max-width: 420px; margin: 0 auto 30px; line-height: 1.7; }
.hero-features { display: flex; gap: 24px; justify-content: center; margin-top: 30px; }
.feature { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 0.9rem; }
.feature-icon { font-size: 1.2rem; }

/* QR Code */
.qr-container { margin: 24px auto; max-width: 260px; background: white; padding: 16px; border-radius: 12px; }
.qr-container svg { width: 100%; height: auto; display: block; }
.qr-instruction { font-size: 1rem; }
.qr-hint { font-size: 0.85rem; color: var(--text-muted); }

/* Status badge */
.status-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 20px; font-size: 0.9rem; font-weight: 500;
  margin-bottom: 16px;
}
.status-waiting { background: rgba(99,102,241,0.15); color: var(--primary); }
.pulse {
  width: 8px; height: 8px; background: var(--primary); border-radius: 50%;
  animation: pulse-anim 1.5s ease-in-out infinite;
}
@keyframes pulse-anim {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* Success icon */
.success-icon { font-size: 3rem; margin-bottom: 16px; }

/* Progress bar */
.usage-section { margin: 24px 0; text-align: left; }
.usage-section h3 { font-size: 1rem; margin-bottom: 12px; color: var(--text); }
.progress-bar-container {
  width: 100%; height: 12px; background: var(--border); border-radius: 6px; overflow: hidden;
}
.progress-bar {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--success));
  border-radius: 6px; transition: width 0.5s ease;
}
.usage-labels { display: flex; justify-content: space-between; margin-top: 8px; font-size: 0.85rem; color: var(--text-muted); }
.usage-total { text-align: center; margin-top: 8px; font-size: 0.8rem; color: var(--text-muted); }

/* Info section */
.info-section { margin-top: 24px; text-align: left; border-top: 1px solid var(--border); padding-top: 16px; }
.info-section h3 { font-size: 1rem; margin-bottom: 12px; }
.info-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.info-row span:first-child { color: var(--text-muted); }

/* Alerts */
.alert { padding: 12px; border-radius: 8px; margin-bottom: 16px; font-size: 0.9rem; }
.alert-error { background: rgba(239,68,68,0.15); color: var(--error); }

/* Error screen */
.error-screen .card { border-color: var(--error); }

/* Spinner */
.spinner {
  width: 40px; height: 40px; margin: 0 auto;
  border: 4px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
