/* Layout reset */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: #f4f6fb;
  color: #1f2a44;
  min-height: 100vh;
}

#auth-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 3rem 1.5rem;
  gap: 1.25rem;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(13, 71, 161, 0.18), transparent 32%),
    radial-gradient(circle at bottom right, rgba(15, 40, 80, 0.14), transparent 30%),
    linear-gradient(180deg, #eef3ff 0%, #f7f9fc 100%);
}

.auth-shell {
  width: min(100%, 640px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 0 auto;
}

.auth-branding {
  width: 100%;
  text-align: center;
  padding: 2rem 1.75rem;
  border-radius: 24px;
  background: linear-gradient(135deg, #0d47a1 0%, #1565c0 55%, #42a5f5 100%);
  color: #fff;
  box-shadow: 0 24px 50px rgba(13, 71, 161, 0.22);
}

.auth-kicker {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

.auth-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.auth-logo-pin {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 50% 50% 50% 0;
  background: #fff;
  transform: rotate(-45deg);
}

.auth-logo-pin::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #1565c0;
}

.auth-branding h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.1;
}

.auth-branding p {
  margin: 0.75rem auto 0;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  max-width: 34rem;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.48);
  z-index: 1000;
}

.modal-card {
  width: min(100%, 420px);
  padding: 1.5rem;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-header h2 {
  margin: 0;
}

.modal-close {
  padding: 0.45rem 0.8rem;
  background: #eef2ff;
  color: #1f2a44;
  font-size: 1.25rem;
  line-height: 1;
}

.modal-actions {
  justify-content: flex-end;
}

#login-form {
  width: min(100%, 420px);
  padding: 1.75rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 45px rgba(31, 42, 68, 0.12);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: center;
}

#login-form h2 {
  text-align: center;
  margin: 0 0 1.5rem;
}

#login-form label {
  text-align: left;
  width: 100%;
  max-width: 290px;
}

#login-form input {
  width: 100%;
}

#login-form .actions {
  justify-content: center;
  width: 100%;
  margin-top: 0.25rem;
}

.auth-signature {
  margin: 0;
  color: #5b6780;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
}

header {
  background: #0d47a1;
  color: #fff;
  padding: 2rem;
  text-align: center;
  position: relative;
}

header p {
  max-width: 720px;
  margin: 0.75rem auto 0;
}

.user-info {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
}

.user-info button {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 0.55rem 1rem;
}

.user-info button:hover {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
}

main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  padding: 1.5rem;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(15, 40, 80, 0.08);
}

.card h2 {
  margin-top: 0;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  gap: 0.35rem;
  font-size: 0.95rem;
}

.address-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  align-items: stretch;
}

input,
textarea {
  padding: 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 8px;
  font: inherit;
  transition: border 0.2s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #0d47a1;
  box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.15);
}

.coordinates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.cep-field input {
  width: 100%;
}

.cep-search-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cep-search-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cep-search-controls input {
  flex: 1;
  min-width: 0;
}

.cep-search-btn {
  padding: 0.65rem 0.9rem;
  min-width: 48px;
  background: #1f2a44;
  color: #fff;
  border-radius: 8px;
  border: 1px solid #1f2a44;
  font-size: 1.1rem;
}

.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

 .map-actions {
   display: flex;
   gap: 0.75rem;
   margin-top: 0.75rem;
   flex-wrap: wrap;
 }

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 0.9rem 1.4rem;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  background: #e0e7ff;
  color: #1f2a44;
}

button.primary {
  background: #0d47a1;
  color: #fff;
}

button.secondary {
  background: #1f2a44;
  color: #fff;
}

button.secondary:hover {
  box-shadow: 0 10px 20px rgba(15, 40, 80, 0.25);
}

.hidden {
  display: none !important;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(13, 71, 161, 0.25);
}

.search-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.search-bar input {
  flex: 1;
}

#locations-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 260px;
  overflow-y: auto;
}

#locations-list li span {
  display: block;
  word-break: break-word;
}

