/* =========
   Base
========= */
:root{
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: rgba(15, 23, 42, .65);
  --primary: #223450;
  --primary-2: #2f4d79;
  --border: rgba(34, 52, 80, .14);
  --shadow: 0 18px 50px rgba(2, 6, 23, .10);
  --radius: 22px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 20% -10%, rgba(34, 52, 80, .16), transparent 60%),
    radial-gradient(700px 450px at 90% 20%, rgba(34, 52, 80, .10), transparent 55%),
    linear-gradient(180deg, #ffffff, var(--bg));
}

/* =========
   App shell
========= */
.app{
  min-height: 100%;
  padding: calc(16px + var(--safe-top)) 16px calc(22px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 520px;
  margin: 0 auto;
}

.brand{
  display: grid;
  place-items: center;
  padding-top: 6px;
}
.brand__logo{
  width: min(210px, 62vw);
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(2,6,23,.12));
}

/* =========
   Card / views
========= */
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px;
}

.view{ animation: fadeIn .18s ease-out; }
.hidden{ display: none !important; }

.view__top{
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
}

.title{
  margin: 6px 0 6px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.subtitle{
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.35;
}
.muted{ color: var(--muted); }

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

.field{ display: grid; gap: 6px; }
.field__label{
  font-size: 12px;
  color: rgba(15,23,42,.78);
  font-weight: 600;
}
.field input{
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  outline: none;
  font-size: 14.5px;
  transition: box-shadow .15s ease, border-color .15s ease, transform .06s ease;
}
.field input::placeholder{ color: rgba(15,23,42,.35); }
.field input:focus{
  border-color: rgba(34,52,80,.45);
  box-shadow: 0 0 0 4px rgba(34,52,80,.12);
}
.field__row{
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 10px;
  align-items: center;
}

.hint{
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}

/* =========
   Buttons
========= */
.btn{
  border: 0;
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 800;
  font-size: 14.5px;
  cursor: pointer;
  transition: transform .06s ease, box-shadow .15s ease, filter .15s ease;
  user-select: none;
}
.btn:active{ transform: translateY(1px) scale(.995); }

.btn--primary{
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 14px 26px rgba(34,52,80,.25);
}
.btn--primary:hover{ filter: brightness(1.03); }

.link{
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 800;
  font-size: 13px;
  padding: 8px 6px;
  cursor: pointer;
}
.row{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.row--between{
  justify-content: space-between;
  align-items: center;
}

.back{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-weight: 900;
  color: var(--primary);
  box-shadow: 0 10px 18px rgba(2,6,23,.06);
}
.icon-btn{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(2,6,23,.06);
}

/* =========
   Footer
========= */
.footer{
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 10px 2px;
  color: rgba(15,23,42,.55);
}
.footer__dot{
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 6px rgba(34,52,80,.10);
}
.footer__text{ font-weight: 700; font-size: 12.5px; }

/* =========
   Toast
========= */
.toast{
  position: fixed;
  left: 50%;
  bottom: calc(18px + var(--safe-bottom));
  transform: translateX(-50%);
  background: rgba(15,23,42,.92);
  color: #fff;
  padding: 12px 14px;
  border-radius: 16px;
  max-width: min(92vw, 460px);
  width: max-content;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
  box-shadow: 0 18px 40px rgba(2,6,23,.35);
  font-size: 13.5px;
}
.toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

/* =========
   Modal
========= */
.modal{ position: fixed; inset: 0; display: grid; place-items: center; z-index: 40; }
.modal.hidden{ display: none; }
.modal__backdrop{ position: absolute; inset: 0; background: rgba(2,6,23,.55); }
.modal__card{
  position: relative;
  width: min(92vw, 520px);
  border-radius: 22px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.modal__header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px;
  background: linear-gradient(135deg, rgba(34,52,80,.10), rgba(34,52,80,.06));
}
.modal__header h3{
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.01em;
}
.modal__body{
  padding: 14px;
  color: rgba(15,23,42,.82);
  font-size: 13.5px;
  line-height: 1.5;
}
.modal__body .mail{
  border: 1px dashed rgba(34,52,80,.35);
  border-radius: 16px;
  padding: 12px;
  background: rgba(34,52,80,.05);
}
.modal__footer{ padding: 14px; display: flex; justify-content: flex-end; }

/* =========
   Device block (tablet/desktop)
========= */
.device-block{
  display: none;
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 500px at 20% -10%, rgba(34, 52, 80, .18), transparent 60%),
    radial-gradient(700px 450px at 90% 20%, rgba(34, 52, 80, .12), transparent 55%),
    linear-gradient(180deg, #ffffff, var(--bg));
  z-index: 60;
  padding: 18px;
}
.device-block__card{
  width: min(92vw, 520px);
  margin: 8vh auto 0;
  background: #fff;
  border-radius: 26px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 22px 18px;
  text-align: center;
}
.device-block__icon{ font-size: 44px; margin-bottom: 10px; }
.device-block__card h1{
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 950;
  letter-spacing: -0.02em;
}
.device-block__card p{ margin: 6px 0; color: rgba(15,23,42,.72); }

/* =========
   Animations
========= */
@keyframes fadeIn{
  from{ opacity: 0; transform: translateY(4px); }
  to{ opacity: 1; transform: translateY(0); }
}

/* =========
   Dashboard (Etapa 2)
========= */
.dash-header{
  text-align: center;
  padding-top: 4px;
}
.dash-logo{
  width: 150px;
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(2,6,23,.10));
}
.welcome{
  margin: 10px 0 4px;
  font-size: 14px;
  color: rgba(15,23,42,.70);
}

.dash-grid{
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dash-card{
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 16px 12px;
  text-align: center;
  box-shadow: 0 18px 40px rgba(2,6,23,.08);
  cursor: pointer;
  transition: transform .10s ease, box-shadow .18s ease, border-color .18s ease;
  color: var(--primary);
}
.dash-card:active{ transform: scale(.98); }

.svg-icon{
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  border-radius: 16px;
  background: rgba(34,52,80,.06);
  border: 1px solid rgba(34,52,80,.12);
  animation: floaty 2.4s ease-in-out infinite;
}
.dash-card:nth-child(2) .svg-icon{ animation-delay: .15s; }
.dash-card:nth-child(3) .svg-icon{ animation-delay: .30s; }
.dash-card:nth-child(4) .svg-icon{ animation-delay: .45s; }

.svg-icon svg{
  width: 22px;
  height: 22px;
}

.dash-text{
  display: block;
  font-weight: 900;
  font-size: 13.5px;
  letter-spacing: -0.01em;
}

.logout{ margin-top: 14px; width: 100%; }

@keyframes floaty{
  0%,100%{ transform: translateY(0px); }
  50%{ transform: translateY(-3px); }
}

/* =========
   Dashboard ajustes visuais
========= */
body.dashboard .brand{
  display: none;
}

body.dashboard .app{
  padding-top: calc(8px + var(--safe-top));
}

body.dashboard .dash-logo{
  width: 180px;
}

body.dashboard .dash-grid{
  gap: 16px;
  margin-top: 24px;
}

body.dashboard .dash-card{
  padding: 20px 14px;
}

body.dashboard .svg-icon{
  width: 52px;
  height: 52px;
}

body.dashboard .svg-icon svg{
  width: 26px;
  height: 26px;
}

body.dashboard .dash-text{
  font-size: 14.5px;
}

textarea{
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}

/* =========
   Tags (Ouvidoria Câmara Municipal)
========= */
.brand__tag, .dash-tag{
  margin-top: 2px;
  font-weight: 950;
  font-size: 15px;
  color: var(--primary);
  letter-spacing: -0.01em;
  text-align: center;
}
.dash-tag{ margin-top: 1px; }
.dash-tag{ margin-top: 6px; }

/* =========
   Info view
========= */
.info-card{
  margin-top: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 16px 14px;
  box-shadow: 0 18px 40px rgba(2,6,23,.08);
}
.info-card h3{
  margin: 12px 0 6px;
  font-size: 13px;
  font-weight: 950;
  color: rgba(15,23,42,.86);
}
.info-card p{
  margin: 0;
  color: rgba(15,23,42,.72);
  font-size: 13.5px;
  line-height: 1.45;
}
.info-link{ color: var(--primary); font-weight: 900; text-decoration: none; }
.info-link:active{ opacity: .75; }

/* =========
   Segmented control + list
========= */
.segmented{
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(34,52,80,.06);
  border: 1px solid rgba(34,52,80,.12);
  border-radius: 18px;
  padding: 6px;
  gap: 6px;
}
.segmented__btn{
  border: 0;
  background: transparent;
  border-radius: 14px;
  padding: 10px 10px;
  font-weight: 950;
  color: rgba(34,52,80,.82);
  cursor: pointer;
}
.segmented__btn.is-active{
  background: #fff;
  box-shadow: 0 14px 26px rgba(34,52,80,.14);
  color: var(--primary);
}

.list{ margin-top: 12px; display: grid; gap: 10px; }

.item{
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 14px 14px;
  box-shadow: 0 18px 40px rgba(2,6,23,.07);
  cursor: pointer;
  display: grid;
  gap: 8px;
}
.item__top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.item__proto{
  font-weight: 1000;
  color: rgba(15,23,42,.86);
  font-size: 13px;
}
.badge{
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 950;
  font-size: 12px;
  border: 1px solid rgba(34,52,80,.14);
}
.badge--andamento{
  background: rgba(245, 158, 11, .14); /* laranja */
  color: rgba(146, 64, 14, 1);
  border-color: rgba(245, 158, 11, .35);
}
.badge--resolvido{
  background: rgba(34, 197, 94, .14); /* verde */
  color: rgba(20, 83, 45, 1);
  border-color: rgba(34, 197, 94, .35);
}
.item__desc{
  color: rgba(15,23,42,.70);
  font-size: 13px;
  line-height: 1.35;
}

/* ===== Ajustes solicitados (sem quebrar nada) ===== */
.brand__tag, .dash-tag{
  margin-top: 0px !important;
  font-size: 16px !important;
  font-weight: 950 !important;
}
.dash-tag{ margin-top: 0px !important; }

.badge{
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  white-space: nowrap !important;
  line-height: 1 !important;
}
