/**
 * UFIRMA UNAMIS - Modern Fintech & Trust Design System
 * Inspired by Linear, Stripe & Apple Enterprise UI
 * Version: 2.0.0 (Figma Design Refresh)
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* BRAND & ACCENTS */
  --primary: #0b132b;
  --primary-light: #1c2541;
  --primary-hover: #1e293b;
  --primary-border: #334155;
  --primary-soft: #f0f9ff;
  --primary-gradient: linear-gradient(135deg, #0b132b 0%, #1c2541 100%);
  
  --accent: #06b6d4;
  --accent-hover: #0891b2;
  --accent-dark: #0e7490;
  --accent-gradient: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
  --accent-glow: rgba(6, 182, 212, 0.28);
  --accent-soft: #ecfeff;
  --accent-border: #a5f3fc;
  
  /* SURFACES & BACKGROUNDS */
  --bg: #f8fafc;
  --bg-elevated: #ffffff;
  --bg-subtle: #f1f5f9;
  
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --card-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04), 0 4px 12px -2px rgba(15, 23, 42, 0.05);
  --card-shadow-hover: 0 12px 32px -4px rgba(15, 23, 42, 0.09), 0 4px 10px -2px rgba(15, 23, 42, 0.03);
  
  /* TEXT */
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-light: #cbd5e1;
  
  /* BORDERS */
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --border-focus: #06b6d4;
  
  /* STATES & TRUST */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  
  /* RADII */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* TYPOGRAPHY */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.watermark-bg {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 650px;
  height: 650px;
  background-image: url('logo.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.02;
  pointer-events: none;
  z-index: 0;
}

/* ============================================================================
   APP TOPBAR - SLEEK INSTITUTIONAL GLASS HEADER (STICKY)
   ============================================================================ */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 19, 43, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 1.5rem;
}

.topbar-container {
  max-width: 1360px;
  margin: 0 auto;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* BRAND */
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #ffffff;
  flex-shrink: 0;
}

.brand-logo-img {
  height: 32px;
  width: auto;
  filter: brightness(0) invert(1);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.topbar-brand:hover .brand-logo-img {
  transform: scale(1.08);
}

.brand-text-col {
  display: flex;
  flex-direction: column;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.brand-pill {
  background: var(--accent-gradient);
  color: #ffffff;
  font-size: 0.58rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  letter-spacing: 0.6px;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.35);
}

.brand-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* CENTER NAV TABS */
.topbar-nav-center {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 3px;
  backdrop-filter: blur(10px);
}

.suite-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: -0.01em;
}

.suite-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.suite-tab-btn.active {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.4);
}

/* RIGHT ACTIONS */
.topbar-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.ram-privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
}

.pulse-dot-green {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: pulseGreen 2s ease-in-out infinite;
}

@keyframes pulseGreen {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px #10b981; }
  50% { opacity: 0.4; box-shadow: 0 0 14px #10b981; }
}

.btn-asistente-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #cbd5e1;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-asistente-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: translateY(-1px);
}

/* ============================================================================
   MAIN CONTENT & HERO BANNER
   ============================================================================ */
.main-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
  flex: 1;
}

.hero-section {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #0284c7;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 0.85rem;
  text-transform: uppercase;
}

.hero-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.035em;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 50%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 620px;
  line-height: 1.55;
  margin-bottom: 0;
}

/* TRUST BADGES BAR */
.trust-badges-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 1.25rem;
}

.trust-badge-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 7px 15px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: all 0.2s ease;
}

.trust-badge-card:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.15);
}

.trust-badge-card .t-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.trust-badge-card strong {
  font-size: 0.75rem;
  color: var(--text-main);
  font-weight: 700;
}

/* ============================================================================
   TOOL VIEWS & CARDS ARCHITECTURE
   ============================================================================ */
.suite-tool-view {
  display: none;
  animation: viewFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.suite-tool-view.active {
  display: block;
}

@keyframes viewFadeIn {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

.single-tool-card {
  max-width: 900px;
  margin: 0 auto;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  box-shadow: var(--card-shadow);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  box-shadow: var(--card-shadow-hover);
  border-color: rgba(6, 182, 212, 0.25);
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-light);
}

.card-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.015em;
}

.card-pill-tag {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  letter-spacing: 0.3px;
}

/* ============================================================================
   MODALITY SELECTOR (PFX, TOKEN USB, CLOUD PKI)
   ============================================================================ */
.modality-nav {
  display: flex;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
}

.modality-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.modality-tab:hover {
  color: var(--text-main);
}

.modality-tab.active {
  background: var(--card-bg);
  color: var(--accent-dark);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  font-weight: 700;
}

.modality-panel {
  display: none;
}

