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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f8fafc;
  color: #1e293b;
  line-height: 1.5;
}

.app-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 16px 24px;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.portal-back {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  text-decoration: none;
  font-weight: 600;
}
.portal-back:hover { color: #2563eb; }

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

.logo-icon { font-size: 2rem; }

.brand-logo h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

.tagline {
  font-size: 0.75rem;
  color: #64748b;
}

.main-container {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

.config-panel {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.mode-tab {
  background: #f1f5f9;
  color: #475569;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-tab:hover {
  background: #e2e8f0;
}

.mode-tab.active {
  background: #0f172a;
  color: #ffffff;
}

.mode-section {
  display: none;
}
.mode-section.active {
  display: block;
}

.form-group-row {
  display: flex;
  gap: 12px;
}
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  width: 100%;
}

.form-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
}

.form-field input,
.form-field textarea,
.form-field select {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
  background: #f8fafc;
  color: #1e293b;
  transition: all 0.2s;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.divider {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 18px 0;
}

.config-panel h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 14px;
}

/* Preview Panel */
.preview-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.preview-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.frame-header {
  background: #32bcad;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 6px 18px;
  border-radius: 20px;
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.frame-footer {
  margin-top: 12px;
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 600;
  text-align: center;
}

.canvas-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: #ffffff;
}

#qrCanvas {
  max-width: 100%;
  height: auto !important;
  display: block;
}

/* Copia e Cola */
.pix-copia-cola-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 16px;
}

.pix-copia-cola-card label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  display: block;
  margin-bottom: 8px;
}

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

.copy-input-row input {
  flex: 1;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  font-family: monospace;
  font-size: 0.8rem;
  color: #334155;
}

.btn-copy {
  background: #0f172a;
  color: #ffffff;
  border: none;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  white-space: nowrap;
}

/* Download Buttons */
.export-buttons-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-download-primary {
  background: #2563eb;
  color: #ffffff;
  border: none;
  font-weight: 700;
  padding: 12px;
  border-radius: 10px;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.2s;
}
.btn-download-primary:hover {
  background: #1d4ed8;
}

.btn-download-svg {
  background: #0f172a;
  color: #ffffff;
  border: none;
  font-weight: 700;
  padding: 12px;
  border-radius: 10px;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
  transition: all 0.2s;
}
.btn-download-svg:hover {
  background: #1e293b;
  transform: translateY(-1px);
}

.app-footer {
  text-align: center;
  padding: 32px 16px;
  color: #64748b;
  font-size: 0.8rem;
  margin-top: 48px;
  border-top: 1px solid #e2e8f0;
}
