:root {
  --green: #b0d73e;
  --green-dark: #9bc62f;
  --green-soft: #e8f3c7;
  --brown: #846b55;
  --brown-soft: #f5efe8;
  --ink: #1a1a1a;
  --ink-soft: #6b6b6b;
  --bg: #f7f6f2;
  --card: #ffffff;
  --border: #ececec;
  --border-hover: #d9d9d9;
  --radius: 22px;
  --radius-btn: 14px;
  --shadow-card: 0 10px 40px -12px rgba(20, 20, 20, 0.12), 0 2px 6px -2px rgba(20, 20, 20, 0.04);
  --shadow-btn: 0 1px 2px rgba(20, 20, 20, 0.04);
  --shadow-btn-hover: 0 6px 20px -8px rgba(20, 20, 20, 0.15);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(176, 215, 62, 0.35), transparent 70%);
  top: -120px;
  left: -120px;
}

body::after {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(132, 107, 85, 0.18), transparent 70%);
  bottom: -140px;
  right: -140px;
}

.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  justify-content: center;
  padding: 4px 0 0;
}

.brand a {
  display: inline-flex;
  border-radius: 8px;
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}

.brand a:hover {
  opacity: 0.78;
  transform: translateY(-1px);
}

.brand a:active {
  transform: translateY(0);
}

.brand a:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 4px;
}

.brand img {
  height: 64px;
  width: auto;
  display: block;
}

.identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 14px 0 8px;
}

.photo {
  width: 136px;
  height: 136px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--green-soft);
  box-shadow:
    0 0 0 4px var(--card),
    0 0 0 6px var(--green),
    0 12px 28px -10px rgba(20, 20, 20, 0.25);
}

.photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.88);
  overflow: hidden;
}

.photo-placeholder svg {
  width: 52%;
  height: 52%;
  transform: translateY(4%);
}

.name {
  margin: 6px 0 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.title {
  margin: -6px 0 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brown);
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 52px;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--card);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition:
    transform 180ms var(--ease),
    box-shadow 180ms var(--ease),
    border-color 180ms var(--ease),
    background-color 180ms var(--ease),
    color 180ms var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.btn .icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--ink-soft);
  transition: color 180ms var(--ease), transform 180ms var(--ease);
}

.btn .label {
  flex: 1;
}

.btn .chev {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--ink-soft);
  opacity: 0.55;
  transition: transform 180ms var(--ease), opacity 180ms var(--ease), color 180ms var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
  border-color: var(--green);
  box-shadow: var(--shadow-btn-hover);
}

.btn:hover .icon {
  color: var(--green-dark);
}

.btn:hover .chev {
  transform: translateX(3px);
  opacity: 1;
  color: var(--green-dark);
}

.btn:active {
  transform: translateY(0) scale(0.985);
  box-shadow: var(--shadow-btn);
}

.btn:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--green);
  border-color: var(--green);
  color: var(--ink);
}

.btn-primary .icon,
.btn-primary .chev {
  color: var(--ink);
  opacity: 0.85;
}

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

.btn-primary:hover .icon,
.btn-primary:hover .chev {
  color: var(--ink);
  opacity: 1;
}

.btn-accent {
  background: var(--brown-soft);
  border: 1px dashed var(--brown);
  color: var(--ink);
}

.btn-accent .icon {
  color: var(--brown);
}

.btn-accent .chev {
  color: var(--brown);
}

.btn-accent:hover {
  border-style: solid;
  border-color: var(--brown);
  background: #efe5d8;
}

.btn-accent:hover .icon,
.btn-accent:hover .chev {
  color: var(--brown);
}

.btn.btn-warehouse {
  background: #045f2e;
  border-color: #045f2e;
  color: #ffffff;
}

.btn.btn-warehouse .icon,
.btn.btn-warehouse .chev {
  color: #ffffff;
  opacity: 0.9;
}

.btn.btn-warehouse:hover {
  background: #034a24;
  border-color: #034a24;
}

.btn.btn-warehouse:hover .icon,
.btn.btn-warehouse:hover .chev {
  color: #ffffff;
  opacity: 1;
}

.foot {
  margin-top: 4px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  opacity: 0.75;
}

.foot a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: border-color 180ms var(--ease);
}

