/* ==========================================================================
   CÁPSULA SECRETA: MENSAJES CIFRADOS CON CONTRASEÑA
   Estándar de diseño Midnight Slate (Fijate.com)
   ========================================================================== */

:root {
  /* Variables temáticas - Modo oscuro por defecto */
  --bg-main: #0b0f17;
  --bg-surface: #111827;
  --bg-surface-elevated: #1a2333;
  --bg-surface-hover: #222d42;
  --border-color: #1f293d;
  --border-color-hover: #2d3b55;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --color-primary: #10b981;
  --color-primary-hover: #059669;
  --color-primary-rgb: 16, 185, 129;

  --color-accent: #06b6d4;
  --color-accent-hover: #0891b2;
  --color-accent-rgb: 6, 182, 212;

  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-danger-rgb: 239, 68, 68;

  --mono-font: 'JetBrains Mono', monospace;
  --heading-font: 'Outfit', sans-serif;
  --body-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.2);
  --shadow-accent-glow: 0 0 20px rgba(6, 182, 212, 0.2);
}

[data-theme="light"] {
  --bg-main: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f8fafc;
  --bg-surface-hover: #f1f5f9;
  --border-color: #cbd5e1;
  --border-color-hover: #94a3b8;

  --text-main: #0f172a;
  --text-muted: #334155;
  --text-dim: #475569;

  --color-primary: #059669;
  --color-primary-hover: #047857;
  --color-accent: #0284c7;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 20px rgba(5, 150, 105, 0.15);
}

/* ==========================================================================
   Estructura general y tipografía
   ========================================================================== */

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--body-font);
  margin: 0;
  padding: 0;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--heading-font);
  color: var(--text-main);
  margin-top: 0;
}

.mono-font {
  font-family: var(--mono-font) !important;
}

.tool-layout {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  width: 100%;
  box-sizing: border-box;
}

/* ==========================================================================
   Hero Banner & Badges de Seguridad
   ========================================================================== */

.capsule-hero-card {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-surface-elevated) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.capsule-hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, rgba(6, 182, 212, 0.03) 50%, transparent 70%);
  pointer-events: none;
}

.badge-protocol {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.12);
  color: var(--color-primary);
  border: 1px solid rgba(16, 185, 129, 0.25);
  margin-bottom: 0.75rem;
}

.capsule-main-heading {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
  line-height: 1.25;
}

.capsule-hero-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 820px;
  margin: 0;
}

.security-pills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.sec-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  color: var(--text-main);
  font-weight: 500;
}

.sec-pill svg {
  color: var(--color-accent);
  flex-shrink: 0;
}

/* ==========================================================================
   Pestañas de Navegación Dual (Crear / Descifrar)
   ========================================================================== */

.tabs-nav-wrapper {
  margin-bottom: 1.25rem;
}

.tabs-nav {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-surface);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--body-font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  transition: all 0.2s ease;
  position: relative;
}

.tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-surface-hover);
}

.tab-btn.is-active {
  background: var(--color-primary);
  color: #0b0f17;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
  font-weight: 700;
}

.tab-notify-badge {
  background: var(--color-danger);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  animation: pulse-attention 1.5s infinite;
}

@keyframes pulse-attention {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); box-shadow: 0 0 10px rgba(239, 68, 68, 0.6); }
  100% { transform: scale(1); }
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

/* ==========================================================================
   Tarjetas contenedor (Card Box)
   ========================================================================== */

.card-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Formularios y Controles
   ========================================================================== */

.form-group {
  margin-bottom: 1.35rem;
}

.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.45rem;
}

.label-optional {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 0.8rem;
}

.char-counter {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--mono-font);
}

.form-control {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--body-font);
  font-size: 0.95rem;
  padding: 0.75rem 0.95rem;
  min-height: 44px;
  line-height: 1.5;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

textarea.form-control {
  resize: vertical;
  min-height: 110px;
}

/* Desplegables <select> canónicos con flecha SVG y colores explícitos */
select.form-control {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-color: var(--bg-main);
  color: var(--text-main);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
  cursor: pointer;
}

select.form-control option,
select.form-control optgroup {
  background-color: var(--bg-surface-elevated);
  color: var(--text-main);
  padding: 8px 12px;
}

.input-with-action {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-with-action input {
  padding-right: 46px;
}

.btn-input-icon {
  position: absolute;
  right: 6px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background-color 0.2s;
}

.btn-input-icon:hover {
  color: var(--text-main);
  background: var(--bg-surface-hover);
}

.btn-text-action {
  background: transparent;
  border: none;
  color: var(--color-accent);
  font-size: 0.825rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}

.btn-text-action:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.form-hint-text {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
  margin-bottom: 0;
  line-height: 1.4;
}

/* ==========================================================================
   Medidor de entropía de contraseña
   ========================================================================== */

.entropy-meter-box {
  margin-top: 0.6rem;
}

.entropy-bar-track {
  width: 100%;
  height: 5px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.entropy-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-full);
  transition: width 0.3s ease, background-color 0.3s ease;
}