#locations-list li {
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid #e4e7ec;
  background: #fbfbff;
  cursor: pointer;
  transition: background 0.2s ease;
}

#locations-list li.active,
#locations-list li:hover {
  background: #0d47a1;
  color: #fff;
  border-color: #0d47a1;
}

.empty-result {
  color: #595f6b;
  cursor: default;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

#users-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#users-list .user-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid #e4e7ec;
  background: #fbfbff;
}

#users-list .pending-user {
  background: #ffe8e8;
  border-color: #e53935;
  color: #8b1d1d;
}

#users-list .approved-user {
  background: #eef7ff;
  border-color: #c8defa;
}

#users-list .pending-user .list-actions button {
  border-color: rgba(139, 29, 29, 0.35);
}

.list-actions {
  display: flex;
  gap: 0.35rem;
  margin-left: auto;
}

.list-actions button {
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
  border-radius: 6px;
}

.list-actions button:hover {
  background: rgba(255, 255, 255, 0.35);
}

.list-actions .danger {
  background: rgba(244, 67, 54, 0.15);
  border-color: rgba(244, 67, 54, 0.5);
}

/* Estilos para requisições de modificação de locais */

#change-requests-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.change-request-item {
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: #fbfbff;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.change-request-item:hover {
  border-color: #c8defa;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.request-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #eee;
}

.request-header strong {
  color: #0d47a1;
  font-size: 0.95rem;
}

.request-time {
  font-size: 0.75rem;
  color: #888;
}

.request-details {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f9f9fb;
  border-radius: 6px;
}

.data-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.old-data,
.new-data {
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

.old-data {
  background: #ffffff;
  border-left: 3px solid #888;
}

.new-data {
  background: #e8f5e9;
  border-left: 3px solid #4caf50;
}

.old-data strong,
.new-data strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #333;
}

.old-data p,
.new-data p {
  margin: 0.25rem 0;
  color: #666;
}

.location-info {
  padding: 0.5rem;
  background: #fff3cd;
  border-radius: 4px;
  border-left: 3px solid #ff9800;
}

.location-info p {
  margin: 0.25rem 0;
  font-size: 0.85rem;
  color: #333;
}

.request-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.request-actions button {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.request-actions .primary {
  background: #4caf50;
  color: white;
  border-color: #45a049;
}

.request-actions .primary:hover {
  background: #45a049;
  box-shadow: 0 2px 4px rgba(76, 175, 80, 0.2);
}

.request-actions .danger {
  background: #f44336;
  color: white;
  border-color: #da190b;
}

.request-actions .danger:hover {
  background: #da190b;
  box-shadow: 0 2px 4px rgba(244, 67, 54, 0.2);
}

.full-map {
  grid-column: 1 / -1;
}

.map-panel-layout {
  display: flex;
  gap: 16px;
}

.map-panel {
  flex: 2;
  height: 400px;
  border-radius: 12px;
  border: 1px solid #cfd8dc;
  min-width: 0;
}

#map {
  height: 420px;
  border-radius: 12px;
  border: 1px solid #cfd8dc;
}

.hint {
  font-size: 0.85rem;
  color: #595f6b;
}

@media (max-width: 700px) {
  main {
    padding: 1rem;
  }

  #auth-section {
    padding: 1.5rem 1rem 2rem;
  }

  .auth-shell {
    width: 100%;
  }

  .auth-branding {
    padding: 1.5rem 1.25rem;
  }

  .actions {
    flex-direction: column;
  }

  .search-bar {
    flex-direction: column;
  }

  #locations-list {
    max-height: 210px;
  }

  #locations-list li {
    padding: 0.65rem;
    font-size: 0.9rem;
  }

  .map-panel-layout {
    flex-direction: column;
    gap: 10px;
  }

  .map-panel,
  #map {
    width: 100%;
    height: 300px;
  }

  .user-info {
    position: static;
    justify-content: center;
    margin-bottom: 1rem;
  }
}
