/* ===========================
   MÉTODICO – CSS Principal
   =========================== */

/* Variáveis de tema */
:root {
  --bg: #F9F9F7;
  --bg-card: #FFFFFF;
  --bg-nav: #FFFFFF;
  --text-primary: #1A1A1A;
  --text-secondary: #6B6B6B;
  --text-muted: #A0A0A0;
  --accent: #2D6A4F;
  --accent-light: #D8F3DC;
  --accent-hover: #245C43;
  --danger: #E63946;
  --warning: #F4A261;
  --border: #E8E8E4;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
  --bg: #121212;
  --bg-card: #1E1E1E;
  --bg-nav: #1A1A1A;
  --text-primary: #F0F0F0;
  --text-secondary: #A0A0A0;
  --text-muted: #666666;
  --accent: #52B788;
  --accent-light: #1B4332;
  --accent-hover: #74C69D;
  --border: #2A2A2A;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  background:
    radial-gradient(circle at top left, rgba(45,106,79,0.06), transparent 55%),
    radial-gradient(circle at bottom right, rgba(33,158,188,0.06), transparent 55%),
    var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Utilitários */
.hidden { display: none !important; }

/* ===========================
   SPLASH
   =========================== */
.splash {
  position: fixed;
  inset: 0;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.splash-inner {
  text-align: center;
  color: white;
  padding: 40px 24px;
}

.splash-logo {
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.2);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 800;
  margin: 0 auto 24px;
  letter-spacing: -1px;
}

.splash-inner h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.splash-inner p {
  font-size: 16px;
  opacity: 0.85;
  line-height: 1.6;
  margin-bottom: 36px;
}

/* ===========================
   APP LAYOUT
   =========================== */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* ===========================
   HEADER
   =========================== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(90deg, rgba(45,106,79,0.06), transparent);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

/* ===========================
   HERO SECTION
   =========================== */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 8px;
  gap: 20px;
}

.hero-left {
  flex: 1 1 220px;
}

.hero-right {
  flex: 1 1 180px;
  display: flex;
  justify-content: flex-end;
}

.hero h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.hero p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
}

.hero-cta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero-note {
  font-size: 11px;
  color: var(--text-muted);
}

.metodico-card {
  position: relative;
  background: var(--bg-card);
  border-radius: 18px;
  padding: 10px 10px 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
  max-width: 180px;
  margin-left: auto;
}

.metodico-img {
  display: block;
  width: 100%;
  border-radius: 14px;
}

.metodico-bubble {
  position: absolute;
  bottom: -10px;
  left: 8px;
  right: 8px;
  background: #FFB703;
  color: #1A1A1A;
  font-size: 11px;
  padding: 6px 8px;
  border-radius: 999px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ===========================
   RESUMO DO DIA
   =========================== */
.day-summary {
  padding: 24px 20px 16px;
}

.summary-greeting h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.summary-date {
  font-size: 13px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
  margin-bottom: 20px;
}

.summary-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-number {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -1px;
  line-height: 1;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
  display: block;
}

.progress-bar-wrap {
  margin-top: 4px;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.4s ease;
}

.progress-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  display: block;
}

/* ===========================
   FILTROS
   =========================== */
.filter-nav {
  display: flex;
  gap: 8px;
  padding: 0 20px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-nav::-webkit-scrollbar { display: none; }

.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ===========================
   LISTA DE TAREFAS
   =========================== */
.task-list-wrap {
  flex: 1;
  padding: 0 20px 100px;
}

.task-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  animation: slideIn 0.2s ease;
}

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

.task-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(45,106,79,0.1);
}

.task-new {
  background-color: var(--accent-light);
  animation: pulseNew 1.5s ease;
}
@keyframes pulseNew {
  0% { background-color: var(--accent-light); }
  100% { background-color: var(--bg-card); }
}

.task-item.done {
  opacity: 0.5;
}

.task-item.done .task-title {
  text-decoration: line-through;
}

