/* =========================================================
   MEU PRÓXIMO PASSO | SISTEMA VISUAL
   Referência: linguagem digital profissional inspirada na
   clareza, confiança e acessibilidade observadas no Sebrae.
   Não é uma cópia da identidade visual.
   ========================================================= */

:root{
  --font-display: "Open Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Open Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-soft: #EEF3F8;
  --text-strong: #172033;
  --text: #27364A;
  --text-muted: #536275;
  --primary: #0B5CAB;
  --primary-dark: #08477F;
  --primary-soft: #E7F0FA;
  --success: #16834B;
  --success-soft: #E8F6EF;
  --accent: #F2B705;
  --accent-soft: #FFF6D8;
  --danger: #B42318;
  --danger-soft: #FEECEB;
  --border: #D9E1EA;
  --shadow-sm: 0 2px 8px rgba(23,32,51,.06);
  --shadow-md: 0 8px 24px rgba(23,32,51,.09);
  --shadow-lg: 0 16px 40px rgba(23,32,51,.13);

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --btn-height: 52px;
  --content-width: 520px;
}

/* ---------- Base ---------- */

*{box-sizing:border-box}

html,body{
  margin:0;
  min-height:100%;
  background:var(--bg);
  color:var(--text);
  font-family:var(--font-body);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

body{
  padding-bottom:calc(92px + env(safe-area-inset-bottom));
  line-height:1.55;
}

button,input,select,textarea{
  font:inherit;
}

button{
  border:0;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible{
  outline:3px solid rgba(11,92,171,.25);
  outline-offset:2px;
}

.app-shell{
  width:min(100%,var(--content-width));
  margin:0 auto;
  padding:20px 16px 30px;
}

h1,h2,h3,p{margin-top:0}

h1,h2,h3{
  font-family:var(--font-display);
  color:var(--text-strong);
  letter-spacing:-.025em;
}

h1{
  font-size:28px;
  line-height:1.15;
  margin-bottom:8px;
  font-weight:800;
}

h2{
  font-size:21px;
  line-height:1.25;
  margin-bottom:10px;
  font-weight:800;
}

h3{
  font-size:16px;
  line-height:1.35;
  margin-bottom:7px;
  font-weight:750;
}

p{
  color:var(--text);
  line-height:1.58;
}

small{
  line-height:1.4;
}

.muted{
  color:var(--text-muted);
}

/* ---------- Header ---------- */

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:18px;
}

.icon-btn,
.back-btn{
  width:46px;
  height:46px;
  flex:0 0 46px;
  border-radius:var(--radius-md);
  background:var(--surface);
  color:var(--text-strong);
  border:1px solid var(--border);
  box-shadow:var(--shadow-sm);
  font-size:20px;
}

.back-btn{
  font-size:28px;
  line-height:1;
}

/* ---------- Cards / sections ---------- */

.card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:19px;
  margin-bottom:14px;
  box-shadow:var(--shadow-sm);
  overflow-wrap:anywhere;
}

.card p:last-child{
  margin-bottom:0;
}

