/* ============================================
   FORMULÁRIO DE AVALIAÇÃO DO PORTAL - PLUGIN MAD
   ============================================ */

.mad-avaliacao-wrap {
  --fluid-letter-spacing: 0;
  font-family: "Open Sans", sans-serif;
  box-sizing: border-box;
  width: 100%;
  padding: 20px;
  max-width: 800px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  background-color: #fff;
  border: 1px solid #eee;
}

.mad-avaliacao-wrap *,
.mad-avaliacao-wrap *::before,
.mad-avaliacao-wrap *::after {
  box-sizing: border-box;
}

.mad-title {
  font-size: 24px;
  color: #1a1a1a;
  margin: 0 0 10px;
  font-weight: 400;
  line-height: 1.3;
}

.mad-subtitle {
  font-size: 15px;
  color: #555;
  margin: 0 0 18px;
}

.mad-field {
  margin-bottom: 18px;
}

.mad-label {
  display: block;
  color: #1f2937;
  font-size: 18px;
  margin-bottom: 12px;
  font-weight: 400;
  line-height: 1.4;
}

.mad-label span {
  color: #c02b0a;
  font-size: 14px;
  font-weight: 400;
}

/* SIM / NÃO */
.mad-choices.mad-inline {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.mad-choice {
  position: relative;
  display: inline-block;
}

.mad-choice input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mad-choice-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 120px;
  height: 120px;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  transition: all 0.8s ease;
  color: #fff;
  user-select: none;
}

.mad-choice-yes .mad-choice-box {
  background: #ffffff;

  border: 0.3px solid #d3cfcf;
  color: #333;
}

.mad-choice-no .mad-choice-box {
  background: #ffffff;

  border: 0.3px solid #d3cfcf;
  color: #333;
}

.mad-choice-icon {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 10px;
  font-weight: 700;
}

.mad-choice-text {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.mad-choice-yes .mad-choice-box:hover,
.mad-choice-yes input[type="radio"]:focus + .mad-choice-box,
.mad-choice-yes input[type="radio"]:checked + .mad-choice-box {
  background: #00519c;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 81, 156, 0.18);
  color: #fff;
}

.mad-choice-no .mad-choice-box:hover,
.mad-choice-no input[type="radio"]:focus + .mad-choice-box,
.mad-choice-no input[type="radio"]:checked + .mad-choice-box {
  background: #c82333;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(227, 52, 69, 0.2);
  color: #fff;
}

/* ESTRELAS */
.mad-stars-wrap {
  width: 100%;
}

.mad-stars {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 8px;
}

.mad-stars input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  left: -9999px;
}

.mad-stars label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.8s ease;
  color: #d1d5db;
  font-size: 46px;
  line-height: 1;
  user-select: none;
}

.mad-stars label:hover,
.mad-stars label:hover ~ label {
  color: #f2c94c;
  transform: scale(1.1);
}

.mad-stars input[type="radio"]:checked + label,
.mad-stars input[type="radio"]:checked + label ~ label {
  color: #f2c94c;
}

.mad-stars input[type="radio"]:focus + label {
  outline: 3px solid rgba(255, 255, 255, 0);
  outline-offset: 2px;
}

.mad-rating-legend {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  max-width: 520px;
  font-size: 14px;
  color: #333;
  margin-top: 4px;
}

/* TEXTAREAS */
.mad-avaliacao-form textarea {
  width: 100%;
  min-height: 130px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  opacity: 0.95;
  font-family: "Open Sans", sans-serif;
  font-size: 14px;
  resize: vertical;
  background: #fff;
  color: #333;
}

.mad-avaliacao-form textarea:focus {
  outline: none;
  border-color: #00519c;
  box-shadow: 0 0 0 3px rgba(0, 81, 156, 0.1);
}

/* BOTÃO */
.mad-actions {
  margin-top: 8px;
}

.mad-submit,
.mad-success-button {
  background: #00519c;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 22px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
  font-family: "Open Sans", sans-serif;
  font-size: 18px;
  line-height: 1.2;
}

