/* ============================================================
   COINT-QRCODE — Design System & Styles
   Dark Black & Gold theme + Glassmorphism + Micro-animations
   ============================================================ */

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

/* Garante que [hidden] nunca seja sobrescrito por display:flex/grid das sections */
[hidden] { display: none !important; }

:root {
  --font: 'Inter', system-ui, sans-serif;

  /* === BLACK & GOLD palette === */
  --bg:            #080808;
  --bg-card:       #0e0e0e;
  --surface:       rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border:        rgba(212, 175, 55, 0.14);
  --border-strong: rgba(212, 175, 55, 0.45);

  /* Gold shades */
  --gold:          #d4af37;
  --gold-light:    #f0d060;
  --gold-dark:     #a8860a;
  --gold-muted:    rgba(212, 175, 55, 0.55);

  /* Status */
  --green: #22c55e;
  --red:   #ef4444;

  /* Text */
  --text-primary:   #f5f0e8;
  --text-secondary: #a89a7a;
  --text-muted:     #5a4f3a;

  /* Gradients */
  --grad-main: linear-gradient(135deg, #d4af37 0%, #f0d060 50%, #a8860a 100%);
  --grad-glow: radial-gradient(circle at 50% 50%, rgba(212, 175, 55, 0.12), transparent 70%);

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Shadows */
  --shadow-card: 0 32px 64px rgba(0, 0, 0, 0.7),
                 0 0 0 1px rgba(212, 175, 55, 0.08);
  --shadow-btn:  0 4px 24px rgba(212, 175, 55, 0.4);
  --shadow-glow: 0 0 60px rgba(212, 175, 55, 0.18);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 48px;
  overflow-x: hidden;
}

/* ============================================================
   Background orbs
   ============================================================ */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.25;
  animation: drift 20s ease-in-out infinite alternate;
}

.orb-1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, #d4af37, transparent 65%);
  top: -260px; left: -260px;
  animation-delay: 0s;
}

.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #a8860a, transparent 65%);
  bottom: -180px; right: -180px;
  animation-delay: -8s;
}

.orb-3 {
  width: 380px; height: 380px;
  background: radial-gradient(circle, #f0d060, transparent 65%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -15s;
  opacity: 0.10;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(50px, 35px) scale(1.10); }
}

/* ============================================================
   Layout principal
   ============================================================ */
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-top: 8px;
}

/* ============================================================
   Header
   ============================================================ */
.header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Logo image (PM2) */
.logo-img {
  height: 52px;
  width: auto;
  filter: drop-shadow(0 0 14px rgba(212, 175, 55, 0.55));
  transition: filter 0.3s;
}

.logo-img:hover {
  filter: drop-shadow(0 0 22px rgba(212, 175, 55, 0.85));
}

.logo-text {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.logo-accent {
  background: var(--grad-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}

/* User info strip */
.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.header-user strong {
  color: var(--gold-light);
}

.logout-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.75rem;
  padding: 3px 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.logout-btn:hover {
  border-color: var(--border-strong);
  color: var(--gold);
}

/* ============================================================
   Card principal
   ============================================================ */
.main-card {
  background: var(--surface);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  min-height: 420px;
}

/* ============================================================
   Seção: Upload
   ============================================================ */
.upload-section {
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: center;
}

/* Drop Zone */
.drop-zone {
  width: 100%;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  background: rgba(212, 175, 55, 0.03);
  position: relative;
  overflow: hidden;
}

.drop-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-glow);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.drag-over {
  border-color: var(--gold-light);
  background: rgba(212, 175, 55, 0.07);
  box-shadow: 0 0 48px rgba(212, 175, 55, 0.14);
  outline: none;
}

.drop-zone:hover::before,
.drop-zone.drag-over::before {
  opacity: 1;
}

.drop-zone.drag-over {
  transform: scale(1.01);
}

.drop-icon {
  animation: float 3.5s ease-in-out infinite;
}

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

.drop-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.drop-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.drop-formats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

.format-badge {
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.28);
  color: var(--gold-light);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.drop-limit {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* File Preview */
.file-preview {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  animation: slideIn 0.3s ease;
}

.file-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.file-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.file-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  flex-shrink: 0;
}

.file-remove:hover {
  color: var(--red);
  background: rgba(239, 68, 68, 0.1);
}

/* Upload Button */
.upload-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  background: var(--grad-main);
  border: none;
  border-radius: var(--radius-md);
  color: #000;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-btn);
  position: relative;
  overflow: hidden;
}