.hero{
  background:linear-gradient(145deg,#0B5CAB 0%,#0A4D8E 100%);
  color:#fff;
  border:0;
  box-shadow:var(--shadow-md);
}

.hero h1,
.hero h2,
.hero h3,
.hero p{
  color:#fff;
}

.hero .muted{
  color:#E7F1FA;
}

.hero .btn{
  margin-top:4px;
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:30px;
  padding:6px 10px;
  border-radius:var(--radius-pill);
  background:var(--primary-soft);
  color:var(--primary-dark);
  font-size:12px;
  line-height:1.2;
  font-weight:800;
}

.hero .badge{
  background:rgba(255,255,255,.16);
  color:#fff;
}

/* ---------- Buttons ---------- */

.btn{
  min-height:var(--btn-height);
  padding:13px 17px;
  border-radius:14px;
  font-weight:800;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  transition:transform .15s ease,box-shadow .15s ease,background .15s ease;
}

.btn:active{
  transform:translateY(1px);
}

.btn-primary{
  background:var(--primary);
  color:#fff;
  box-shadow:0 4px 12px rgba(11,92,171,.22);
}

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

.btn-secondary{
  background:var(--primary-soft);
  color:var(--primary-dark);
}

.btn-ghost{
  background:transparent;
  color:var(--primary);
}

.btn-danger{
  background:var(--danger-soft);
  color:var(--danger);
}

.btn-full{
  width:100%;
}

/* ---------- Areas ---------- */

.grid{
  display:grid;
  gap:12px;
}

.grid-2{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

.area-card{
  color:#fff;
  min-height:132px;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  position:relative;
  overflow:hidden;
  border:0;
  box-shadow:var(--shadow-sm);
  text-align:left;
}

.area-card:before{
  content:"";
  position:absolute;
  width:90px;
  height:90px;
  right:-28px;
  top:-28px;
  border-radius:50%;
  background:rgba(255,255,255,.12);
}

.area-icon-img{
  position:relative;
  z-index:1;
  width:62px;
  height:62px;
  object-fit:contain;
  align-self:flex-start;
  margin-bottom:auto;
}

.area-heading{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:12px;
}

.area-heading-icon{
  width:64px;
  height:64px;
  object-fit:contain;
  flex:0 0 64px;
}

.area-card strong,
.area-card small{
  position:relative;
  z-index:1;
}

.area-card strong{
  font-size:18px;
  line-height:1.25;
}

.area-card small{
  opacity:.92;
  margin-top:4px;
}

.area-card.blue{background:#0B5CAB}
.area-card.green{background:#16834B}
.area-card.orange{background:#B85C00}
.area-card.purple{background:#6941C6}
.area-card.pink{background:#B4236A}
.area-card.teal{background:#087F8C}

/* ---------- Lists / materials ---------- */

.list{
  display:grid;
  gap:10px;
}

.list-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:13px 0;
  border-bottom:1px solid var(--border);
}

.list-item:last-child{
  border-bottom:0;
}

.material-card{
  position:relative;
}

.material-card.locked{
  opacity:.96;
}

.material-meta{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
  margin:10px 0;
}

.lock{
  font-size:23px;
  line-height:1;
}

/* ---------- Checklist ---------- */

.check-row{
  display:flex;
  gap:12px;
  align-items:flex-start;
  padding:13px 0;
  border-bottom:1px solid var(--border);
  color:var(--text);
}

.check-row:last-child{
  border-bottom:0;
}

.check-row input{
  width:22px;
  height:22px;
  flex:0 0 22px;
  margin-top:2px;
  accent-color:var(--primary);
}

/* ---------- Form ---------- */

input,select,textarea{
  width:100%;
  border:1px solid #B9C5D2;
  border-radius:14px;
  padding:14px;
  background:var(--surface);
  color:var(--text-strong);
  outline:none;
}

input::placeholder,
textarea::placeholder{
  color:#66758A;
}

input:focus,
select:focus,
textarea:focus{
  border-color:var(--primary);
  box-shadow:0 0 0 3px rgba(11,92,171,.12);
}

textarea{
  min-height:110px;
  resize:vertical;
}

label{
  display:block;
  font-weight:750;
  font-size:14px;
  color:var(--text-strong);
  margin-bottom:7px;
}

.field{
  margin-bottom:15px;
}

/* ---------- Progress ---------- */

.progress{
  height:10px;
  background:#DCE4ED;
  border-radius:var(--radius-pill);
  overflow:hidden;
}

.progress>span{
  display:block;
  height:100%;
  background:var(--success);
  border-radius:inherit;
}

/* ---------- Bottom navigation ---------- */

.bottom-nav{
  position:fixed;
  z-index:20;
  left:50%;
  bottom:0;
  transform:translateX(-50%);
  width:min(100%,var(--content-width));
  padding:8px 10px calc(10px + env(safe-area-inset-bottom));
  background:rgba(255,255,255,.98);
  backdrop-filter:blur(14px);
  border-top:1px solid var(--border);
  display:grid;
  grid-template-columns:repeat(5,1fr);
  box-shadow:0 -8px 28px rgba(23,32,51,.10);
}

.nav-item{
  min-height:52px;
  background:transparent;
  color:#536275;
  padding:7px 2px;
  border-radius:14px;
  font-size:11px;
  font-weight:800;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
}

.nav-item.active{
  background:var(--primary-soft);
  color:var(--primary-dark);
}

.nav-icon{
  font-size:19px;
  line-height:1;
}

/* ---------- Feedback ---------- */

.toast{
  position:fixed;
  z-index:50;
  left:50%;
  bottom:102px;
  transform:translateX(-50%);
  width:min(calc(100% - 32px),488px);
  background:#172033;
  color:#fff;
  padding:14px 16px;
  border-radius:14px;
  box-shadow:var(--shadow-lg);
  text-align:center;
  font-weight:650;
}

.empty{
  padding:28px 8px;
  text-align:center;
  color:var(--text-muted);
}

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

.modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.58);
  z-index:40;
  display:flex;
  align-items:flex-end;
  justify-content:center;
}

.modal{
  width:min(100%,var(--content-width));
  background:var(--surface);
  border-radius:26px 26px 0 0;
  padding:20px;
  max-height:88vh;
  overflow:auto;
  box-shadow:var(--shadow-lg);
}

.modal-actions{
  display:grid;
  gap:10px;
  margin-top:16px;
}

/* ---------- Long content ---------- */

.material-card p,
.card li{
  max-width:68ch;
}

.card ul{
  padding-left:21px;
  margin-bottom:0;
}

@media (min-width:521px){
  body{padding-top:12px}

  .bottom-nav{
    bottom:12px;
    border:1px solid var(--border);
    border-radius:20px;
  }

  .app-shell{
    padding-bottom:112px;
  }
}

@media (max-width:380px){
  .app-shell{
    padding-left:13px;
    padding-right:13px;
  }

  .card{
    padding:16px;
  }

  h1{
    font-size:25px;
  }

  .area-card{
    min-height:122px;
  }
}

@media (prefers-reduced-motion:reduce){
  *{scroll-behavior:auto!important;transition:none!important}
}


/* ---------- Impressão ---------- */

.print-sheet{
  display:none;
}

.print-only{
  display:none;
}

@media print{
  @page{
    size:A4 portrait;
    margin:14mm;
  }

  html,body{
    background:#fff !important;
    color:#000 !important;
    margin:0 !important;
    padding:0 !important;
  }

  body *{
    visibility:hidden !important;
  }

  #print-sheet,
  #print-sheet *{
    visibility:visible !important;
  }

  #print-sheet{
    display:block !important;
    position:static !important;
    width:100% !important;
    max-width:none !important;
    min-height:calc(297mm - 28mm) !important;
    margin:0 !important;
    padding:0 !important;
    background:#fff !important;
    color:#000 !important;
  }

  .print-page{
    display:flex;
    flex-direction:column;
    min-height:calc(297mm - 28mm);
    page-break-after:avoid;
    color:#000 !important;
    background:#fff !important;
  }

  .print-header{
    border-bottom:2px solid #000;
    padding-bottom:6mm;
    margin-bottom:7mm;
  }

  .print-brand{
    font-size:10pt;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.05em;
    margin-bottom:2mm;
  }

  .print-title{
    font-size:19pt;
    line-height:1.15;
    font-weight:800;
    margin:0;
  }

  .print-subtitle{
    font-size:10pt;
    line-height:1.4;
    margin:2mm 0 0;
  }

  .print-content{
    flex:1;
  }

  .print-footer{
    border-top:1px solid #000;
    padding-top:4mm;
    margin-top:7mm;
    font-size:8.5pt;
    line-height:1.35;
  }

  .print-table{
    width:100%;
    border-collapse:collapse;
    table-layout:fixed;
    font-size:9.5pt;
  }

  .print-table th,
  .print-table td{
    border:1px solid #000;
    padding:3mm 2.5mm;
    text-align:left;
    vertical-align:top;
  }

  .print-table th{
    font-weight:800;
  }

  .print-table td{
    height:13mm;
  }

  .print-cards{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:5mm;
  }

  .print-card{
    border:1.5px dashed #000;
    min-height:45mm;
    padding:5mm;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    page-break-inside:avoid;
  }

  .print-card-number{
    font-size:8pt;
    font-weight:700;
  }

  .print-card-title{
    font-size:12pt;
    font-weight:800;
    margin:2mm 0;
  }

  .print-card-text{
    font-size:9pt;
    line-height:1.4;
  }

  .print-fields{
    display:grid;
    gap:7mm;
  }

  .print-field{
    page-break-inside:avoid;
  }

  .print-question{
    font-size:11pt;
    font-weight:800;
    margin-bottom:3mm;
  }

  .print-lines{
    display:grid;
    gap:4mm;
  }

  .print-line{
    height:6mm;
    border-bottom:1px solid #000;
  }

  .print-cards-large{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:7mm;
  }

  .print-large-card{
    min-height:72mm;
    border:2px solid #000;
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;
    padding:7mm;
    page-break-inside:avoid;
  }

  .print-large-card strong{
    font-size:16pt;
    line-height:1.2;
  }
}
