/* ==========================================================================
   MEU PLANNER DO BEBÊ — Estilos
   Paleta: tons pastel aconchegantes (rosa queimado, creme, verde sálvia, dourado)
   ========================================================================== */

:root{
  --cream: #FBF6EF;
  --cream-2: #F3EAE0;
  --blush: #F1C6C0;
  --blush-dark: #E39B94;
  --sage: #A9BFA0;
  --sage-dark: #7E9974;
  --gold: #D4A96A;
  --ink: #443B36;
  --ink-light: #7A6F68;
  --white: #FFFFFF;
  --radius: 18px;
  --shadow: 0 10px 30px -12px rgba(68,59,54,0.18);
  --shadow-sm: 0 4px 14px -6px rgba(68,59,54,0.15);
  font-size: 16px;
}

*{ box-sizing: border-box; }
html,body{ margin:0; padding:0; }
body{
  font-family: 'Poppins', sans-serif;
  background: var(--cream);
  color: var(--ink);
  overflow-x: hidden;
}
h1,h2,h3{
  font-family: 'Fraunces', serif;
  color: var(--ink);
  margin: 0;
}
p{ margin: 0; }
a{ text-decoration: none; color: inherit; }
ul{ list-style: none; margin:0; padding:0; }
button{ font-family: inherit; cursor: pointer; }
input, select, textarea{ font-family: inherit; }

/* ---------- Splash ---------- */
#splash-screen{
  position: fixed; inset:0; background: linear-gradient(160deg, var(--blush) 0%, var(--gold) 100%);
  display:flex; align-items:center; justify-content:center; z-index: 9999;
  transition: opacity .6s ease, visibility .6s ease;
}
#splash-screen.hidden{ opacity:0; visibility:hidden; pointer-events:none; }
.splash-content{ text-align:center; color:#fff; }
.splash-content i{ font-size:3.5rem; animation: bounce 1.2s infinite ease-in-out; }
.splash-content p{ margin-top:14px; font-weight:500; letter-spacing:.5px; }
@keyframes bounce{ 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(-14px); } }

