@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root{
  --navy-deep:#0A1A33;
  --navy-elevated:#112548;
  --teal-core:#17B8A6;
  --teal-glow:#5EEAD4;
  --coral:#FF8A5B;
  --text-primary:#F4F7FA;
  --text-secondary:#90A4C4;
  --radius-lg:20px;
  --radius-md:14px;
}

*{box-sizing:border-box;margin:0;padding:0;}

body{
  background:var(--navy-deep);
  color:var(--text-primary);
  font-family:'Inter',sans-serif;
  min-height:100vh;
  -webkit-tap-highlight-color:transparent;
}

.app{
  max-width:430px;
  margin:0 auto;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  padding-bottom:84px;
}

/* Header */
.app-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:20px 20px 8px;
}
.brand{ display:flex; align-items:center; gap:10px; }
.brand svg{ width:30px; height:30px; }
.brand span{ font-family:'Poppins',sans-serif; font-weight:700; font-size:18px; }
.header-icon{
  width:38px; height:38px;
  border-radius:50%;
  background:var(--navy-elevated);
  display:flex; align-items:center; justify-content:center;
}
.header-icon svg{ width:18px; height:18px; stroke:var(--text-secondary); }

/* Views */
.view{ padding:12px 20px 20px; display:none; flex-direction:column; gap:20px; }
.view.active{ display:flex; }

/* Card */
.card{
  background:var(--navy-elevated);
  border-radius:var(--radius-lg);
  padding:20px;
}
.card-label{
  font-size:13px; font-weight:600; color:var(--teal-glow);
  text-transform:lowercase;
}

/* Next reminder card */
.next-reminder{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
}
.next-reminder .info{ display:flex; flex-direction:column; gap:4px; }
.next-reminder .title{ font-family:'Poppins',sans-serif; font-weight:600; font-size:17px; }
.next-reminder .subtitle{ font-size:13px; color:var(--text-secondary); }

.ring-wrap{ position:relative; width:76px; height:76px; flex-shrink:0; }
.ring-wrap svg{ width:100%; height:100%; transform:rotate(-90deg); }
.ring-bg{ stroke:rgba(255,255,255,0.08); }
.ring-progress{ stroke:var(--teal-glow); stroke-linecap:round; transition:stroke-dashoffset .3s; }
.ring-dot{ position:absolute; top:6px; right:14px; width:8px; height:8px; border-radius:50%; background:var(--coral); }

/* Section title */
.section-title{
  font-family:'Poppins',sans-serif; font-weight:600; font-size:15px;
  color:var(--text-primary); padding:0 2px;
}