.upload-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255,255,255,0.2), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.upload-btn:hover:not(:disabled)::after { opacity: 1; }

.upload-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(212, 175, 55, 0.55);
}

.upload-btn:active:not(:disabled) {
  transform: translateY(0);
}

.upload-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

/* ============================================================
   Seção: Progresso
   ============================================================ */
.progress-section {
  padding: 60px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  animation: fadeIn 0.4s ease;
}

.progress-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
}

.spinner {
  width: 56px;
  height: 56px;
  border: 3px solid rgba(212, 175, 55, 0.18);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

.progress-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.progress-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.progress-bar-wrap {
  width: 100%;
  max-width: 420px;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 100px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--grad-main);
  border-radius: 100px;
  transition: width 0.4s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  animation: shimmer 1.6s infinite;
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

.progress-percent {
  font-size: 0.85rem;
  color: var(--gold-muted);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Seção: Resultado
   ============================================================ */
.result-section {
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: center;
  animation: fadeIn 0.5s ease;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(34, 197, 94, 0.10);
  border: 1px solid rgba(34, 197, 94, 0.28);
  color: #4ade80;
  padding: 8px 22px;
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 600;
}

/* QR Code — destaque no topo */
.qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.qr-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-muted);
}

.qr-frame {
  padding: 18px;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow:
    0 0 0 3px rgba(212, 175, 55, 0.4),
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 48px rgba(212, 175, 55, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: qrAppear 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes qrAppear {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

.qr-image {
  display: block;
  width: 240px;
  height: 240px;
  border-radius: 4px;
}

.qr-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 200px;
}

/* Divider */
.result-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
}

/* Result Strip — card compacto abaixo do QR */
.result-strip {
  width: 100%;
  background: rgba(212, 175, 55, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-file-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.result-file-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
}

.result-file-size {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Result buttons row */
.result-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Link Box */
.link-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.link-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.link-row {
  display: flex;
  gap: 8px;
}

.link-input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.8rem;
  padding: 10px 12px;
  outline: none;
  cursor: text;
  transition: border-color 0.2s;
  min-width: 0;
}

.link-input:focus {
  border-color: var(--gold);
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: var(--radius-sm);
  color: var(--gold-light);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.copy-btn:hover {
  background: rgba(212, 175, 55, 0.22);
  border-color: var(--gold);
}

.copy-btn.copied {
  background: rgba(34, 197, 94, 0.13);
  border-color: rgba(34, 197, 94, 0.35);
  color: #4ade80;
}

.drive-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--grad-main);
  border-radius: var(--radius-sm);
  color: #000;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.35);
}

.drive-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(212, 175, 55, 0.55);
}

.new-upload-btn {
  padding: 11px 20px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.new-upload-btn:hover {
  border-color: var(--border-strong);
  color: var(--gold-light);
  background: var(--surface-hover);
}

/* ============================================================
   Seção: Erro
   ============================================================ */
.error-section {
  padding: 60px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: fadeIn 0.4s ease;
}

.error-icon {
  font-size: 3rem;
  margin-bottom: 8px;
}

.error-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.error-message {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  max-width: 420px;
  background: rgba(239, 68, 68, 0.07);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.retry-btn {
  margin-top: 8px;
  padding: 12px 28px;
  background: var(--grad-main);
  border: none;
  border-radius: var(--radius-sm);
  color: #000;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-btn);
}

.retry-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.45);
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-bottom: 8px;
}

/* ============================================================
   Animações utilitárias
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

/* ============================================================
   Responsividade
   ============================================================ */
@media (max-width: 640px) {
  body { padding: 16px 12px 40px; }
  .container { gap: 20px; }

  .upload-section { padding: 24px 20px; }
  .drop-zone { padding: 36px 18px; }
  .drop-title { font-size: 1.05rem; }

  .result-section { padding: 28px 20px; gap: 22px; }
  .result-strip { padding: 18px 16px; }
  .qr-image { width: 200px; height: 200px; }
  .result-btns { flex-direction: column; }
  .drive-btn, .new-upload-btn { justify-content: center; text-align: center; }

  .progress-section { padding: 48px 24px; }
  .error-section    { padding: 48px 24px; }

  .logo-img { height: 40px; }
  .logo-text { font-size: 1.35rem; }

  .link-row { flex-direction: column; }
  .copy-btn { justify-content: center; }
}

@media (max-width: 400px) {
  .drop-formats { gap: 6px; }
  .logo { flex-direction: column; gap: 8px; }
  .logo-img { height: 48px; }
}
