/* ==============================================================================
   FactuX Firmador Web — Design System & Stylesheet
   Modern, Ultra-responsive, Glassmorphism, Dual Mode UI
   ============================================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-dark: #1e40af;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.06);

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modo Oscuro Opcional */
[data-theme="dark"] {
  --bg-main: #0b1120;
  --card-bg: #131c31;
  --card-border: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --slate-100: #1e293b;
  --slate-200: #334155;
}

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

/* Sin este reset, <button> hereda el borde/fondo por defecto del navegador — se nota
   sobre todo en botones que solo se apoyan en clases como .nav-item o .mode-btn sin
   fijar border/background propios, que terminan viéndose como botones sin estilizar. */
button {
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, .brand-font {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

/* ==========================================================================
   Header & Navbar
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--card-border);
  padding: 0.85rem 1.5rem;
}

[data-theme="dark"] .navbar {
  background: rgba(19, 28, 49, 0.85);
}

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

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-item {
  padding: 0.5rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-item:hover, .nav-item.active {
  color: var(--primary);
  background-color: var(--primary-light);
}

/* ==========================================================================
   Botones
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  user-select: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--slate-100);
  color: var(--slate-700);
  border-color: var(--slate-200);
}

.btn-secondary:hover {
  background-color: var(--slate-200);
  color: var(--slate-900);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669, #047857);
}

.btn-outline {
  background: transparent;
  border-color: var(--card-border);
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: var(--slate-100);
}

.btn-danger-outline {
  background: transparent;
  border-color: #fca5a5;
  color: var(--danger);
}

.btn-danger-outline:hover {
  background-color: #fee2e2;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

/* ==========================================================================
   Contenedor Principal & Layout
   ========================================================================== */
.main-wrapper {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  flex: 1;
}

/* ==========================================================================
   Hero Section & Mode Selector
   ========================================================================== */
.hero-banner {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 2.5rem;
  line-height: 1.15;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.hero-title span {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.mode-switcher {
  display: inline-flex;
  background: var(--slate-100);
  border-radius: var(--radius-xl);
  padding: 0.35rem;
  border: 1px solid var(--slate-200);
  margin-bottom: 2rem;
}

.mode-btn {
  padding: 0.6rem 1.4rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mode-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .mode-btn.active {
  background: var(--slate-800);
  color: white;
}

/* ==========================================================================
   Tarjetas & Formularios
   ========================================================================== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

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

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--slate-300);
  background-color: var(--slate-50);
  border-radius: var(--radius-lg);
  padding: 2.25rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background-color: rgba(37, 99, 235, 0.03);
}

.dropzone-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.dropzone-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

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

.dropzone input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* File Loaded State */
.file-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-top: 0.75rem;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
}

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

.form-label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  background: white;
  color: var(--text-main);
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ==========================================================================
   Barra de Cuota de Almacenamiento (Plan Free 10 Docs)
   ========================================================================== */
.quota-banner {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: white;
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.quota-info {
  flex: 1;
}

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

.quota-title {
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quota-progress {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  overflow: hidden;
}

.quota-bar {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #06b6d4);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.quota-bar.warning {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

/* ==========================================================================
   Tabla de Documentos
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table-docs {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table-docs th {
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--card-border);
  background: var(--slate-50);
}

.table-docs td {
  padding: 0.9rem 1rem;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--card-border);
  vertical-align: middle;
}

.table-docs tr:hover td {
  background-color: var(--slate-50);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.725rem;
  font-weight: 700;
}

.status-pendiente {
  background-color: #fef3c7;
  color: #b45309;
}

.status-firmado {
  background-color: #d1fae5;
  color: #065f46;
}

.status-anulado {
  background-color: #fee2e2;
  color: #991b1b;
}

/* ==========================================================================
   MODAL DE VISOR PDF INTERACTIVO & MULTI-SELLOS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

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

.modal-container {
  background: white;
  width: 100%;
  max-width: 1300px;
  height: 92vh;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.35);
}

/* Modal Toolbar Superior */
.viewer-toolbar {
  background: var(--slate-900);
  color: white;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--slate-800);
}

.viewer-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.tool-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.tool-btn.active {
  background: var(--primary);
  border-color: var(--primary);
}

/* Cuerpo del visor: Panel lateral + Lienzo central */
.viewer-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  background: #e2e8f0;
  position: relative;
}

/* Lienzo de páginas */
.viewer-canvas-area {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  gap: 2rem;
  position: relative;
}

.pdf-page-container {
  position: relative;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
  background: white;
  border-radius: 4px;
}

.pdf-canvas {
  display: block;
}

/* Capa interactiva de sellos encima de la página */
.pdf-overlay-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

/* Sello Arrastrable (Stamp Box) — imita el sello sobrio y plano que dibuja el motor
   Java en el PDF final (borde sólido de color, sin degradados ni sombras de tarjeta),
   igual al aspecto estándar de cualquier firmador electrónico, para que el arrastre
   sea WYSIWYG con el resultado real. */
.stamp-box {
  position: absolute;
  border: 1px solid #2563eb;
  background: #ffffff;
  border-radius: 2px;
  cursor: move;
  user-select: none;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s;
  overflow: hidden;
}

.stamp-box.sumilla { border-color: #10b981; }
.stamp-box.type-qr_only { border-color: #7c3aed; }

/* Durante el arrastre/redimensionado se usa transform (solo GPU/compositor), sin
   transiciones, para que el movimiento sea instantáneo y no dispare reflow por frame. */
.stamp-box.dragging,
.stamp-box.resizing {
  transition: none;
  will-change: transform;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.2);
  z-index: 20;
}

.stamp-box.selected {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.stamp-box.sumilla.selected {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.stamp-box.type-qr_only.selected {
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

/* Encabezado sobrio: insignia de verificación + etiqueta en texto plano, sin banda
   de color de fondo (igual al sello real que dibuja PDFSigner en el PDF) */
.stamp-header-plain {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 5px;
  padding: 6px 7px 2px;
}

.stamp-check-badge {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stamp-box.sumilla .stamp-check-badge { background: #10b981; }
.stamp-box.type-qr_only .stamp-check-badge { background: #7c3aed; }

.stamp-header-label {
  font-size: 0.55rem;
  font-weight: 800;
  color: #475569;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Handle de redimensionamiento */
.stamp-resize-handle {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  background: #2563eb;
  border: 2px solid white;
  border-radius: 50%;
  cursor: nwse-resize;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.stamp-box.sumilla .stamp-resize-handle {
  background: #10b981;
}

.stamp-box.type-qr_only .stamp-resize-handle {
  background: #7c3aed;
}

.stamp-tag {
  position: absolute;
  top: -20px;
  left: 0;
  background: #2563eb;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

.stamp-box.sumilla .stamp-tag {
  background: #10b981;
}

.stamp-box.type-qr_only .stamp-tag {
  background: #7c3aed;
}

.stamp-delete-btn {
  position: absolute;
  top: -20px;
  right: 0;
  background: #ef4444;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  cursor: pointer;
  border: none;
}

/* Previsualización visual interna del sello (el header ya reservó su propio espacio
   como hijo flex; este bloque solo llena lo que queda) */
.stamp-content-preview {
  display: flex;
  align-items: flex-start;
  flex: 1;
  min-height: 0;
  gap: 8px;
  width: 100%;
  padding: 2px 7px 6px 24px;
  box-sizing: border-box;
  pointer-events: none;
  overflow: hidden;
}

.stamp-content-preview.qr-only-layout {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px 7px 6px;
  gap: 3px;
}

.stamp-qr-preview {
  width: 40px;
  height: 40px;
  background: white;
  border-radius: 3px;
  border: 1px solid #cbd5e1;
  flex-shrink: 0;
  padding: 2px;
  box-sizing: border-box;
}

.stamp-qr-preview svg {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-only-layout .stamp-qr-preview {
  width: min(70%, 100px);
  height: auto;
  aspect-ratio: 1 / 1;
}

.stamp-qr-caption {
  font-size: 0.55rem;
  color: #64748b;
  font-weight: 600;
  text-align: center;
}

.stamp-text-preview {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  font-size: 0.625rem;
  line-height: 1.25;
  overflow: hidden;
  color: #0f172a;
}

.stamp-text-name {
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Panel Lateral Derecho de Sellos */
.viewer-sidebar {
  width: 320px;
  background: white;
  border-left: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 1rem;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stamps-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.stamp-item-card {
  border: 1px solid var(--slate-200);
  background: var(--slate-50);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  transition: var(--transition);
  cursor: pointer;
}

.stamp-item-card:hover, .stamp-item-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

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

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--card-border);
  background: var(--slate-50);
}

/* ==========================================================================
   Modales secundarios (Login, Registro, Planes)
   ========================================================================== */
.modal-dialog-sm {
  background: white;
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-xl);
  position: relative;
}

.modal-dialog-lg {
  background: white;
  width: 100%;
  max-width: 960px;
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  box-shadow: var(--shadow-xl);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text-muted);
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--slate-100);
  color: var(--slate-800);
}

/* ==========================================================================
   Modal de Autenticación (Login / Registro)
   ========================================================================== */
.auth-modal-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-modal-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 0.85rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}

.auth-modal-title {
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}

.auth-modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 340px;
  margin: 0 auto;
}

/* Envoltorio de input con ícono a la izquierda (y opcionalmente un botón a la derecha,
   como el de mostrar/ocultar contraseña) */
.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-wrap .input-icon {
  position: absolute;
  left: 0.85rem;
  color: var(--slate-400);
  pointer-events: none;
  display: flex;
}

.form-input.has-icon {
  padding-left: 2.5rem;
}

.form-input.has-toggle {
  padding-right: 2.5rem;
}

.input-toggle-visibility {
  position: absolute;
  right: 0.5rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--slate-400);
  border-radius: 50%;
  transition: var(--transition);
}

.input-toggle-visibility:hover {
  color: var(--slate-600);
  background: var(--slate-100);
}

/* Pricing Grid */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.pricing-card {
  border: 2px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.pricing-card.featured {
  border-color: var(--primary);
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.2);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  right: 20px;
  background: var(--primary);
  color: white;
  font-size: 0.725rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 10px;
  border-radius: 9999px;
}

.pricing-price {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0.75rem 0;
}

.pricing-features {
  list-style: none;
  margin: 1.25rem 0;
  flex: 1;
}

.pricing-features li {
  font-size: 0.825rem;
  color: var(--slate-600);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  color: white;
  background: var(--slate-900);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: slideIn 0.25s ease forwards;
}

.toast.success { background: #059669; }
.toast.error { background: #dc2626; }
.toast.warning { background: #d97706; }

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

/* Responsive */
@media (max-width: 768px) {
  .hero-title { font-size: 1.85rem; }
  .viewer-body { flex-direction: column; }
  .viewer-sidebar { width: 100%; height: 260px; }
  .pricing-grid { grid-template-columns: 1fr; }
  .quota-banner { flex-direction: column; align-items: stretch; }
}
