/* =========================================================
   LucreFree — Base styles (mobile first)
   ========================================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--color-text);
  background: var(--color-background);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-heading); color: var(--color-secondary); line-height: 1.2; }
h1 { font-size: 28px; font-weight: var(--fw-bold); }
h2 { font-size: 22px; font-weight: var(--fw-semibold); }
h3 { font-size: var(--fs-h3); font-weight: var(--fw-semibold); }

@media (min-width: 768px) {
  h1 { font-size: var(--fs-h1); }
  h2 { font-size: var(--fs-h2); }
}
@media (min-width: 1024px) {
  h1 { font-size: var(--fs-display); }
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-body);
  border: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  min-height: 44px; /* alvo de toque mobile */
}
.btn:active { transform: scale(0.98); }
.btn-cta { background: var(--color-cta); color: #fff; }
.btn-cta:hover { background: #E08E0B; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: #0EA271; }
.btn-outline { background: transparent; color: var(--color-secondary); border: 1px solid var(--color-border); }
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-block { width: 100%; }

/* Cards */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: var(--space-6);
  transition: box-shadow .2s ease;
}
.card:hover { box-shadow: var(--shadow-card-hover); }

/* Formulários */
.field { margin-bottom: var(--space-4); text-align: left; }
.field label { display: block; font-size: var(--fs-small); font-weight: var(--fw-semibold); margin-bottom: var(--space-2); color: var(--color-secondary); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  background: var(--color-surface);
  color: var(--color-text);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.15);
}
.field .error { color: var(--color-danger); font-size: var(--fs-small); margin-top: var(--space-1); display: none; }
.field.invalid input { border-color: var(--color-danger); }
.field.invalid .error { display: block; }

/* Badge */
.badge {
  display: inline-block;
  padding: 2px var(--space-3);
  border-radius: 999px;
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
}
.badge-free { background: #E2E8F0; color: var(--color-secondary); }
.badge-pro { background: rgba(245,158,11,0.15); color: var(--color-cta); }

/* Navbar */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-family: var(--font-heading); font-weight: var(--fw-bold); font-size: 20px; color: var(--color-secondary); }
.logo span { color: var(--color-primary); }
.nav-links { display: none; gap: var(--space-6); align-items: center; }
.nav-actions { display: flex; gap: var(--space-2); align-items: center; }
@media (min-width: 768px) { .nav-links { display: flex; } }

/* Sidebar (app interna) */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }
.app-topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; padding: 0 var(--space-4);
  background: var(--color-surface); border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0; z-index: 40;
}
.app-body { display: flex; flex: 1; }
.app-sidebar {
  display: none;
  width: 220px;
  background: var(--color-secondary);
  color: #fff;
  padding: var(--space-6) var(--space-4);
  flex-shrink: 0;
}
.app-sidebar a { display: block; padding: var(--space-3) var(--space-3); border-radius: var(--radius-sm); color: #CBD5E1; font-weight: var(--fw-semibold); margin-bottom: var(--space-1); }
.app-sidebar a.active, .app-sidebar a:hover { background: rgba(255,255,255,0.08); color: #fff; }
@media (min-width: 900px) { .app-sidebar { display: block; } }

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--color-surface); border-top: 1px solid var(--color-border);
  display: flex; justify-content: space-around; padding: var(--space-2) 0;
  z-index: 40;
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--color-muted); font-weight: var(--fw-semibold); }
.bottom-nav a.active { color: var(--color-primary); }
@media (min-width: 900px) { .bottom-nav { display: none; } }

.app-main { flex: 1; padding: var(--space-6) var(--space-4) 90px; }
@media (min-width: 900px) { .app-main { padding: var(--space-8); } }

.grid { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4,1fr); } }

.section { padding: var(--space-12) 0; }
.text-center { text-align: center; }
.text-muted { color: var(--color-muted); }
.mt-2 { margin-top: var(--space-2);} .mt-4{margin-top:var(--space-4);} .mt-6{margin-top:var(--space-6);} .mt-8{margin-top:var(--space-8);}
.mb-2 { margin-bottom: var(--space-2);} .mb-4{margin-bottom:var(--space-4);} .mb-6{margin-bottom:var(--space-6);} .mb-8{margin-bottom:var(--space-8);}

.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: var(--color-secondary); color: #fff; padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-sm); font-size: var(--fs-small); z-index: 100;
  opacity: 0; pointer-events: none; transition: opacity .25s ease, bottom .25s ease;
}
.toast.show { opacity: 1; bottom: 110px; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.5);
  display: none; align-items: flex-end; justify-content: center; z-index: 200;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--color-surface); width: 100%; max-width: 480px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: var(--space-6); max-height: 90vh; overflow-y: auto;
}
@media (min-width: 640px) {
  .modal-overlay { align-items: center; }
  .modal { border-radius: var(--radius-md); }
}