.modality-panel.active {
  display: block;
  animation: viewFadeIn 0.25s ease;
}

/* FORM INPUTS */
.form-group {
  margin-bottom: 1.15rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.88rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text-main);
  transition: all 0.2s ease;
  outline: none;
}

.form-control:focus {
  background: var(--card-bg);
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px var(--accent-glow);
}

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

/* ============================================================================
   MODERN CERTIFICATE UPLOAD FIELD
   ============================================================================ */
.cert-upload-card {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  user-select: none;
}

.cert-upload-card:hover, .cert-upload-card.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.2);
  transform: translateY(-1px);
}

.cert-upload-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  border: 1px solid var(--border);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.cert-upload-card:hover .cert-upload-icon-wrap {
  transform: scale(1.08);
  border-color: var(--accent);
}

.cert-upload-icon {
  font-size: 1.35rem;
}

.cert-upload-info {
  flex: 1;
  min-width: 0;
}

.cert-upload-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}

.cert-upload-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-cert-browse {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.cert-upload-card:hover .btn-cert-browse {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.35);
}

/* SELECTED CERTIFICATE STATE */
.cert-file-selected {
  background: #ecfdf5;
  border: 1.5px solid #a7f3d0;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  animation: viewFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.cert-file-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

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

.cert-file-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #065f46;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cert-file-meta {
  font-size: 0.72rem;
  color: #047857;
  font-weight: 600;
  margin-top: 2px;
}

.btn-change-cert {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-change-cert:hover {
  background: #fca5a5;
  color: #7f1d1d;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.2);
}

/* ============================================================================
   DROPZONE - HIGH IMPACT DRAG & DROP
   ============================================================================ */
.dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 1.85rem 1.25rem;
  text-align: center;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.dropzone:hover, .dropzone.dragover {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 0 0 24px rgba(6, 182, 212, 0.2);
  transform: translateY(-1px);
}

.dropzone-icon {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  transition: transform 0.25s ease;
}

.dropzone:hover .dropzone-icon {
  transform: scale(1.15) translateY(-3px);
}

.dropzone strong {
  display: block;
  font-size: 0.92rem;
  color: var(--text-main);
  margin-bottom: 0.25rem;
  font-weight: 700;
}

.dropzone p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* FILE ITEMS IN QUEUE */
.file-list {
  margin-top: 1rem;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  font-size: 0.82rem;
  transition: border-color 0.15s ease;
}

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

.file-item-actions {
  flex-shrink: 0;
}

.btn-mini-view {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-mini-view:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3);
}

/* ============================================================================
   STAMP STUDIO CARD & LIVE PREVIEW (MAIN PAGE)
   ============================================================================ */
.stamp-studio-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  margin-top: 1rem;
}

.stamp-studio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.studio-icon {
  font-size: 1.2rem;
}

.visual-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--accent-border);
}

.live-stamp-preview {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  min-height: 75px;
  display: flex;
  align-items: center;
  margin-bottom: 0.85rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.live-stamp-accent {
  width: 4px;
  height: 52px;
  background: var(--accent-gradient);
  border-radius: 2px;
  margin-right: 12px;
  flex-shrink: 0;
}

.live-stamp-content {
  flex: 1;
}

.live-stamp-title {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}

.live-stamp-signer,
.live-stamp-meta,
.live-stamp-reason {
  font-size: 0.7rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.stamp-studio-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stamp-coords-info {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  font-family: var(--font-mono);
}

.btn-open-viewer-glow {
  background: var(--accent-gradient);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.35);
  white-space: nowrap;
}

.btn-open-viewer-glow:hover {
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.5);
  transform: translateY(-1px);
}

/* ============================================================================
   PRIMARY CTA GLOW BUTTON
   ============================================================================ */
.btn-cta-glow {
  width: 100%;
  background: var(--accent-gradient);
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 800;
  padding: 14px 24px;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: -0.01em;
}

.btn-cta-glow:hover {
  box-shadow: 0 8px 30px rgba(6, 182, 212, 0.55);
  transform: translateY(-2px);
}

.btn-cta-glow:active {
  transform: translateY(0);
}

