/* =====================================================
   PROMPT FORMATTER — Premium CSS
   Design: Refined Dark Luxury + Glass Morphism
   ===================================================== */

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

/* ===== TOKENS ===== */
:root {
  /* Paleta base — Light */
  --c-bg:          #f0f2f8;
  --c-surface:     rgba(255,255,255,0.82);
  --c-surface-2:   rgba(255,255,255,0.55);
  --c-border:      rgba(180,190,220,0.45);
  --c-text-1:      #14152a;
  --c-text-2:      #5a5f82;
  --c-text-3:      #9196b0;

  /* Acento — Índigo elétrico */
  --c-accent:      #5b5ef4;
  --c-accent-h:    #4244d4;
  --c-accent-glow: rgba(91,94,244,0.28);
  --c-accent-soft: rgba(91,94,244,0.10);

  /* Sucesso / código */
  --c-ok:          #22c55e;
  --c-ok-bg:       rgba(34,197,94,0.08);
  --c-ok-border:   rgba(34,197,94,0.30);

  /* Danger */
  --c-danger:      #ef4444;
  --c-danger-bg:   rgba(239,68,68,0.08);
  --c-danger-h:    #dc2626;

  /* Gradientes mesh de fundo */
  --mesh-1: radial-gradient(ellipse 60% 50% at 15% 30%, rgba(91,94,244,0.12) 0%, transparent 70%);
  --mesh-2: radial-gradient(ellipse 55% 45% at 85% 70%, rgba(139,92,246,0.10) 0%, transparent 70%);
  --mesh-3: radial-gradient(ellipse 50% 40% at 50% 0%,  rgba(99,179,237,0.08) 0%, transparent 70%);

  /* Radii */
  --r-sm:  8px;
  --r-md:  14px;
  --r-lg:  20px;
  --r-xl:  28px;

  /* Sombras */
  --shadow-card: 0 2px 4px rgba(20,21,42,0.04), 0 8px 24px rgba(20,21,42,0.06), 0 0 0 1px rgba(180,190,220,0.30);
  --shadow-btn:  0 1px 3px rgba(91,94,244,0.20), 0 4px 14px rgba(91,94,244,0.18);
  --shadow-focus:0 0 0 3px var(--c-accent-glow);

  /* Duração */
  --dur-fast: 0.15s;
  --dur-mid:  0.28s;
  --dur-slow: 0.50s;
  --ease: cubic-bezier(0.34,1.30,0.64,1);
  --ease-in: cubic-bezier(0.4,0,1,1);
  --ease-out: cubic-bezier(0,0,0.2,1);
}

body.dark {
  --c-bg:          #0d0e1a;
  --c-surface:     rgba(22,24,44,0.88);
  --c-surface-2:   rgba(30,33,58,0.65);
  --c-border:      rgba(80,88,130,0.25);
  --c-text-1:      #e8eaf4;
  --c-text-2:      #8890b8;
  --c-text-3:      #555e82;

  --c-accent:      #7c7ff6;
  --c-accent-h:    #6061f0;
  --c-accent-glow: rgba(124,127,246,0.30);
  --c-accent-soft: rgba(124,127,246,0.10);

  --c-ok:          #34d399;
  --c-ok-bg:       rgba(52,211,153,0.07);
  --c-ok-border:   rgba(52,211,153,0.22);

  --c-danger:      #f87171;
  --c-danger-bg:   rgba(248,113,113,0.08);
  --c-danger-h:    #ef4444;

  --mesh-1: radial-gradient(ellipse 60% 50% at 15% 30%, rgba(124,127,246,0.15) 0%, transparent 70%);
  --mesh-2: radial-gradient(ellipse 55% 45% at 85% 70%, rgba(167,139,250,0.12) 0%, transparent 70%);
  --mesh-3: radial-gradient(ellipse 50% 40% at 50% 0%,  rgba(99,179,237,0.06) 0%, transparent 70%);

  --shadow-card: 0 2px 4px rgba(0,0,0,0.20), 0 8px 32px rgba(0,0,0,0.28), 0 0 0 1px rgba(80,88,130,0.18);
  --shadow-btn:  0 1px 3px rgba(124,127,246,0.25), 0 4px 16px rgba(124,127,246,0.22);
}

