/* Resumidor Onix — tema claro, refinado (regra permanente do Dr.) */
:root {
  --bg: linear-gradient(150deg, #eef5ff 0%, #e3f2fd 55%, #e8f5ee 100%);
  --card: #ffffff;
  --ink: #14324a;
  --muted: #5b7489;
  --line: #dbe7f3;
  --brand: #1273c9;
  --brand-dark: #0b5cA6;
  --brand-soft: #e2f0ff;
  --accent: #0f9d6c;
  --accent-soft: #e3f6ee;
  --what: #e11d48;
  --radius: 16px;
  --shadow: 0 14px 40px rgba(18, 84, 140, .14);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.screen { min-height: 100vh; display: flex; flex-direction: column; }
.screen[hidden] { display: none !important; }

/* ---------- login ---------- */
#screen-login { align-items: center; justify-content: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 400px; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 36px 30px; text-align: center; border: 1px solid var(--line);
}
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(150deg, var(--brand), var(--accent));
  color: #fff; font-size: 30px; box-shadow: 0 8px 20px rgba(18,115,201,.35);
}
.brand-mark.small { width: 34px; height: 34px; font-size: 18px; }
.login-card h1 { margin: 16px 0 6px; font-size: 26px; }
.login-card h1 span { color: var(--brand); }
.login-sub { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 22px; }
#login-form input {
  width: 100%; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 15px; margin-bottom: 12px; outline: none; transition: border .15s;
}
#login-form input:focus { border-color: var(--brand); }
#login-form button {
  width: 100%; padding: 13px; border: none; border-radius: 10px; font-size: 15px; font-weight: 600;
  color: #fff; background: linear-gradient(150deg, var(--brand), var(--accent)); cursor: pointer;
  box-shadow: 0 8px 18px rgba(18,115,201,.30); transition: transform .1s;
}
#login-form button:hover { transform: translateY(-1px); }
.error { color: var(--what); font-size: 13px; margin: 10px 0 0; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 20px; background: rgba(255,255,255,.88); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-brand { display: flex; align-items: center; gap: 10px; }
.topbar-brand strong { font-size: 17px; }
.topbar-tag { color: var(--muted); font-size: 13px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.char-note { color: var(--brand-dark); font-size: 13px; font-weight: 600; }
.link-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; }
.link-btn:hover { color: var(--what); }

/* ---------- layout ---------- */
.wrap { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 24px 20px 40px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 22px;
}
.card h2 { margin: 0 0 6px; font-size: 18px; }
.hint { color: var(--muted); font-size: 13.5px; margin: 0 0 16px; line-height: 1.5; }

.field-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.titulo-input {
  flex: 1 1 280px; min-width: 220px; padding: 11px 13px; border: 1.5px solid var(--line);
  border-radius: 10px; font-size: 14.5px; outline: none;
}
.titulo-input:focus { border-color: var(--brand); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); cursor: pointer; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }

textarea#in-texto {
  width: 100%; min-height: 260px; resize: vertical; padding: 14px; border: 1.5px solid var(--line);
  border-radius: 12px; font-size: 14.5px; line-height: 1.55; outline: none; font-family: inherit;
}
textarea#in-texto:focus { border-color: var(--brand); }
.input-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
#counter { color: var(--muted); font-size: 13px; }
.primary-btn {
  padding: 12px 20px; border: none; border-radius: 11px; font-size: 15px; font-weight: 700; color: #fff;
  background: linear-gradient(150deg, var(--brand), var(--accent)); cursor: pointer;
  box-shadow: 0 8px 18px rgba(18,115,201,.28); transition: transform .1s, opacity .1s;
}
.primary-btn:hover:not(:disabled) { transform: translateY(-1px); }
.primary-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- output ---------- */
.out-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.out-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ghost-btn {
  padding: 11px 16px; border: 1.5px solid var(--line); border-radius: 11px; background: var(--brand-soft);
  color: var(--brand-dark); font-size: 14px; font-weight: 600; cursor: pointer;
}
.ghost-btn:hover { border-color: var(--brand); }
.preview {
  background: #fbfdff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px;
  line-height: 1.62; font-size: 14.5px;
}
.preview h1, .preview h2, .preview h3 { color: var(--brand-dark); line-height: 1.3; }
.preview h1 { font-size: 20px; }
.preview h2 { font-size: 17px; margin-top: 22px; border-bottom: 2px solid var(--brand-soft); padding-bottom: 5px; }
.preview p { margin: 10px 0; }
.preview strong { color: var(--ink); }
.preview blockquote {
  margin: 14px 0; padding: 12px 16px; background: var(--brand-soft); border-left: 4px solid var(--brand);
  border-radius: 0 10px 10px 0;
}
.preview blockquote p { margin: 4px 0; }
.preview ol, .preview ul { margin: 8px 0; padding-left: 24px; }
.preview li { margin: 4px 0; }
.preview pre { background: #0f2537; color: #e8f2fb; padding: 14px; border-radius: 10px; overflow-x: auto; font-size: 13px; }
.raw {
  background: #fbfdff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; margin: 0; line-height: 1.5;
}
.out-footer { margin-top: 12px; }
.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 14px 0 26px; }

@media (max-width: 620px) {
  .topbar-tag { display: none; }
  .wrap { padding: 16px 12px 32px; }
  .card { padding: 18px 16px; }
}