.btn-cta-glow:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* TRUST SEALS BAR */
.trust-seals-bar {
  display: flex;
  gap: 16px;
  margin-top: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.trust-seal-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.trust-icon {
  font-size: 0.85rem;
}

/* ============================================================================
   ASSISTANT WINDOWS CARD
   ============================================================================ */
.assistant-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.assistant-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.assistant-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.assistant-status {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

a.btn-assistant-download,
.btn-assistant-download {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  background: #0b132b !important;
  background: linear-gradient(135deg, #0b132b 0%, #1e293b 100%) !important;
  color: #ffffff !important;
  text-align: center !important;
  padding: 13px 20px !important;
  border-radius: var(--radius-md) !important;
  text-decoration: none !important;
  font-weight: 700 !important;
  font-size: 0.92rem !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  margin-top: 0.35rem !important;
}

a.btn-assistant-download:hover,
.btn-assistant-download:hover {
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 22px rgba(6, 182, 212, 0.45) !important;
  transform: translateY(-2px) !important;
}

.assistant-steps {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 0.85rem;
}

.step-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 3px 9px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
}

.step-num {
  width: 17px;
  height: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  color: #ffffff;
  background: var(--accent);
  border-radius: 50%;
}

.link-switch-pfx {
  background: none;
  border: none;
  color: var(--accent-hover);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.link-switch-pfx:hover {
  text-decoration: underline;
}

/* ============================================================================
   PROGRESS SECTION & RESULTS TABLE
   ============================================================================ */
.progress-section {
  margin-top: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: var(--accent-gradient);
  border-radius: inherit;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.85rem;
  font-size: 0.82rem;
}

.results-table th, .results-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
}

.results-table th {
  background: var(--bg);
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.status-pill {
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.status-pill.success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.status-pill.error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.btn {
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}

.result-download-box {
  margin-top: 1.25rem;
  padding: 1.15rem;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: var(--radius-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.order-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  gap: 10px;
}

.order-item-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 360px;
}

.order-btn-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-order-action {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.74rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.btn-order-action:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.btn-order-remove {
  color: var(--danger);
  border-color: #fecaca;
  background: #fef2f2;
}

.btn-order-remove:hover {
  background: #fee2e2;
}

.preset-pill-btn {
  padding: 5px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--card-bg);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-pill-btn:hover, .preset-pill-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent-dark);
}

/* ============================================================================
   UFIRMA STUDIO PRO - MODAL VISOR & ESTAMPA PDF INTERACTIVO
   ============================================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(11, 19, 43, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.studio-modal-window {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  width: 96vw;
  max-width: 1460px;
  height: 94vh;
  max-height: 940px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 70px -15px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.15);
  overflow: hidden;
  animation: studioPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes studioPop {
  0% { transform: scale(0.97); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* STUDIO HEADER */
.studio-header {
  height: 60px;
  min-height: 60px;
  background: #0b132b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  z-index: 10;
}

.studio-header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
  overflow: hidden;
}

.studio-brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
}

.studio-brand-logo {
  height: 28px;
  width: auto;
  filter: brightness(0) invert(1);
}

.studio-title-main {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.studio-version-tag {
  background: var(--accent-gradient);
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
}

.studio-subtitle {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

.studio-doc-selector-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  max-width: 360px;
  flex: 1;
}

.studio-doc-icon {
  font-size: 0.95rem;
  color: #94a3b8;
}

.studio-doc-select {
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: #f1f5f9;
  width: 100%;
  cursor: pointer;
}

.studio-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-studio-apply {
  background: var(--accent-gradient);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.35);
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s ease;
}

.btn-studio-apply:hover {
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.5);
  transform: translateY(-1px);
}

.btn-studio-close {
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: #94a3b8;
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-studio-close:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* STUDIO SUBBAR TOOLBAR */
.studio-subbar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 8px 1.5rem;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  z-index: 5;
}

.subbar-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.subbar-btn {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 11px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.subbar-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--accent);
}

.subbar-page-counter {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0 6px;
  font-family: var(--font-mono);
}

.subbar-page-counter .bold-num {
  color: var(--text-main);
  font-weight: 700;
}

.subbar-zoom-val {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  min-width: 46px;
  text-align: center;
  font-family: var(--font-mono);
}

.subbar-btn-pill {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.subbar-btn-pill:hover {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent-dark);
}

.subbar-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
}

.subbar-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.subbar-select {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
}

.subbar-select:focus {
  border-color: var(--accent);
  outline: none;
}

.subbar-info-pill {
  margin-left: auto;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent-dark);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* STUDIO MAIN BODY & VIEWPORT (DARKROOM) */
.studio-main-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.studio-viewport {
  flex: 1;
  background: #0b132b;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2.5rem 1.5rem;
  position: relative;
  scrollbar-color: #334155 #0b132b;
  scrollbar-width: thin;
  background-image: radial-gradient(circle at center, rgba(6, 182, 212, 0.08) 0%, transparent 70%);
}

.studio-viewport::-webkit-scrollbar { width: 8px; height: 8px; }
.studio-viewport::-webkit-scrollbar-track { background: #0b132b; }
.studio-viewport::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

.studio-canvas-stage {
  position: relative;
  background: #ffffff;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  user-select: none;
  margin: 0 auto;
  transition: width 0.15s ease, height 0.15s ease;
}

#pdfViewerCanvas {
  display: block;
  border-radius: 4px;
  background: #ffffff;
}