.mad-submit:hover,
.mad-success-button:hover {
  background: #00519c;
}

.mad-submit:focus,
.mad-success-button:focus {
  outline: 3px solid rgba(0, 81, 156, 0.2);
  outline-offset: 2px;
}

.mad-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* MENSAGENS */
.mad-response {
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
}

.mad-response.is-success {
  color: #198754;
}

.mad-response.is-error {
  color: #dc3545;
}

/* CARD DE SUCESSO */
.mad-success-card {
  max-width: 500px;
  min-height: 620px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.06);
  padding: 36px 28px 48px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}

.mad-success-card:focus {
  outline: 3px solid rgba(0, 81, 156, 0.18);
  outline-offset: 3px;
}

.mad-success-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #46b37b;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 700;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.08);
  margin-bottom: 88px;
}

.mad-success-title {
  margin: 0 0 28px;
  font-size: 30px;
  line-height: 1.2;
  color: #00519c;
  font-weight: 700;
}

.mad-success-text {
  max-width: 380px;
  font-size: 18px;
  line-height: 1.55;
  color: #1f2937;
  margin: 0 0 72px;
}

.mad-success-button {
  min-width: 136px;
}

/* HONEYPOT */
.mad-honeypot {
  position: absolute !important;
  left: -9999px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* AVISO ADMIN */
.mad-aviso {
  background: #fff7ed;
  border: 1px solid #fdba74;
  padding: 12px 14px;
  border-radius: 8px;
}

/* MOBILE */
@media (max-width: 768px) {
  .mad-avaliacao-wrap {
    padding: 16px;
  }

  .mad-title {
    font-size: 22px;
  }

  .mad-label {
    font-size: 17px;
  }

  .mad-choices.mad-inline {
    gap: 14px;
  }

  .mad-choice-box {
    width: 110px;
    height: 110px;
  }

  .mad-choice-icon {
    font-size: 38px;
  }

  .mad-stars {
    gap: 6px;
    justify-content: space-between;
  }

  .mad-stars label {
    width: 48px;
    height: 48px;
    font-size: 34px;
  }

  .mad-rating-legend {
    max-width: 100%;
    font-size: 13px;
  }

  .mad-success-card {
    min-height: auto;
    padding: 28px 20px 32px;
  }

  .mad-success-icon {
    margin-bottom: 42px;
  }

  .mad-success-title {
    font-size: 28px;
    margin-bottom: 20px;
  }

  .mad-success-text {
    font-size: 17px;
    margin-bottom: 40px;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .mad-avaliacao-wrap {
    padding: 14px;
  }

  .mad-title {
    font-size: 20px;
  }

  .mad-subtitle {
    font-size: 14px;
  }

  .mad-choices.mad-inline {
    gap: 12px;
  }

  .mad-choice-box {
    width: calc(50vw - 40px);
    max-width: 120px;
    min-width: 120px;
    height: 110px;
  }

  .mad-choice-text {
    font-size: 16px;
  }

  .mad-stars {
    gap: 2px;
  }

  .mad-stars label {
    width: 18vw;
    max-width: 44px;
    min-width: 36px;
    height: 44px;
    font-size: 30px;
  }

  .mad-rating-legend {
    font-size: 12px;
  }

  .mad-submit,
  .mad-success-button {
    width: 100%;
    font-size: 17px;
  }

  .mad-success-icon {
    width: 54px;
    height: 54px;
    font-size: 30px;
  }

  .mad-success-title {
    font-size: 24px;
  }

  .mad-success-text {
    font-size: 16px;
    line-height: 1.5;
  }
}



/* estado padrão (quando NÃO está display:block) */
.mad-motivo-field {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(10px);
  visibility: hidden;
  animation: madMotivoFadeOut .6s ease forwards;
}

/* estado visível */
.mad-motivo-field[style*="display: block"] {
  max-height: 320px;
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  animation: madMotivoFadeIn .8s ease forwards;
}

/* entrada */
@keyframes madMotivoFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* saída */
@keyframes madMotivoFadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(10px);
  }
}