:root {
  --whatsapp-z-index: 1050;
  --whatsapp-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  --whatsapp-border-radius: 10px;
  --animation-duration: 0.3s;
  --close-btn-size: 1.8rem;
  --close-btn-position: 15px;
  --overlay-color: rgba(0, 0, 0, 0.75);
  --card-width: 350px;
  --card-bg-color: #ffffff;
  --card-max-width: 450px;
  --mobile-breakpoint: 768px;
  --small-mobile-breakpoint: 480px;
  --very-small-height: 500px;
  --input-focus-color: #28a745;
  --input-focus-shadow: rgba(40, 167, 69, 0.2);
}
.whatsapp-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--overlay-color);
  z-index: calc(var(--whatsapp-z-index) - 1);
  backdrop-filter: blur(4px);
  animation: fadeIn var(--animation-duration) ease-out forwards;
}
.whatsapp-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: var(--card-max-width);
  min-width: 280px;
  z-index: var(--whatsapp-z-index);
  box-shadow: var(--whatsapp-shadow);
  border-radius: var(--whatsapp-border-radius);
  animation: fadeInScale var(--animation-duration) ease-out forwards;
  background: var(--card-bg-color);
  overflow: hidden;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
.close-btn {
  position: absolute;
  top: var(--close-btn-position);
  right: var(--close-btn-position);
  width: var(--close-btn-size);
  height: var(--close-btn-size);
  background: rgba(0, 0, 0, 0.1);
  border: none;
  border-radius: 50%;
  font-size: calc(var(--close-btn-size) * 0.8);
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  transition: all 0.2s ease;
  z-index: 10;
}
.close-btn:hover,
.close-btn:focus {
  background: rgba(0, 0, 0, 0.15);
  color: #000;
  outline: 2px solid var(--input-focus-color);
}
.hidden {
  display: none !important;
  visibility: hidden;
}
.logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}
.logo-img {
  height: 180px;
  width: auto;
  max-height: 140px;
  object-fit: contain;
}
.whatsapp-card .card-body {
  padding: 2rem;
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.whatsapp-card .card-title {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  color: #333;
  text-align: center;
  font-weight: 600;
  line-height: 1.3;
}
.form-group {
  margin-bottom: 1rem;
}
.form-label {
  font-weight: 500;
  color: #555;
  margin-bottom: 0.5rem;
  display: block;
}
.form-control,
.form-select {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--input-focus-color);
  outline: none;
  box-shadow: 0 0 0 2px var(--input-focus-shadow);
}
input#userCPF {
  font-family: monospace;
}
.btn-success {
  background-color: var(--input-focus-color);
  border: none;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 500;
  width: 100%;
  margin-top: 0.5rem;
  transition: background-color 0.2s;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  margin-top: auto;
}
.btn-success:hover,
.btn-success:focus {
  background-color: #218838;
  outline: none;
}
.form-control:invalid,
.form-select:invalid {
  border-color: #dc3545;
}
.form-control:invalid:focus,
.form-select:invalid:focus {
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
}
@media (max-width: 768px) {
  .whatsapp-card {
    width: 85%;
    max-height: 85vh;
  }
  .whatsapp-card .card-body {
    padding: 1.5rem;
  }
  .whatsapp-card .card-title {
    font-size: 1.3rem;
    margin-bottom: 1.2rem;
  }
  .logo-img {
    height: 90px;
  }
}
@media (max-width: 480px) {
  .whatsapp-card {
    width: 95%;
    max-height: 95vh;
  }
  .whatsapp-card .card-body {
    padding: 1.2rem;
  }
  .whatsapp-card .card-title {
    font-size: 1.2rem;
  }
  .form-control,
  .form-select {
    padding: 0.65rem;
    font-size: 0.9rem;
  }
  .btn-success {
    padding: 0.65rem;
    font-size: 0.95rem;
  }
  .close-btn {
    width: 1.6rem;
    height: 1.6rem;
    font-size: 1rem;
  }
  .logo-img {
    height: 80px;
  }
}
@media (max-width: 360px) {
  .whatsapp-card .card-body {
    padding: 1rem;
  }
  .whatsapp-card .card-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }
  .form-control,
  .form-select {
    padding: 0.55rem;
    font-size: 0.85rem;
  }
  .logo-img {
    height: 70px;
  }
}
@media (max-height: 600px) {
  .whatsapp-card {
    max-height: 98vh;
    top: 0;
    transform: translate(-50%, 10px);
  }
  .whatsapp-card .card-body {
    padding: 1rem;
  }
  .whatsapp-card .card-title {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
  }
  .form-control,
  .form-select {
    padding: 0.5rem;
    margin-bottom: 0.7rem;
    font-size: 0.85rem;
  }
  .btn-success {
    padding: 0.6rem;
    font-size: 0.9rem;
  }
  .logo-img {
    height: 60px;
    margin-bottom: 0.5rem;
  }
}
.whatsapp-card {
  pointer-events: auto;
}
.whatsapp-overlay {
  pointer-events: none;
  cursor: default;
}
.whatsapp-card .card-body {
  pointer-events: auto;
}
*:focus {
  outline: 2px solid var(--input-focus-color);
  outline-offset: 2px;
}