/* MobPlay Store — Design System (tokens + base + componentes compartilhados) */

:root {
  --violet: #6c3ce9;
  --violet-deep: #4a1fb8;
  --cyan: #00d4ff;
  --bg: #0b0b11;
  --bg-2: #0f0f17;
  --surface: #16161f;
  --surface-2: #1c1c28;
  --border: #262633;
  --border-soft: #20202c;
  --text: #f5f5f7;
  --muted: #9595a4;
  --muted-2: #6b6b78;
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --grad: linear-gradient(135deg, #6c3ce9 0%, #00d4ff 100%);
  --grad-soft: linear-gradient(135deg, rgba(108, 60, 233, 0.18), rgba(0, 212, 255, 0.12));
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-full: 999px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 0 1px rgba(108, 60, 233, 0.35), 0 16px 40px rgba(108, 60, 233, 0.28);
  --ring: 0 0 0 3px rgba(108, 60, 233, 0.35);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --maxw: 1200px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

/* Fundo com brilhos da marca */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60vw 60vw at 80% -10%, rgba(108, 60, 233, 0.22), transparent 60%),
    radial-gradient(50vw 50vw at 0% 0%, rgba(0, 212, 255, 0.12), transparent 55%),
    var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: rgba(108, 60, 233, 0.45);
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 20px;
}

/* ---------- Botões ---------- */
.btn {
  --bg-btn: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-btn);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 11px 20px;
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.25s var(--ease), filter 0.2s var(--ease),
    background 0.2s;
  white-space: nowrap;
  user-select: none;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.btn--primary {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 22px rgba(108, 60, 233, 0.35);
}
.btn--primary:hover {
  box-shadow: 0 12px 30px rgba(108, 60, 233, 0.5);
  filter: brightness(1.05);
}
.btn--installed,
.btn--play {
  background: linear-gradient(135deg, #15803d 0%, #4ade80 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 22px rgba(34, 197, 94, 0.35);
}
.btn--installed:hover,
.btn--play:hover {
  box-shadow: 0 12px 30px rgba(34, 197, 94, 0.5);
  filter: brightness(1.05);
}
.btn--installed:disabled {
  opacity: 1;
  transform: none;
  filter: none;
  cursor: default;
}
.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn--ghost:hover {
  color: var(--text);
  background: var(--surface);
}
.btn--danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fda4a4;
}
.btn--danger:hover {
  background: rgba(239, 68, 68, 0.22);
}
.btn--lg {
  padding: 14px 28px;
  font-size: 1.05rem;
}
.btn--block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.btn--downloading {
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}
.btn--downloading::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--dl-progress, 0%);
  background: rgba(255, 255, 255, 0.18);
  transition: width 0.12s linear;
  pointer-events: none;
}

/* ---------- Inputs ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}
.input,
.textarea,
.select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.textarea {
  resize: vertical;
  min-height: 110px;
}
.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: var(--ring);
}
.input::placeholder,
.textarea::placeholder {
  color: var(--muted-2);
}

/* ---------- Badges & chips ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}
.badge--ok {
  background: rgba(34, 197, 94, 0.14);
  color: #6ee7a8;
  border-color: rgba(34, 197, 94, 0.3);
}
.badge--warn {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}
.badge--off {
  background: rgba(239, 68, 68, 0.12);
  color: #fda4a4;
  border-color: rgba(239, 68, 68, 0.3);
}

/* ---------- Toast ---------- */
.toast-host {
  position: fixed;
  bottom: 22px;
  right: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}
.toast {
  min-width: 240px;
  max-width: 360px;
  padding: 13px 16px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  transform: translateX(40px);
  transition: all 0.3s var(--ease);
}
.toast.show {
  opacity: 1;
  transform: translateX(0);
}
.toast--success {
  border-left: 3px solid var(--success);
}
.toast--error {
  border-left: 3px solid var(--error);
}
.toast--info {
  border-left: 3px solid var(--cyan);
}

/* ---------- Spinner / skeleton ---------- */
.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--violet);
  animation: spin 0.8s linear infinite;
  margin: 60px auto;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.skeleton {
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 9, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  animation: fade 0.25s var(--ease) forwards;
}
@keyframes fade {
  to {
    opacity: 1;
  }
}
.modal {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow);
  transform: translateY(16px) scale(0.98);
  animation: pop 0.3s var(--ease) forwards;
}
@keyframes pop {
  to {
    transform: translateY(0) scale(1);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