.foot a:hover {
  border-bottom-color: var(--ink-soft);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes photoPop {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  60% {
    opacity: 1;
    transform: scale(1.015);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.brand,
.photo,
.logo-hero,
.name,
.title,
.actions .btn,
.foot {
  opacity: 0;
  animation: fadeUp 560ms var(--ease) forwards;
}

.brand {
  animation-delay: 40ms;
}
.photo {
  animation: photoPop 620ms var(--ease) forwards;
  animation-delay: 140ms;
}
.logo-hero {
  animation: photoPop 620ms var(--ease) forwards;
  animation-delay: 80ms;
}
.name {
  animation-delay: 220ms;
}
.title {
  animation-delay: 280ms;
}
.actions .btn:nth-child(1) {
  animation-delay: 360ms;
}
.actions .btn:nth-child(2) {
  animation-delay: 420ms;
}
.actions .btn:nth-child(3) {
  animation-delay: 480ms;
}
.actions .btn:nth-child(4) {
  animation-delay: 540ms;
}
.actions .btn:nth-child(5) {
  animation-delay: 600ms;
}
.actions .btn:nth-child(6),
.actions .btn-warehouse {
  animation-delay: 660ms;
}
.foot {
  animation-delay: 760ms;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
  .brand,
  .photo,
  .logo-hero,
  .name,
  .title,
  .actions .btn,
  .foot {
    opacity: 1;
  }
}

@media (min-width: 640px) {
  .card {
    padding: 34px 30px 28px;
  }

  .brand img {
    height: 72px;
  }

  .photo {
    width: 144px;
    height: 144px;
  }

  .name {
    font-size: 26px;
  }
}

@media (hover: none) {
  .btn:hover {
    transform: none;
    border-color: var(--border);
    box-shadow: var(--shadow-btn);
  }
  .btn:hover .icon {
    color: var(--ink-soft);
  }
  .btn:hover .chev {
    transform: none;
    opacity: 0.55;
    color: var(--ink-soft);
  }
  .btn-primary:hover {
    background: var(--green);
    border-color: var(--green);
  }
  .btn-primary:hover .icon,
  .btn-primary:hover .chev {
    color: var(--ink);
    opacity: 0.85;
  }
  .btn-accent:hover {
    border-style: dashed;
    background: var(--brown-soft);
  }
  .btn.btn-warehouse:hover {
    background: #045f2e;
    border-color: #045f2e;
  }
  .btn.btn-warehouse:hover .icon,
  .btn.btn-warehouse:hover .chev {
    color: #ffffff;
    opacity: 0.9;
  }
}

/* ---------- Home institucional (card--company) ---------- */

.identity--company {
  padding: 10px 0 4px;
  gap: 14px;
}

.identity--company .title {
  color: var(--ink);
}

.logo-hero {
  display: block;
  width: auto;
  max-width: 80%;
  height: 96px;
  object-fit: contain;
}

@media (min-width: 640px) {
  .logo-hero {
    height: 112px;
  }
}

/* ---------- Dialog (Nossas unidades) ---------- */

.dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  padding: 0;
  width: calc(100% - 32px);
  max-width: 460px;
  max-height: min(88dvh, 720px);
  border: none;
  border-radius: 22px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(20, 20, 20, 0.35), 0 8px 24px -8px rgba(20, 20, 20, 0.2);
  overflow: hidden;
}

.dialog::backdrop {
  background: rgba(20, 20, 20, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.dialog[open] {
  animation: dialogIn 260ms var(--ease);
}

.dialog[open]::backdrop {
  animation: backdropIn 260ms var(--ease);
}

@keyframes dialogIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes backdropIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.dialog-form {
  display: flex;
  flex-direction: column;
  max-height: inherit;
  min-height: 0;
  margin: 0;
  overflow: hidden;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--border);
}

.dialog-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.dialog-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.dialog-close svg {
  width: 20px;
  height: 20px;
}

.dialog-close:hover {
  background: var(--bg);
  color: var(--ink);
}

.dialog-close:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

/* ---------- Accordion de unidades ---------- */

.units-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.unit {
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  overflow: hidden;
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

.unit[open] {
  border-color: var(--green);
  box-shadow: 0 4px 14px -6px rgba(176, 215, 62, 0.35);
}

.unit > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  user-select: none;
  transition: background-color 160ms var(--ease);
}

.unit > summary::-webkit-details-marker {
  display: none;
}

.unit > summary:hover {
  background: rgba(176, 215, 62, 0.08);
}

.unit > summary:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: -3px;
}

.unit-flag {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--brown);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.unit-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brown-soft);
  color: var(--brown);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.unit-name {
  flex: 1;
}

.unit-chev {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--ink-soft);
  opacity: 0.7;
  transition: transform 220ms var(--ease), color 160ms var(--ease);
}

.unit[open] > summary > .unit-chev {
  transform: rotate(90deg);
  color: var(--green-dark);
  opacity: 1;
}

.unit-info {
  margin: 0;
  padding: 4px 18px 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px 14px;
  font-size: 14px;
  line-height: 1.5;
}

.unit-info dt {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brown);
  margin-top: 8px;
}

.unit-info dt:first-child {
  margin-top: 0;
}

.unit-info dd {
  margin: 0;
  color: var(--ink);
}

.unit-body {
  padding: 4px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.unit--child {
  background: var(--bg);
}

.unit--child > summary {
  padding: 12px 14px;
  font-size: 14px;
}

.unit--child .unit-info {
  padding: 2px 14px 14px;
}

/* Reduced motion: desabilita animações do dialog */
@media (prefers-reduced-motion: reduce) {
  .dialog[open],
  .dialog[open]::backdrop {
    animation: none;
  }
  .unit-chev {
    transition: none;
  }
}