.entropy-bar-fill.weak {
  width: 25%;
  background-color: var(--color-danger);
}

.entropy-bar-fill.medium {
  width: 55%;
  background-color: var(--color-warning);
}

.entropy-bar-fill.strong {
  width: 80%;
  background-color: var(--color-primary);
}

.entropy-bar-fill.military {
  width: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.6);
}

.entropy-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.entropy-label {
  font-weight: 600;
  color: var(--text-muted);
}

.entropy-crack-time {
  font-family: var(--mono-font);
  color: var(--text-dim);
}

/* ==========================================================================
   Opciones de Formato de Entrega (Radio Cards)
   ========================================================================== */

.delivery-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
}

.delivery-card {
  display: block;
  position: relative;
  cursor: pointer;
}

.delivery-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.delivery-card-content {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.95rem;
  min-height: 80px;
  box-sizing: border-box;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.delivery-card:hover .delivery-card-content {
  border-color: var(--border-color-hover);
  background: var(--bg-surface-elevated);
}

.delivery-card input[type="radio"]:checked + .delivery-card-content,
.delivery-card.is-selected .delivery-card-content {
  border-color: var(--color-primary);
  background: rgba(16, 185, 129, 0.05);
  box-shadow: 0 0 0 1px var(--color-primary);
}

.delivery-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  flex-shrink: 0;
}

.delivery-text strong {
  display: block;
  font-size: 0.885rem;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.delivery-text span {
  display: block;
  font-size: 0.775rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* ==========================================================================
   Subpanel de Esteganografía
   ========================================================================== */

.stego-config-box {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.35rem;
}

.stego-options-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.btn-upload-stego {
  margin: 0;
  cursor: pointer;
}

.stego-preview-wrapper {
  position: relative;
  background: #000000;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  max-height: 240px;
}

.stego-preview-wrapper canvas {
  width: 100%;
  max-width: 600px;
  height: auto;
  display: block;
  object-fit: cover;
}

.stego-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(11, 15, 23, 0.85);
  border: 1px solid var(--border-color);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  backdrop-filter: blur(4px);
}

/* ==========================================================================
   Botones de Acción y Regla Táctil (≥ 40px)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--body-font);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  box-sizing: border-box;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--color-primary);
  color: #0b0f17;
  font-weight: 700;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-color-hover);
}

.btn-secondary.is-active {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--color-danger);
}

.btn-danger:hover {
  background: var(--color-danger);
  color: #ffffff;
}

.btn-action-main {
  width: 100%;
  font-size: 1.05rem;
  min-height: 48px;
  border-radius: var(--radius-md);
}

.form-actions-row {
  margin-top: 1rem;
}

/* ==========================================================================
   Caja de Resultado de la Cápsula
   ========================================================================== */

.result-card-box {
  background: linear-gradient(145deg, var(--bg-surface) 0%, var(--bg-surface-elevated) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: var(--shadow-glow);
}

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

.result-badge-success {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-primary);
  font-weight: 700;
  font-size: 1.1rem;
}

.result-algo-tag {
  font-family: var(--mono-font);
  font-size: 0.75rem;
  background: rgba(6, 182, 212, 0.12);
  color: var(--color-accent);
  border: 1px solid rgba(6, 182, 212, 0.25);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
}

.result-section {
  margin-bottom: 1.25rem;
}

.btn-copy-link {
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.result-note {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
  line-height: 1.45;
}

.qr-display-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  background: #ffffff;
  border-radius: var(--radius-md);
  margin-top: 0.5rem;
}

.qr-canvas-holder {
  margin-bottom: 1rem;
}

.qr-canvas-holder img,
.qr-canvas-holder canvas {
  display: block;
  max-width: 100%;
}

.stego-result-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.stego-image-preview-box img {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius-sm);
  display: block;
  margin-bottom: 1rem;
}

.result-secondary-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.result-secondary-actions .btn {
  flex: 1 1 200px;
}

/* ==========================================================================
   Panel Descifrar: Entrada y Pista
   ========================================================================== */