/* ---------- Tela de Login (privacidade básica, não é segurança real) ---------- */
.auth-screen{
  position: fixed; inset:0; z-index: 8000; display:flex; align-items:center; justify-content:center;
  padding: 20px; background: linear-gradient(160deg, var(--cream-2), var(--blush) 120%);
  overflow: hidden;
}
.auth-screen.hidden{ display:none; }
.auth-decor{ position:absolute; font-size:2.2rem; opacity:.35; color:#fff; }
.auth-decor-1{ top: 12%; left: 10%; color: var(--gold); font-size:1.6rem; }
.auth-decor-2{ bottom: 14%; right: 12%; font-size:2.4rem; }

.auth-card{
  background: rgba(255,255,255,.92); backdrop-filter: blur(4px); border-radius: var(--radius);
  max-width: 400px; width:100%; padding: 34px 30px; box-shadow: var(--shadow); text-align:center; position:relative;
}
.auth-close{
  position:absolute; top:14px; right:14px; background: var(--cream); border:none; color: var(--ink-light);
  width:32px; height:32px; border-radius:50%; font-size:.9rem; display:flex; align-items:center; justify-content:center;
  transition: background .2s ease, color .2s ease;
}
.auth-close:hover{ background: var(--blush); color:#fff; }
.auth-icon{
  width:56px; height:56px; border-radius:50%; background: linear-gradient(120deg, var(--blush-dark), var(--gold));
  color:#fff; display:flex; align-items:center; justify-content:center; font-size:1.4rem; margin: 0 auto 14px;
}
.auth-title{ font-size: 1.6rem; margin-bottom: 4px; }
.auth-title span{ color: var(--blush-dark); font-style:italic; }
.auth-subtitle{ color: var(--ink-light); font-size:.9rem; margin: 10px 0 18px; line-height:1.4; }
.auth-form{ text-align:left; display:flex; flex-direction:column; gap:14px; }
.auth-form .field label{ display:flex; align-items:center; gap:6px; }
.auth-form input{ width:100%; padding: 11px 14px; border-radius:10px; border:1px solid var(--cream-2); background: var(--cream); font-size:.95rem; }
.auth-form input:focus{ outline:2px solid var(--sage); background:#fff; }
.auth-form input[type=password]{ letter-spacing: 2px; }
.auth-name-row{ display:flex; gap:12px; }
.auth-name-row .field{ flex:1; min-width:0; }
.auth-submit{ width:100%; justify-content:center; margin-top:4px; }
.auth-error{ color:#B5493F; font-size:.82rem; min-height:16px; margin:0; text-align:left; }
.auth-forgot{ background:none; border:none; color: var(--ink-light); font-size:.8rem; text-decoration:underline; margin-top:2px; cursor:pointer; }
.auth-forgot:hover{ color: var(--blush-dark); }
.auth-disclaimer{
  margin-top: 20px; font-size:.74rem; color: var(--ink-light); display:flex; gap:6px; align-items:flex-start;
  text-align:left; line-height:1.4; border-top: 1px solid var(--cream-2); padding-top: 14px;
}
.auth-disclaimer i{ color: var(--gold); margin-top:2px; flex-shrink:0; }

/* User chip / logout na sidebar */
.user-chip{
  display:flex; align-items:center; gap:10px; background: var(--cream); border-radius: 10px; padding: 10px 12px;
  color: var(--ink); margin-bottom:10px;
}
.user-chip i{ color: var(--sage-dark); font-size:1.4rem; flex-shrink:0; }
.user-chip-info{ display:flex; flex-direction:column; overflow:hidden; min-width:0; }
.user-chip-name{ font-size:.85rem; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.user-chip-email{ font-size:.72rem; color: var(--ink-light); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.btn-logout{
  width:100%; background: var(--white); border:1px solid var(--cream-2); color: var(--ink-light);
  padding:10px; border-radius: 10px; font-size:.85rem; display:flex; align-items:center; justify-content:center; gap:8px;
  margin-bottom: 8px; transition: background .2s ease;
}
.btn-logout:hover{ background: var(--sage); color:#fff; border-color: var(--sage); }
.btn-login{
  width:100%; background: linear-gradient(120deg, var(--blush-dark), var(--gold)); border:none; color:#fff;
  padding:11px; border-radius: 10px; font-size:.85rem; font-weight:600; display:flex; align-items:center; justify-content:center; gap:8px;
  margin-bottom: 10px; transition: transform .2s ease, box-shadow .2s ease; box-shadow: var(--shadow-sm);
}
.btn-login:hover{ transform: translateY(-2px); box-shadow: var(--shadow); }

/* ---------- Layout ---------- */
.main-wrapper{ margin-left: 260px; min-height:100vh; display:flex; flex-direction:column; }
main{ flex:1; padding: 28px 40px 60px; max-width: 1120px; }

.page{ display:none; animation: fadeUp .5s ease; }
.page.active{ display:block; }
@keyframes fadeUp{ from{ opacity:0; transform: translateY(14px);} to{ opacity:1; transform:translateY(0);} }

.page-head{ margin-bottom: 26px; }
.page-kicker{
  display:inline-block; font-size:.72rem; letter-spacing:1.5px; text-transform:uppercase;
  color: var(--sage-dark); font-weight:600; margin-bottom:6px;
}
.page-head h2{ font-size: 2rem; display:flex; align-items:center; gap:12px; }
.page-head h2 i{ color: var(--blush-dark); }
.page-desc{ color: var(--ink-light); margin-top:8px; max-width: 640px; line-height:1.5; }

/* ---------- Sidebar ---------- */
.sidebar{
  position: fixed; top:0; left:0; width:260px; height:100vh; background: var(--white);
  border-right: 1px solid var(--cream-2); display:flex; flex-direction:column; z-index: 500;
  transition: transform .35s ease;
}
.sidebar-top{ padding: 26px 22px 10px; }
.sidebar-close{ display:none; background:none; border:none; font-size:1.2rem; color:var(--ink-light); position:absolute; top:16px; right:16px; }
.brand{ display:flex; align-items:center; gap:12px; }
.brand-icon{ font-size:1.6rem; color: var(--blush-dark); }
.brand-title{ display:block; font-family:'Fraunces',serif; font-weight:600; font-size:1.15rem; }
.brand-sub{ display:block; font-size:.8rem; color: var(--ink-light); letter-spacing:.5px; }

.side-nav{ flex:1; padding: 18px 14px; display:flex; flex-direction:column; gap:4px; overflow-y:auto; }
.nav-link{
  display:flex; align-items:center; gap:12px; padding: 11px 14px; border-radius: 12px;
  color: var(--ink-light); font-size:.92rem; font-weight:500; transition: all .2s ease;
}
.nav-link i{ width:18px; text-align:center; color: var(--sage-dark); }
.nav-link:hover{ background: var(--cream); color: var(--ink); }
.nav-link.active{ background: linear-gradient(120deg, var(--blush), var(--blush) 100%); color: var(--white); }
.nav-link.active i{ color: var(--white); }

.sidebar-bottom{ padding: 16px 20px 22px; border-top:1px solid var(--cream-2); }
.btn-reset{
  width:100%; background: var(--cream); border:1px solid var(--cream-2); color: var(--ink-light);
  padding:10px; border-radius: 10px; font-size:.85rem; display:flex; align-items:center; justify-content:center; gap:8px;
  transition: background .2s ease;
}
.btn-reset:hover{ background: var(--blush); color:#fff; }
.sidebar-note{ font-size:.72rem; color: var(--ink-light); text-align:center; margin-top:10px; line-height:1.4; }

.sidebar-overlay{ display:none; position:fixed; inset:0; background: rgba(0,0,0,.35); z-index:400; }
.sidebar-overlay.show{ display:block; }

/* ---------- Topbar (mobile) ---------- */
.topbar{ display:none; align-items:center; justify-content:space-between; padding: 14px 18px; background:var(--white); border-bottom:1px solid var(--cream-2); position:sticky; top:0; z-index:300; }
.menu-btn{ background:none; border:none; font-size:1.3rem; color: var(--ink); }
.topbar-title{ font-family:'Fraunces',serif; font-weight:600; }
.topbar-heart{ color: var(--blush-dark); }

/* ---------- Buttons ---------- */
.btn-primary{
  background: linear-gradient(120deg, var(--blush-dark), var(--gold));
  color: #fff; border:none; padding: 11px 22px; border-radius: 30px; font-weight:600; font-size:.9rem;
  display:inline-flex; align-items:center; gap:8px; box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease;
}
.btn-primary:hover{ transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-secondary{
  background: var(--white); border:1.5px solid var(--sage); color: var(--sage-dark); padding:10px 20px;
  border-radius:30px; font-weight:600; font-size:.85rem; display:inline-flex; align-items:center; gap:8px; margin-top:6px;
}
.btn-secondary:hover{ background: var(--sage); color:#fff; }

/* ---------- Cover page ---------- */
.cover-page{
  position: relative; text-align:center; padding: 60px 20px 40px; border-radius: 24px;
  background: linear-gradient(160deg, var(--cream-2), var(--blush) 120%);
  overflow:hidden; margin-top: 8px;
}
.cover-decor{ position:absolute; font-size:2rem; opacity:.35; color:#fff; }
.cover-decor-1{ top: 30px; left: 8%; font-size:1.6rem; color: var(--gold); }
.cover-decor-2{ top: 60px; right: 12%; font-size:2.4rem; }
.cover-decor-3{ bottom: 40px; left: 15%; font-size:2rem; }

.badge-premium{
  display:inline-block; background: rgba(255,255,255,.6); padding:6px 18px; border-radius:20px;
  font-size:.75rem; letter-spacing:1.5px; text-transform:uppercase; color: var(--ink); font-weight:600; margin-bottom: 18px;
}
.cover-greeting{
  font-size:.95rem; font-weight:600; color: var(--sage-dark); margin: -10px 0 14px; display:none;
}
.cover-greeting.show{ display:block; }
.cover-title{ font-size: 3rem; line-height:1.15; font-weight:600; }
.cover-title span{ color: var(--blush-dark); font-style:italic; }
.cover-subtitle{ margin-top:14px; color: var(--ink-light); font-size:1.05rem; max-width:460px; margin-inline:auto; }

.cover-card{
  background: rgba(255,255,255,.85); backdrop-filter: blur(4px); border-radius: var(--radius); max-width:420px;
  margin: 30px auto 0; padding: 26px; box-shadow: var(--shadow); text-align:left;
}
.cover-field{ margin-bottom:16px; }
.cover-field label{ display:flex; align-items:center; gap:8px; font-size:.82rem; font-weight:600; color: var(--ink-light); margin-bottom:6px; }
.cover-field input{ width:100%; padding: 10px 14px; border-radius:10px; border:1px solid var(--cream-2); background: var(--cream); font-size:.95rem; }
.cover-field input:focus{ outline:2px solid var(--sage); }
.cover-age{ text-align:center; font-weight:600; color: var(--sage-dark); font-size:.9rem; min-height:20px; }

.cover-meta{ margin-top: 22px; color: var(--ink-light); font-size:.85rem; letter-spacing:.5px; }
.cover-cta{ margin-top: 22px; }

/* ---------- TOC ---------- */
.toc-grid{ display:grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.toc-card{
  background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm);
  position:relative; transition: transform .25s ease, box-shadow .25s ease; border: 1px solid var(--cream-2);
}
.toc-card:hover{ transform: translateY(-4px); box-shadow: var(--shadow); }
.toc-number{ position:absolute; top:18px; right:20px; font-family:'Fraunces',serif; font-size:1.6rem; color: var(--cream-2); font-weight:700; }
.toc-icon{ font-size:1.6rem; color: var(--blush-dark); margin-bottom: 14px; display:block; }
.toc-card h3{ font-size:1.1rem; margin-bottom:6px; }
.toc-card p{ font-size:.86rem; color: var(--ink-light); line-height:1.4; }
.toc-card-wide{ grid-column: span 3; background: linear-gradient(120deg, var(--sage), var(--sage-dark)); }
.toc-card-wide h3, .toc-card-wide p, .toc-card-wide .toc-icon{ color: #fff; }
.toc-card-wide .toc-number{ color: rgba(255,255,255,.3); }

/* ---------- Tabs ---------- */
.tabs{ display:flex; gap:8px; margin-bottom: 22px; flex-wrap:wrap; }
.tab-btn{
  background: var(--white); border:1px solid var(--cream-2); padding: 9px 20px; border-radius: 30px;
  font-size:.88rem; font-weight:600; color: var(--ink-light); transition: all .2s ease;
}
.tab-btn.active{ background: var(--ink); color:#fff; border-color: var(--ink); }
.tab-panel{ display:none; }
.tab-panel.active{ display:block; animation: fadeUp .4s ease; }

/* ---------- Cards ---------- */
.card{
  background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm);
  margin-bottom: 22px; border: 1px solid var(--cream-2);
}
.card h3{ font-size:1.05rem; display:flex; align-items:center; gap:10px; margin-bottom: 16px; }
.card h3 i{ color: var(--blush-dark); }
.card-head-row{ display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; flex-wrap:wrap; gap:8px; }
.card-head-row h3{ margin-bottom:0; }

.chip{ background: var(--cream); color: var(--sage-dark); font-size:.78rem; font-weight:600; padding: 6px 14px; border-radius:20px; }

/* ---------- Forms ---------- */
.inline-form{ display:flex; flex-wrap:wrap; gap: 14px; align-items:end; }
.field{ display:flex; flex-direction:column; gap:6px; min-width:140px; }
.field-grow{ flex:1; min-width: 200px; }
.field label{ font-size:.78rem; font-weight:600; color: var(--ink-light); }
.field input, .field select, .field textarea{
  padding: 10px 14px; border-radius: 10px; border: 1px solid var(--cream-2); background: var(--cream); font-size: .9rem; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus{ outline:2px solid var(--sage); background:#fff; }
.field textarea{ resize: vertical; min-height: 42px; }
.form-card .btn-primary{ height: 42px; }

/* ---------- Tables ---------- */
.table-wrap{ overflow-x:auto; }
.data-table{ width:100%; border-collapse: collapse; font-size:.88rem; min-width: 480px; }
.data-table th{
  text-align:left; padding: 10px 14px; background: var(--cream); color: var(--ink-light);
  font-weight:600; font-size:.78rem; text-transform:uppercase; letter-spacing:.4px;
}
.data-table th:first-child{ border-radius: 8px 0 0 8px; }
.data-table th:last-child{ border-radius: 0 8px 8px 0; }
.data-table td{ padding: 12px 14px; border-bottom: 1px solid var(--cream-2); vertical-align:middle; }
.data-table tbody tr:hover{ background: #FBF6EF; }
.row-delete-btn{ background:none; border:none; color:#C97B74; font-size:.95rem; }
.row-delete-btn:hover{ color:#a5453d; }
.empty-msg{ text-align:center; color: var(--ink-light); font-size:.88rem; padding: 18px 0 4px; }

/* Vaccine table specifics */
.vaccine-table td:nth-child(5){ text-align:center; }
.vaccine-check{ width:20px; height:20px; accent-color: var(--sage-dark); cursor:pointer; }
.vaccine-table tr.done td{ color: var(--sage-dark); }
.vaccine-table tr.done{ background: #F5F9F2; }

/* ---------- Stats ---------- */
.stats-row{ display:grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 22px; }
.stat-box{ background: var(--white); border-radius: var(--radius); padding: 20px; text-align:center; box-shadow: var(--shadow-sm); border:1px solid var(--cream-2); }
.stat-value{ display:block; font-family:'Fraunces',serif; font-size:1.6rem; font-weight:700; color: var(--blush-dark); }
.stat-label{ display:block; font-size:.8rem; color: var(--ink-light); margin-top: 4px; }

/* ---------- Chart box ---------- */
.chart-box{ height: 320px; position:relative; }

/* ---------- Progress bars ---------- */
.progress-bar-outer{ width:100%; height:14px; background: var(--cream); border-radius: 20px; overflow:hidden; }
.progress-bar-inner{ height:100%; width:0%; background: linear-gradient(90deg, var(--sage), var(--sage-dark)); border-radius:20px; transition: width .5s ease; }
.progress-savings{ background: linear-gradient(90deg, var(--gold), var(--blush-dark)); }
.mini-note{ font-size:.82rem; color: var(--ink-light); margin-top:8px; }
.disclaimer{ font-size:.8rem; color: var(--ink-light); margin-top: 14px; display:flex; gap:8px; align-items:flex-start; }
.disclaimer i{ color: var(--gold); margin-top:2px; }

/* ---------- Routine ---------- */
.routine-grid{ display:grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 8px; }
.routine-card h3{ margin-bottom: 14px; }
.routine-morning h3 i{ color:#E3A857; }
.routine-afternoon h3 i{ color:#7E9974; }
.routine-night h3 i{ color:#7B8FC7; }
.routine-list{ display:flex; flex-direction:column; gap:10px; margin-bottom: 16px; min-height: 40px; }
.routine-item{ display:flex; align-items:center; gap:10px; font-size:.9rem; }
.routine-item input[type=checkbox]{ width:18px; height:18px; accent-color: var(--sage-dark); flex-shrink:0; }
.routine-item span{ flex:1; }
.routine-item.checked span{ text-decoration: line-through; color: var(--ink-light); }
.routine-item button{ background:none; border:none; color:#C97B74; opacity:0; transition:opacity .2s ease; font-size:.8rem; }
.routine-item:hover button{ opacity:1; }
.routine-add-form{ display:flex; gap:8px; }
.routine-add-form input{ flex:1; padding: 8px 12px; border-radius:8px; border:1px solid var(--cream-2); background: var(--cream); font-size:.85rem; }
.routine-add-form button{ background: var(--ink); color:#fff; border:none; width:36px; border-radius:8px; }

/* ---------- Notes ---------- */
.notes-grid{ display:grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.note-card{ background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); border:1px solid var(--cream-2); position:relative; }
.note-card::before{ content:''; position:absolute; top:0; left:0; width:100%; height:6px; background: linear-gradient(90deg, var(--blush), var(--gold)); border-radius: var(--radius) var(--radius) 0 0; }
.note-date{ font-size:.75rem; color: var(--sage-dark); font-weight:600; text-transform:uppercase; letter-spacing:.4px; }
.note-title{ font-family:'Fraunces',serif; font-size:1.1rem; margin-top:6px; }
.note-text{ font-size:.88rem; color: var(--ink-light); margin-top:8px; line-height:1.5; white-space:pre-wrap; }
.note-delete{ position:absolute; top:16px; right:16px; background:none; border:none; color:#C97B74; opacity:.6; }
.note-delete:hover{ opacity:1; }

/* ---------- Footer ---------- */
.site-footer{ text-align:center; padding: 30px 20px 10px; color: var(--ink-light); font-size:.9rem; }
.site-footer i{ color: var(--blush-dark); }
.footer-small{ font-size:.75rem; margin-top: 6px; opacity:.8; }

/* ---------- Toast ---------- */
.toast{
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color:#fff; padding: 12px 24px; border-radius: 30px; font-size:.88rem;
  opacity:0; pointer-events:none; transition: all .3s ease; z-index: 2000; box-shadow: var(--shadow);
}
.toast.show{ opacity:1; transform: translateX(-50%) translateY(0); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px){
  .toc-grid{ grid-template-columns: repeat(2,1fr); }
  .toc-card-wide{ grid-column: span 2; }
  .routine-grid{ grid-template-columns: 1fr; }
  .notes-grid{ grid-template-columns: repeat(2,1fr); }
  .stats-row{ grid-template-columns: repeat(3,1fr); }
}

@media (max-width: 860px){
  .sidebar{ transform: translateX(-100%); box-shadow: var(--shadow); }
  .sidebar.open{ transform: translateX(0); }
  .sidebar-close{ display:block; }
  .main-wrapper{ margin-left:0; }
  .topbar{ display:flex; }
  main{ padding: 20px 18px 50px; }
  .cover-title{ font-size: 2.2rem; }
  .toc-grid{ grid-template-columns: 1fr; }
  .toc-card-wide{ grid-column: span 1; }
  .notes-grid{ grid-template-columns: 1fr; }
  .stats-row{ grid-template-columns: 1fr; }
}

@media (max-width: 480px){
  .cover-page{ padding: 40px 14px 30px; }
  .cover-title{ font-size:1.8rem; }
  .inline-form{ flex-direction:column; align-items:stretch; }
  .field{ min-width:0; }
}
