:root {
  --bg: #f7f3ee;
  --card: #ffffff;
  --ink: #1c1a17;
  --ink-soft: #6b6156;
  --line: #eae2d8;

  /* cores extraídas do logo da Companhia das Marcas */
  --logo-black: #1a1a1a;
  --gold: #eea23c;
  --orange: #e2632b;
  --lime: #7cc142;
  --teal: #35ab8e;
  --blue: #3d72b4;
  --indigo: #3a4a86;

  --accent: var(--orange);
  --accent-dark: #c14f21;
  --accent-soft: #fbe4d1;
  --pin: var(--lime);
  --pin-soft: #e6f3da;
  --shadow: 0 2px 10px rgba(43, 36, 29, 0.06);
  --shadow-lg: 0 12px 30px rgba(43, 36, 29, 0.12);
  --radius: 16px;
  --brand-gradient: linear-gradient(100deg, var(--gold), var(--orange) 45%, var(--lime) 100%);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

[hidden] { display: none !important; }

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- Login ---------- */

#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 20%, rgba(226, 99, 43, 0.14), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(53, 171, 142, 0.14), transparent 45%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 40px 32px;
}

.login-mark {
  width: 46px;
  height: 46px;
  display: block;
  margin-bottom: 14px;
}

.login-logo {
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.login-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 6px;
}

.login-sub {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0 0 28px;
  line-height: 1.5;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink-soft);
}

.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  background: #fdfbf9;
  color: var(--ink);
}

.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.btn-primary {
  width: 100%;
  background: var(--logo-black);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px;
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.85; }

.demo-hint {
  margin-top: 20px;
  font-size: 12px;
  color: var(--ink-soft);
  background: #faf6f1;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  line-height: 1.6;
}
.demo-hint b { color: var(--ink); }

.login-error {
  color: #b3311c;
  font-size: 13px;
  margin: -8px 0 14px;
}

/* ---------- App shell ---------- */

#app { min-height: 100vh; }

nav.topbar {
  background: var(--logo-black);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand img { width: 26px; height: 26px; display: block; }
.brand .thin { font-weight: 400; opacity: 0.85; }

.nav-links {
  display: flex;
  gap: 4px;
}
.nav-links button {
  background: none;
  border: none;
  color: #fff;
  opacity: 0.75;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 20px;
}
.nav-links button.active, .nav-links button:hover {
  opacity: 1;
  background: rgba(255,255,255,0.14);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
}

.logout-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12px;
}

.hero {
  background: linear-gradient(120deg, #1a1a1a 0%, #2c2620 45%, var(--accent-dark) 100%, var(--lime) 160%);
  color: #fff;
  padding: 46px 28px 54px;
}
.hero-inner { max-width: 940px; margin: 0 auto; }
.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  opacity: 0.7;
  margin-bottom: 10px;
}
.hero h1 {
  font-size: 34px;
  margin: 0 0 10px;
  font-weight: 700;
  max-width: 560px;
  line-height: 1.2;
}
.hero p {
  opacity: 0.85;
  max-width: 480px;
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
}

.content {
  max-width: 940px;
  margin: -26px auto 60px;
  padding: 0 28px;
}

.greeting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 26px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 14px;
}
.greeting-row h2 { margin: 0; font-size: 20px; }
.greeting-row .eyebrow {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-soft); margin-bottom: 4px;
}

.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 20px;
}
.filter-chip.active {
  background: var(--logo-black);
  color: #fff;
  border-color: var(--logo-black);
}

.new-informe-btn {
  background: var(--brand-gradient);
  color: #241a0f;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow);
  transition: filter 0.15s;
}
.new-informe-btn:hover { filter: brightness(0.94); }

.feed { display: flex; flex-direction: column; gap: 16px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  display: block;
}

.card-body { padding: 20px 22px; }

.card-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.tag.pin {
  background: linear-gradient(100deg, var(--gold), var(--orange));
  color: #2a1a08;
}

/* categorias herdam as cores do logo */
.tag.cat-comercial { background: #fbe4d1; color: #b1521f; }
.tag.cat-visual { background: #e5f3da; color: #4b8a26; }
.tag.cat-rh { background: #dcf1ea; color: #227a63; }
.tag.cat-sistemas { background: #dfe9f6; color: #2c5690; }
.tag.cat-campanha { background: #fdedd0; color: #a97a17; }
.tag.cat-geral { background: #e7e3dc; color: #5b5347; }

.card h3 {
  margin: 0 0 8px;
  font-size: 19px;
  line-height: 1.3;
}

.card .meta {
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.card .body-text {
  font-size: 14px;
  line-height: 1.65;
  color: #423a30;
  white-space: pre-wrap;
}

.card-admin-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.card-admin-actions button {
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 4px 0;
}
.card-admin-actions button:hover { color: var(--accent); }
.card-admin-actions button.danger:hover { color: #b3311c; }

.grid-treinamentos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.training-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.training-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.training-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  background: linear-gradient(120deg, #1a1a1a, var(--accent-dark) 140%);
}

.training-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.training-body h3 {
  margin: 2px 0 0;
  font-size: 16px;
  line-height: 1.35;
}

.training-desc {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.55;
  flex: 1;
}

.training-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-dark);
  text-decoration: none;
  margin-top: 4px;
}
.training-link:hover { text-decoration: underline; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}

/* ---------- Modal / composer ---------- */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(30, 24, 18, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 50;
}

.modal {
  background: #fff;
  width: 100%;
  max-width: 560px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 28px 28px 24px;
}

.modal h2 {
  margin: 0 0 18px;
  font-size: 20px;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.check-field input { width: 16px; height: 16px; }

.image-drop {
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 16px;
  position: relative;
}
.image-drop img {
  max-width: 100%;
  max-height: 160px;
  border-radius: 8px;
  margin-top: 10px;
}
.image-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.btn-secondary {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
}

.btn-accent {
  background: var(--brand-gradient);
  color: #241a0f;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  transition: filter 0.15s;
}
.btn-accent:hover { filter: brightness(0.94); }

@media (max-width: 620px) {
  nav.topbar { padding: 0 14px; }
  .nav-links { display: none; }
  .hero { padding: 34px 16px 46px; }
  .hero h1 { font-size: 26px; }
  .content { padding: 0 14px; }
  .row-2 { grid-template-columns: 1fr; }
}