.task-check {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  margin-top: 1px;
}

.task-check:hover {
  border-color: var(--accent);
}

.task-check.checked {
  background: var(--accent);
  border-color: var(--accent);
}

.task-check.checked::after {
  content: '';
  width: 5px;
  height: 9px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
  display: block;
}

.task-body {
  flex: 1;
  min-width: 0;
}

.task-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 6px;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.badge-categoria {
  background: var(--accent-light);
  color: var(--accent);
}

.badge-urgente { background: #FFE5E7; color: #E63946; }
.badge-importante { background: #FFF4D6; color: #FF8800; }
.badge-normal { background: #E9ECEF; color: #495057; border: none; }

.task-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag {
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 2px 8px;
}

.task-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  flex-shrink: 0;
}

.task-delete:hover {
  color: var(--danger);
  background: #FFE5E7;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state p {
  font-size: 15px;
  line-height: 1.6;
}

/* ===========================
   FAB
   =========================== */
.fab {
  position: fixed;
  bottom: 88px;
  right: calc(50% - 240px + 20px);
  width: 56px;
  height: 56px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(45,106,79,0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 20;
}

.fab:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(45,106,79,0.45);
}

@media (max-width: 480px) {
  .fab {
    right: 20px;
  }
}

/* ===========================
   BOTTOM NAV
   =========================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--bg-nav);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  z-index: 10;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-item.active,
.nav-item:hover {
  color: var(--accent);
}

/* ===========================
   MODAL
   =========================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
}

.modal-box {
  position: relative;
  background: var(--bg-card);
  width: 100%;
  max-width: 480px;
  border-radius: 24px 24px 0 0;
  padding: 24px 24px max(24px, env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-step {
  min-height: 180px;
}

.step-question {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1.4;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.option-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  transition: var(--transition);
}

.option-btn:hover,
.option-btn.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

.option-icon {
  font-size: 22px;
}

.input-field {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  transition: var(--transition);
  outline: none;
}

.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45,106,79,0.1);
}

.priority-group {
  display: flex;
  gap: 8px;
}

.priority-btn {
  flex: 1;
  padding: 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
}

.priority-btn.active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

.tags-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
}

.task-preview-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.preview-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
}

.preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* Navegação do modal */
.modal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
}

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

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: var(--transition);
}

.dot.active {
  background: var(--accent);
  width: 18px;
  border-radius: 3px;
}

/* ===========================
   BOTÕES
   =========================== */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  width: 100%;
  padding: 12px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: var(--accent);
  color: white;
}

.btn-ghost {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-ghost:hover {
  color: var(--accent);
  background: var(--accent-light);
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-icon:hover {
  color: var(--accent);
  background: var(--accent-light);
}

/* ===========================
   AUTH SCREEN
   =========================== */
.auth-screen {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(45,106,79,0.10), transparent 60%),
    radial-gradient(circle at bottom right, rgba(33,158,188,0.12), transparent 60%),
    var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border-radius: 24px;
  padding: 24px 22px 20px;
  box-shadow: 0 18px 45px rgba(0,0,0,0.16);
  border: 1px solid var(--border);
}

.auth-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.auth-header h1 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 2px;
}

.auth-header p {
  font-size: 12px;
  color: var(--text-secondary);
}

.auth-tabs {
  display: flex;
  border-radius: 999px;
  background: var(--bg);
  padding: 3px;
  margin-bottom: 16px;
}

.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 0;
  border-radius: 999px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
}

.auth-tab.active {
  background: var(--accent);
  color: white;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.auth-hint {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.auth-error {
  margin-top: 6px;
  font-size: 12px;
  color: var(--danger);
}

/* ===========================
   RESPONSIVO DESKTOP
   =========================== */
@media (min-width: 481px) {
  .modal {
    align-items: center;
  }
  .modal-box {
    border-radius: 24px;
    max-height: 80vh;
  }
  .fab {
    right: calc(50% - 240px + 20px);
  }
}