/* ===== SPLASH SCREEN ===== */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d0e1a;
  /* Mesh igual ao dark mode para consistência */
  background-image:
    radial-gradient(ellipse 60% 50% at 15% 30%, rgba(124,127,246,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 55% 45% at 85% 70%, rgba(167,139,250,0.14) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 50% 0%,  rgba(99,179,237,0.08) 0%, transparent 70%);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.splash-out {
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
}

.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: splashFadeIn 0.5s ease both;
}

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

/* ── Ícone ── */
.splash-icon {
  position: relative;
  width: 88px;
  height: 88px;
  animation: splashIconPop 0.6s cubic-bezier(0.34,1.56,0.64,1) 0.1s both;
}

@keyframes splashIconPop {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}

.splash-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 24px rgba(91,94,244,0.55));
}

/* Raios do sparkle — desenham-se em sequência */
.ray {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: drawRay 0.5s ease forwards;
}
.ray-v  { animation-delay: 0.35s; }
.ray-h  { animation-delay: 0.50s; }
.ray-d1 { animation-delay: 0.65s; }
.ray-d2 { animation-delay: 0.80s; }

.ray-dot {
  opacity: 0;
  animation: fadeIn 0.3s ease 0.95s forwards;
}

@keyframes drawRay {
  to { stroke-dashoffset: 0; }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

/* Pulso contínuo após aparecer */
.splash-icon {
  animation:
    splashIconPop 0.6s cubic-bezier(0.34,1.56,0.64,1) 0.1s both,
    splashPulse   2s ease-in-out 1s infinite;
}

@keyframes splashPulse {
  0%, 100% { filter: drop-shadow(0 0 24px rgba(91,94,244,0.55)); }
  50%       { filter: drop-shadow(0 0 36px rgba(124,127,246,0.80)); }
}

/* ── Textos ── */
.splash-title {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #e8eaf4;
  letter-spacing: -0.02em;
  animation: splashFadeIn 0.5s ease 0.5s both;
}

.splash-sub {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.85rem;
  color: #555e82;
  font-weight: 400;
  animation: splashFadeIn 0.5s ease 0.65s both;
}

/* ── Barra de progresso ── */
.splash-bar-track {
  width: 180px;
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
  animation: splashFadeIn 0.4s ease 0.7s both;
}

.splash-bar {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, #5b5ef4, #a78bfa);
  transition: width 0.8s ease;
  animation: splashProgress 0.9s ease 0.75s forwards;
}

@keyframes splashProgress {
  0%   { width: 0%; }
  40%  { width: 55%; }
  80%  { width: 82%; }
  100% { width: 92%; } /* os últimos % completam no dismiss */
}

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

html { -webkit-text-size-adjust: 100%; }

/* ===== BODY & FUNDO ===== */
body {
  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--c-bg);
  color: var(--c-text-1);
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 48px;
  transition: background var(--dur-mid) var(--ease-out),
              color var(--dur-mid) var(--ease-out);
  position: relative;
  overflow-x: hidden;
}

/* Mesh animado de fundo */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--mesh-1), var(--mesh-2), var(--mesh-3);
  pointer-events: none;
  z-index: 0;
  animation: meshFloat 12s ease-in-out infinite alternate;
}

@keyframes meshFloat {
  0%   { opacity: 1; transform: scale(1) translateY(0); }
  100% { opacity: 0.85; transform: scale(1.06) translateY(-12px); }
}

/* ===== CARD PRINCIPAL ===== */
.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1180px;
  background: var(--c-surface);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--c-border);
  padding: 40px 36px 44px;
  transition: background var(--dur-mid), box-shadow var(--dur-mid);

  /* Fade-in ao carregar */
  animation: cardIn 0.6s var(--ease-out) both;
}

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

/* Linha decorativa de topo */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c-accent), #a78bfa, var(--c-accent));
  background-size: 200%;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  animation: shimmer 4s linear infinite;
}

@keyframes shimmer {
  from { background-position: 0% center; }
  to   { background-position: 200% center; }
}

/* ===== HEADER ===== */
.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.header-text { flex: 1; min-width: 0; }

.logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--c-accent-soft);
  border: 1px solid rgba(91,94,244,0.20);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 10px;
}

.logo-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-accent);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--c-text-1) 40%, var(--c-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.subtitle {
  color: var(--c-text-2);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.5;
}

/* ===== BOTÃO TEMA ===== */
.theme-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  background: var(--c-surface-2);
  backdrop-filter: blur(8px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--c-text-2);
  transition: all var(--dur-fast) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.theme-btn:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
  transform: scale(1.06);
  box-shadow: var(--shadow-focus);
}