.incoming-capsule-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.15) 0%, rgba(16, 185, 129, 0.15) 100%);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.banner-icon-glow {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: rgba(6, 182, 212, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  flex-shrink: 0;
}

.banner-body strong {
  display: block;
  color: var(--text-main);
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.banner-body p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.decrypt-source-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.btn-source-tab {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: var(--body-font);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  min-height: 40px;
  transition: all 0.2s ease;
}

.btn-source-tab.is-active {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.decrypt-source-panel {
  display: none;
}

.decrypt-source-panel.is-active {
  display: block;
}

.dropzone-area {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  text-align: center;
  background: var(--bg-main);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.dropzone-area:hover,
.dropzone-area.drag-over {
  border-color: var(--color-primary);
  background: rgba(16, 185, 129, 0.04);
}

.dropzone-content svg {
  color: var(--color-primary);
  margin-bottom: 0.6rem;
}

.dropzone-content strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
  color: var(--text-main);
}

.dropzone-content span {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.dropzone-preview img {
  max-width: 100%;
  max-height: 220px;
  border-radius: var(--radius-sm);
  display: block;
  margin: 0 auto 0.75rem;
}

.stego-detected-badge {
  display: inline-block;
  background: rgba(16, 185, 129, 0.2);
  color: var(--color-primary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.hint-display-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.hint-icon {
  color: var(--color-warning);
  flex-shrink: 0;
  margin-top: 2px;
}

.hint-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-warning);
  display: block;
  margin-bottom: 0.2rem;
}

.hint-text {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-main);
  font-weight: 500;
}

/* ==========================================================================
   Terminal Cinemática de Revelado
   ========================================================================== */

.terminal-reveal-box {
  background: #050811;
  border: 1px solid rgba(6, 182, 212, 0.4);
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.15);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
}

.terminal-header {
  background: #0b1120;
  border-bottom: 1px solid rgba(6, 182, 212, 0.2);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.terminal-title {
  font-family: var(--mono-font);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.terminal-badge {
  font-family: var(--mono-font);
  font-size: 0.7rem;
  color: var(--color-primary);
  background: rgba(16, 185, 129, 0.15);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Barra de combustión / autodestrucción */
.burn-timer-wrapper {
  background: rgba(239, 68, 68, 0.08);
  border-bottom: 1px solid rgba(239, 68, 68, 0.25);
  padding: 0.65rem 1.25rem;
}

.burn-timer-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  margin-bottom: 0.4rem;
}

.burn-label {
  color: var(--color-danger);
  font-weight: 700;
}

.burn-countdown {
  color: var(--color-danger);
  font-weight: 800;
}

.burn-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.burn-progress-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  transition: width 1s linear;
}

.terminal-content {
  padding: 1.5rem;
  min-height: 120px;
}

.decrypted-text-view {
  color: #38bdf8;
  font-size: 1.05rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
}

.terminal-actions-row {
  background: #0b1120;
  border-top: 1px solid rgba(6, 182, 212, 0.2);
  padding: 0.85rem 1.25rem;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ==========================================================================
   Modales (Pase Confidencial y Feedback sin Alerts)
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

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

.modal-card-dialog,
.modal-feedback-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-feedback-dialog {
  max-width: 440px;
}

.modal-card-header,
.modal-feedback-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-card-title,
.modal-feedback-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.btn-modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.btn-modal-close:hover {
  color: var(--text-main);
}

.modal-card-body,
.modal-feedback-body {
  padding: 1.5rem;
}

.modal-subtitle-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0;
  margin-bottom: 1rem;
}

.pass-canvas-container {
  background: #000000;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.pass-canvas-container canvas {
  width: 100%;
  height: auto;
  display: block;
}

.modal-card-footer,
.modal-feedback-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface-elevated);
}

.modal-feedback-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(6, 182, 212, 0.15);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.75rem;
}

.modal-feedback-icon.is-error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
}

/* Toast flotante */
.floating-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--color-primary);
  color: var(--text-main);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 10000;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.floating-toast.is-active {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Adaptación Móvil y Responsividad
   ========================================================================== */

@media (max-width: 768px) {
  .tool-layout {
    margin: 1rem auto 2rem;
    padding: 0 0.75rem;
  }

  .capsule-hero-card {
    padding: 1.25rem;
  }

  .capsule-main-heading {
    font-size: 1.4rem;
  }

  .security-pills-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .delivery-options-grid {
    grid-template-columns: 1fr;
  }

  .result-secondary-actions .btn {
    width: 100%;
    flex: 1 1 100%;
  }

  .btn-action-main {
    width: 100%;
  }

  .input-with-action {
    flex-direction: column;
    gap: 0.5rem;
  }

  .input-with-action input {
    padding-right: 12px;
  }

  .btn-copy-link {
    margin-left: 0;
    width: 100%;
  }

  .floating-toast {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    text-align: center;
  }
}