/* STAMP DRAGGABLE & RESIZABLE BOX */
.studio-stamp-box {
  position: absolute;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 28px -4px rgba(6, 182, 212, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.9);
  cursor: grab;
  user-select: none;
  touch-action: none;
  z-index: 50;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: visible;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.studio-stamp-box:active {
  cursor: grabbing;
  box-shadow: 0 16px 40px -4px rgba(6, 182, 212, 0.5);
  border-color: var(--accent-hover);
}

.stamp-pill-header {
  background: var(--primary-gradient);
  color: #ffffff;
  font-size: 8.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.stamp-pill-header .pulse-dot {
  width: 6px;
  height: 6px;
  background: #06b6d4;
  border-radius: 50%;
  box-shadow: 0 0 8px #06b6d4;
  display: inline-block;
}

.stamp-content-area {
  flex: 1;
  padding: 5px 6px;
  display: flex;
  align-items: center;
  overflow: hidden;
  pointer-events: none;
}

.stamp-resize-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border: 2.5px solid #06b6d4;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  z-index: 60;
  cursor: se-resize;
  bottom: -7px;
  right: -7px;
  transition: transform 0.15s ease, background 0.15s ease;
}

.stamp-resize-handle:hover {
  transform: scale(1.25);
  background: #06b6d4;
  border-color: #ffffff;
}

/* STUDIO SIDEBAR */
.studio-sidebar {
  width: 380px;
  min-width: 380px;
  background: var(--card-bg);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-section {
  padding: 1.25rem 1.35rem;
  border-bottom: 1px solid var(--border-light);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.85rem;
}

.section-header .section-icon {
  font-size: 1rem;
}

.section-header h4 {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

/* SEGMENTED TABS */
.studio-segmented-tabs {
  display: flex;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
  margin-bottom: 0.85rem;
  border: 1px solid var(--border);
}

.studio-seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 7px 4px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.studio-seg-btn:hover {
  color: var(--text-main);
}

.studio-seg-btn.active {
  background: var(--card-bg);
  color: var(--accent-dark);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  font-weight: 700;
}

.badge-mini-rec {
  font-size: 0.55rem;
  background: var(--accent-soft);
  color: var(--accent-dark);
  padding: 1px 5px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.format-desc-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.badge-accent {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-bottom: 6px;
  border: 1px solid var(--accent-border);
}

.badge-adobe {
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-bottom: 6px;
  border: 1px solid #bae6fd;
}

/* SIGNATURE PAD CANVAS */
.signature-pad-wrapper {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 6px;
}

#signaturePadCanvas {
  display: block;
  width: 100%;
  height: 110px;
  background: #ffffff;
  cursor: crosshair;
}

.pad-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.color-palette {
  display: flex;
  align-items: center;
  gap: 6px;
}

.color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px var(--border);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.color-dot.active {
  transform: scale(1.2);
  box-shadow: 0 0 0 2px #06b6d4;
}

.btn-clear-trace {
  background: transparent;
  border: none;
  color: var(--danger);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-clear-trace:hover {
  text-decoration: underline;
}

/* SMART POSITION GRID */
.smart-positions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.preset-pos-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.preset-pos-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent-dark);
}

.preset-pos-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-dark);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(6, 182, 212, 0.2);
}

/* TELEMETRY */
.coords-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.telemetry-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  text-align: center;
}

.telem-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}

.telem-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.telem-val small {
  font-size: 0.62rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* SIDEBAR ACTIONS */
.sidebar-bottom-actions {
  margin-top: auto;
  padding: 1.25rem;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
}

.btn-sidebar-apply {
  width: 100%;
  background: var(--accent-gradient);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 11px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.btn-sidebar-apply:hover {
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.5);
  transform: translateY(-1px);
}

/* FOOTER */
footer {
  text-align: center;
  padding: 1.75rem 1rem;
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--card-bg);
  position: relative;
  z-index: 1;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ============================================================================ */
@media (max-width: 960px) {
  .topbar-container {
    flex-direction: column;
    height: auto;
    padding: 10px 0;
    gap: 8px;
  }
  .topbar-nav-center {
    overflow-x: auto;
    max-width: 100%;
    padding: 4px;
  }
  .hero-title { font-size: 1.45rem; }
  .trust-badges-bar { display: none; }
  .grid { grid-template-columns: 1fr; }
  .studio-modal-window {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    max-height: 100vh;
  }
  .studio-main-body {
    flex-direction: column;
  }
  .studio-sidebar {
    width: 100%;
    min-width: 100%;
    height: 320px;
  }
}