.theme-btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* ===== SEÇÃO API KEY ===== */
.api-panel {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  transition: background var(--dur-mid), border-color var(--dur-mid);
}

.api-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-text-2);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}

.api-input {
  flex: 1 1 200px;
  min-width: 160px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--c-border);
  background: var(--c-bg);
  color: var(--c-text-1);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  transition: border var(--dur-fast), box-shadow var(--dur-fast);
}

.api-input:focus { outline: none; border-color: var(--c-accent); box-shadow: var(--shadow-focus); }
.api-input::placeholder { color: var(--c-text-3); }

.api-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--c-text-3);
  white-space: nowrap;
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-text-3);
  transition: background var(--dur-mid), box-shadow var(--dur-mid);
}

.status-dot.active {
  background: var(--c-ok);
  box-shadow: 0 0 8px var(--c-ok);
  animation: pulse-dot 2s ease-in-out infinite;
}

/* ===== MINI BOTÕES ===== */
.btn-mini {
  padding: 7px 14px;
  border-radius: var(--r-sm);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  border: 1px solid transparent;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-mini:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.btn-mini:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.btn-mini.primary {
  background: var(--c-accent);
  color: #fff;
  border-color: var(--c-accent);
  box-shadow: var(--shadow-btn);
}
.btn-mini.primary:hover {
  background: var(--c-accent-h);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px var(--c-accent-glow);
}

.btn-mini.ghost {
  background: transparent;
  border-color: var(--c-danger);
  color: var(--c-danger);
}
.btn-mini.ghost:hover {
  background: var(--c-danger-bg);
  transform: translateY(-1px);
}

/* ===== SELETOR DE TEMPLATE ===== */
.template-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.tpl-btn {
  padding: 7px 16px;
  border-radius: 24px;
  border: 1px solid var(--c-border);
  background: var(--c-surface-2);
  color: var(--c-text-2);
  font-family: 'Outfit', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  user-select: none;
}

.tpl-btn:hover { border-color: var(--c-accent); color: var(--c-accent); background: var(--c-accent-soft); }
.tpl-btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

.tpl-btn.active {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: #fff;
  box-shadow: var(--shadow-btn);
  font-weight: 600;
}

/* ===== COLUNAS ===== */
.columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

@media (min-width: 800px) {
  .columns { grid-template-columns: 1fr 1fr; }
}

/* ===== FIELD LABEL ===== */
.field-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-text-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.field-label-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--c-accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

/* ===== TEXTAREA ===== */
textarea, .refine-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  background: var(--c-bg);
  color: var(--c-text-1);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
  transition: border var(--dur-fast), box-shadow var(--dur-fast), background var(--dur-mid);
}

textarea { min-height: 160px; }

textarea:focus, .refine-input:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: var(--shadow-focus);
}

textarea::placeholder, .refine-input::placeholder { color: var(--c-text-3); }

.char-counter {
  text-align: right;
  font-size: 0.78rem;
  color: var(--c-text-3);
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}

/* ===== CHECKBOXES ===== */
.options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin: 14px 0;
}

.opt-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.87rem;
  color: var(--c-text-2);
  cursor: pointer;
  user-select: none;
  transition: color var(--dur-fast);
}

.opt-label:hover { color: var(--c-text-1); }

.opt-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--c-border);
  background: var(--c-bg);
  cursor: pointer;
  position: relative;
  transition: all var(--dur-fast);
  flex-shrink: 0;
}

.opt-label input[type="checkbox"]:checked {
  background: var(--c-accent);
  border-color: var(--c-accent);
  box-shadow: 0 0 0 2px var(--c-accent-glow);
}

.opt-label input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 4l3 3 5-6' stroke='white' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px 8px;
}

/* ===== BOTÃO PRINCIPAL ===== */
.btn-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--c-accent), #7c7ff6);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-family: 'Outfit', sans-serif;
  font-size: 0.97rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  box-shadow: var(--shadow-btn);
  position: relative;
  overflow: hidden;
}

.btn-main::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
  opacity: 0;
  transition: opacity var(--dur-fast);
}

.btn-main:hover::before { opacity: 1; }

.btn-main:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px var(--c-accent-glow), var(--shadow-btn);
}

.btn-main:active { transform: translateY(0) scale(0.98); }

.btn-main:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-main:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* ===== PAINEL DE REFINAMENTO ===== */
.refine-panel {
  margin-top: 18px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 16px;
}

