@import url('https://fonts.googleapis.com/css2?family=Anek+Latin:wght@400;500;600;700;800&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --bordo: #6e1423;
  --bordo-2: #8b1e30;
  --bordo-3: #4a0d18;
  --bordo-claro: #fbeef0;
  --vermelho: #c0392b;
  --texto: #1a1a1a;
  --texto-2: #6b7280;
  --texto-3: #9ca3af;
  --bg: #f6f7f8;
  --bg-card: #ffffff;
  --borda: #eaecef;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-2: 0 8px 24px rgba(0,0,0,0.12);
  --r-card: 18px;
  --r-btn: 10px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

html, body {
  font-family: 'Anek Latin', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  color: var(--texto);
  background: linear-gradient(180deg, #faf6f7 0%, #f0e7ea 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, input { font-family: inherit; font-size: 16px; }
button { cursor: pointer; border: none; background: none; }
a { text-decoration: none; color: inherit; }
.oculto { display: none !important; }

/* ===== Login ===== */
.tela-login {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--bordo) 0%, var(--bordo-2) 100%);
}
.login-card {
  background: var(--bg-card);
  border-radius: var(--r-card);
  padding: 32px 24px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow-2);
  text-align: center;
}
.login-logo { font-size: 56px; margin-bottom: 8px; }
.login-card h1 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.login-sub { color: var(--texto-2); font-size: 14px; margin-bottom: 20px; }
.login-card input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--borda);
  border-radius: var(--r-btn);
  margin-bottom: 12px;
  outline: none;
  transition: border-color .15s;
}
.login-card input:focus { border-color: var(--bordo); }
.btn-primario {
  background: linear-gradient(135deg, var(--bordo) 0%, var(--bordo-2) 100%);
  color: #fff;
  padding: 14px 18px;
  border-radius: var(--r-btn);
  font-weight: 700;
  font-size: 15px;
  width: 100%;
  box-shadow: 0 2px 8px rgba(110,20,35,0.35);
  transition: transform .12s;
}
.btn-primario:active { transform: scale(0.98); }
.login-erro {
  margin-top: 12px;
  background: #fce8eb;
  color: var(--bordo);
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
}

/* ===== Home ===== */
.home {
  min-height: 100vh;
  padding: calc(40px + var(--safe-top)) 20px calc(20px + var(--safe-bot));
  display: flex;
  flex-direction: column;
}
.home-header {
  text-align: center;
  margin-bottom: 36px;
}
.home-header h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--bordo);
  margin-bottom: 4px;
}
.home-header p {
  font-size: 15px;
  color: var(--texto-2);
}

/* ===== Grid de atalhos ===== */
.grid-atalhos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 12px;
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  align-content: start;
}
.atalho {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  gap: 8px;
  padding: 8px 4px;
  transition: transform .15s;
}
.atalho:active { transform: scale(0.92); }

.atalho-icone {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--bordo) 0%, var(--bordo-2) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(110,20,35,0.35);
}
.atalho-icone svg {
  width: 32px;
  height: 32px;
}
.atalho-nome {
  font-size: 13px;
  font-weight: 600;
  color: var(--texto);
  margin-top: 2px;
}
.atalho-desc { display: none; }

/* desktop: 4 colunas */
@media (min-width: 600px) {
  .grid-atalhos { grid-template-columns: repeat(4, 1fr); max-width: 600px; }
}

/* ===== Footer ===== */
.home-footer {
  margin-top: 36px;
  text-align: center;
}
.btn-sair {
  color: var(--texto-2);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  transition: background .12s;
}
.btn-sair:hover { background: var(--bordo-claro); color: var(--bordo); }

/* ===== Loader ===== */
.loader-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 400;
}
.loader-box {
  background: var(--bg-card);
  padding: 22px 28px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-2);
}
.loader-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--bordo-claro);
  border-top-color: var(--bordo);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-texto { font-size: 13px; font-weight: 500; color: var(--texto-2); }

/* ===== Popup ===== */
.popup-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 300;
  padding: 20px;
}
.popup {
  background: var(--bg-card);
  width: 100%;
  max-width: 360px;
  border-radius: 16px;
  padding: 24px 22px 18px;
  text-align: center;
  box-shadow: var(--shadow-2);
}
.popup-icone-wrap { display: flex; justify-content: center; margin-bottom: 12px; }
.popup-icone {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  font-weight: 700;
  background: #fef5e0; color: #c47e0a;
}
.popup-titulo { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.popup-msg {
  font-size: 14px;
  color: var(--texto-2);
  line-height: 1.5;
  margin-bottom: 18px;
}
.popup-botoes { display: flex; gap: 10px; }
.popup-botoes > button { flex: 1; padding: 12px 14px; font-size: 14px; }
.btn-secundario {
  background: var(--bg);
  color: var(--texto);
  padding: 12px 16px;
  border-radius: var(--r-btn);
  font-weight: 600;
  border: 1.5px solid var(--borda);
}