/* Reminder list */
.reminder-list{ display:flex; flex-direction:column; gap:10px; }
.reminder-item{
  background:var(--navy-elevated);
  border-radius:var(--radius-md);
  padding:14px 16px;
  display:flex; align-items:center; gap:14px;
}
.reminder-item .icon-badge{
  width:40px; height:40px; border-radius:12px;
  background:rgba(94,234,212,0.08);
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.reminder-item .icon-badge svg{ width:24px; height:24px; }
.reminder-item .item-info{ flex:1; display:flex; flex-direction:column; gap:2px; }
.reminder-item .item-title{ font-size:14px; font-weight:600; }
.reminder-item .item-time{ font-size:12px; color:var(--text-secondary); }
.reminder-item .confirm-btn{
  border:1.5px solid var(--teal-core);
  color:var(--teal-glow);
  background:transparent;
  font-size:12px; font-weight:600;
  padding:7px 12px; border-radius:20px;
  white-space:nowrap;
}
.reminder-item.confirmed{ opacity:.5; }
.reminder-item.confirmed .confirm-btn{
  border-color:var(--text-secondary); color:var(--text-secondary);
}

/* Type selector (setup) */
.type-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.type-option{
  background:var(--navy-elevated);
  border-radius:var(--radius-md);
  padding:16px 8px;
  display:flex; flex-direction:column; align-items:center; gap:8px;
  border:1.5px solid transparent;
  text-align:center;
}
.type-option svg{ width:44px; height:44px; }
.type-option .type-label{ font-size:11px; font-weight:600; color:var(--text-secondary); line-height:1.3; }
.type-option.selected{ border-color:var(--teal-core); background:rgba(23,184,166,0.1); }
.type-option.selected .type-label{ color:var(--text-primary); }

/* Days of week */
.days-row{ display:flex; gap:8px; justify-content:space-between; }
.day-toggle{
  width:40px; height:40px; border-radius:50%;
  background:var(--navy-elevated);
  color:var(--text-secondary);
  font-size:12px; font-weight:600;
  display:flex; align-items:center; justify-content:center;
  border:1.5px solid transparent;
}
.day-toggle.selected{ background:var(--teal-core); color:var(--navy-deep); border-color:var(--teal-core); }

/* Time window */
.time-row{ display:flex; gap:12px; }
.time-field{ flex:1; display:flex; flex-direction:column; gap:6px; }
.time-field label{ font-size:12px; color:var(--text-secondary); }
.time-field input{
  background:var(--navy-deep);
  border:1px solid rgba(144,164,196,0.25);
  border-radius:10px;
  padding:10px 12px;
  color:var(--text-primary);
  font-family:'Inter',sans-serif; font-size:14px;
}

/* Toggle switch (chave mestra) */
.setting-row{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 0;
  border-bottom:1px solid rgba(144,164,196,0.12);
}
.setting-row:last-child{ border-bottom:none; }
.setting-text .setting-title{ font-size:14px; font-weight:600; }
.setting-text .setting-desc{ font-size:12px; color:var(--text-secondary); margin-top:2px; }

.switch{ position:relative; width:46px; height:26px; flex-shrink:0; }
.switch input{ opacity:0; width:0; height:0; }
.switch .track{
  position:absolute; inset:0; background:rgba(144,164,196,0.25);
  border-radius:20px; transition:.2s;
}
.switch .thumb{
  position:absolute; top:3px; left:3px; width:20px; height:20px;
  background:#fff; border-radius:50%; transition:.2s;
}
.switch input:checked + .track{ background:var(--teal-core); }
.switch input:checked + .track .thumb{ transform:translateX(20px); }

/* Primary button */
.btn-primary{
  background:var(--teal-core);
  color:var(--navy-deep);
  font-family:'Poppins',sans-serif;
  font-weight:600; font-size:15px;
  border:none; border-radius:14px;
  padding:15px; width:100%;
}
.btn-primary:active{ opacity:.85; }

/* Bottom nav */
.bottom-nav{
  position:fixed; bottom:0; left:50%; transform:translateX(-50%);
  width:100%; max-width:430px;
  background:var(--navy-elevated);
  border-top:1px solid rgba(144,164,196,0.12);
  display:flex; justify-content:space-around;
  padding:10px 12px calc(10px + env(safe-area-inset-bottom));
}
.nav-btn{
  display:flex; flex-direction:column; align-items:center; gap:4px;
  background:none; border:none; color:var(--text-secondary);
  font-size:11px; font-weight:600;
}
.nav-btn svg{ width:22px; height:22px; stroke:var(--text-secondary); }
.nav-btn.active{ color:var(--teal-glow); }
.nav-btn.active svg{ stroke:var(--teal-glow); }

/* Empty state */
.empty-state{
  text-align:center; padding:30px 10px;
  color:var(--text-secondary); font-size:13px;
}

/* First-run permission banner */
.perm-banner{
  background:linear-gradient(135deg, rgba(23,184,166,0.15), rgba(94,234,212,0.06));
  border:1px solid rgba(94,234,212,0.3);
  border-radius:var(--radius-md);
  padding:16px;
  display:flex; flex-direction:column; gap:10px;
}
.perm-banner p{ font-size:13px; color:var(--text-primary); line-height:1.5; }
.perm-banner button{
  background:var(--teal-core); color:var(--navy-deep);
  border:none; border-radius:10px; padding:10px; font-weight:600; font-size:13px;
}