.refine-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

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

.refine-input {
  flex: 1;
  min-width: 0;
  resize: none;
  font-size: 0.875rem;
  padding: 9px 13px;
}

.btn-apply {
  padding: 9px 18px;
  background: var(--c-accent);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--dur-fast) var(--ease-out);
  box-shadow: var(--shadow-btn);
}

.btn-apply:hover { background: var(--c-accent-h); transform: translateY(-1px); }
.btn-apply:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

.refine-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.rtag {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--c-border);
  background: var(--c-bg);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--c-text-3);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  user-select: none;
}

.rtag:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
  background: var(--c-accent-soft);
  transform: translateY(-1px);
}

/* ===== ÁREA DE SAÍDA ===== */
.output-wrap { position: relative; }

.output-box {
  background: var(--c-ok-bg);
  border: 1px solid var(--c-ok-border);
  border-radius: var(--r-md);
  padding: 20px;
  min-height: 200px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.75;
  color: var(--c-text-1);
  white-space: pre-wrap;
  word-break: break-word;
  transition: background var(--dur-mid), border-color var(--dur-mid);
  position: relative;
  overflow: hidden;
}

/* Estado vazio */
.output-box:empty::before, .output-box.empty::before {
  content: 'O prompt formatado aparecerá aqui…';
  color: var(--c-text-3);
  font-style: italic;
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
}

/* Estado loading */
.output-box.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-color: var(--c-accent-glow);
  background: var(--c-accent-soft);
}

.spinner-ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-accent);
  animation: spin 0.7s linear infinite;
}

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

.loading-msg {
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  color: var(--c-text-2);
}

/* Flash de sucesso */
@keyframes flashSuccess {
  0%   { box-shadow: 0 0 0 0 var(--c-ok); }
  40%  { box-shadow: 0 0 0 6px rgba(34,197,94,0.18); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.flash { animation: flashSuccess 0.6s ease; }

/* Texto digitando */
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.cursor-blink::after {
  content: '▍';
  font-size: 0.85em;
  animation: blink 0.8s step-end infinite;
  color: var(--c-accent);
}

/* ===== BOTÕES DE AÇÃO (SAÍDA) ===== */
.output-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--c-border);
  background: var(--c-surface-2);
  color: var(--c-text-2);
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}

.btn-action:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
  background: var(--c-accent-soft);
  transform: translateY(-1px);
}

.btn-action:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* ===== HISTÓRICO ===== */
.history-section {
  margin-top: 14px;
  border-top: 1px solid var(--c-border);
  padding-top: 12px;
}

.history-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-text-3);
  margin-bottom: 8px;
}

.history-list {
  list-style: none;
  max-height: 130px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--c-border) transparent;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-item {
  padding: 7px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--c-text-2);
  transition: all var(--dur-fast);
  border: 1px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item:hover {
  background: var(--c-accent-soft);
  border-color: var(--c-border);
  color: var(--c-text-1);
}

/* ===== DIVIDER ===== */
.divider {
  width: 100%;
  height: 1px;
  background: var(--c-border);
  margin: 4px 0;
}

/* ===== FOCUS VISIBLE GLOBAL ===== */
:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--r-sm); }

/* ===== BANNER INFORMATIVO (file://) ===== */
.file-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: var(--r-md);
  padding: 10px 14px;
  margin-bottom: 18px;
  font-size: 0.83rem;
  color: var(--c-text-2);
  line-height: 1.5;
  animation: cardIn 0.4s var(--ease-out) both;
}

.file-banner[hidden] { display: none; }

.file-banner code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8em;
  background: rgba(245, 158, 11, 0.15);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--c-text-1);
}

.file-banner-close {
  margin-left: auto;
  flex-shrink: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--c-text-3);
  font-size: 0.85rem;
  padding: 0 2px;
  line-height: 1;
  transition: color var(--dur-fast);
}
.file-banner-close:hover { color: var(--c-text-1); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 99px; }

/* ===== SNACKBAR / TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--c-text-1);
  color: var(--c-bg);
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 0.87rem;
  font-weight: 500;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s var(--ease-out);
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===== RESPONSIVO MOBILE ===== */
@media (max-width: 480px) {
  .card { padding: 24px 18px 32px; }
  .api-panel { flex-direction: column; align-items: flex-start; }
  .api-input { min-width: 100%; }
  .btn-main { width: 100%; justify-content: center; }
}
