/* Shared audit popup styles. Keep in sync with the popup rules in home-redesign.css. */
.audit-modal[hidden],
.audit-modal [hidden] {
  display: none !important;
}
.audit-modal {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  box-sizing: border-box;
  place-items: center;
  padding: 1rem;
  overflow: hidden;
  background: rgba(13, 59, 62, 0.55);
}
.audit-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 42rem);
  max-width: 42rem;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: 0;
  overflow: hidden;
  border-radius: 1.25rem;
  background: #fff;
  box-shadow: rgba(0, 0, 0, 0.25) 0 24px 60px;
}
.audit-progress {
  flex: none;
  height: 4px;
  background: #dfe4e5;
}
.audit-progress span {
  display: block;
  width: 25%;
  height: 100%;
  background: #055e68;
  transition: width 0.3s ease;
}
.audit-close {
  position: absolute;
  z-index: 1;
  top: 0.9rem;
  right: 0.9rem;
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border: 1px solid #dfe4e5;
  border-radius: 50%;
  background: #fff;
  color: #004952;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    color 0.15s ease;
}
.audit-close:hover{
    border:none;
    background-color: #004952;
    color: #fff;
}
.audit-flow {
  overflow-y: auto;
  padding: 1.6rem 2rem 1.3rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.audit-flow::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.audit-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
.audit-header h2,
.audit-success h2 {
  padding-right: 2.5rem;
  color: #004952;
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 500;
  line-height: 1.2;
  margin: 0.6rem 0;
}
.audit-header p,
.audit-success > p {
  margin-top: 0.4rem;
  color: #5a7877;
  font-size: 0.91rem;
}
.audit-question {
  margin: 1.15rem 0 0.65rem;
  color: #004952;
  font-size: 0.95rem;
  font-weight: 600;
}
.audit-question span {
  color: #5a7877;
  font-weight: 400;
}
.audit-label {
  margin: 0.8rem 0 0.4rem;
  color: #055e68;
  font-size: 0.76rem;
  font-weight: 600;
}
.audit-question + .audit-label {
  margin-top: 0;
}
.audit-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}
.audit-option {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.65rem 0.7rem 0.72rem;
  border: 1px solid #dfe4e5;
  border-radius: 0.9rem;
  background: #fff;
  color: #5a7877;
  text-align: left;
  font: inherit;
  font-size: 0.77rem;
  line-height: 1.35;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    transform 0.15s ease;
}
.audit-option:hover,
.audit-option.is-selected {
  border-color: #055e68;
  background: #f5f8f8;
}
.audit-option:hover {
  transform: translateY(-2px);
}
.audit-option.is-selected {
  border-width: 2px;
  padding: calc(0.65rem - 1px) calc(0.7rem - 1px) calc(0.72rem - 1px);
}
.audit-option:after {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  display: grid;
  width: 1.1rem;
  height: 1.1rem;
  place-items: center;
  border: 1.5px solid #9bb0b1;
  border-radius: 50%;
  background: #fff;
  color: #fff;
  content: "";
  font-size: 0.75rem;
  font-weight: 700;
}
.audit-option.is-selected:after {
  border-color: #055e68;
  background: #055e68;
  content: "\2713";
}
.audit-option b {
  min-height: 0;
  padding-right: 1.4rem;
  color: #004952;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.audit-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1rem;
}
.audit-count {
  margin-right: auto;
  color: #5a7877;
  font-size: 0.88rem;
}
#homeAuditCount {
  color: #5a7877;
}
.audit-nav .btn {
  min-width: 10rem;
  min-height: 2.8rem;
  justify-content: center;
  border: 0;
  border-radius: 2rem;
  background: #055e68;
  color: #fff;
  font-size: 0.92rem;
  cursor: pointer;
}
.audit-nav .btn:hover {
  background: #004952;
  color: #fff;
}
.audit-back {
  border: 0;
  background: none;
  color: #055e68;
  font: inherit;
  font-weight: 600;
  font-size: 0.91rem;
  cursor: pointer;
  transition:
    background-color 0.15s ease-in-out,
    color 0.15s ease-in-out,
    padding 0.15s ease-in-out;
}
.audit-back:hover{
  background: #004952;
  color: #fff;
  padding: 0.75rem 0.75rem;
border-radius: 2rem;
}
.audit-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.85rem;
  padding: 0.35rem 0.5rem 0.35rem 0.9rem;
  border: 1px solid #dfe4e5;
  border-radius: 2rem;
  background: #f5f8f8;
  color: #055e68;
  font-size: 0.83rem;
  font-weight: 600;
}
.audit-chip button {
  padding: 0.15rem 0.7rem;
  border: 1px solid #dfe4e5;
  border-radius: 2rem;
  background: #fff;
  color: #055e68;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
}
.audit-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.audit-field {
  position: relative;
  display: block;
  min-width: 0;
}
.audit-field.wide {
  grid-column: 1/-1;
}
.audit-field input,
.audit-field select {
  box-sizing: border-box;
  width: 100%;
  height: 2.9rem;
  padding: 1.1rem 2.4rem 0.3rem 0.95rem;
  border: 1px solid #8baead;
  border-radius: 0.6rem;
  background: #fff;
  color: #004952;
  font-size: 0.91rem;
  font: inherit;
}
.audit-field select {
  padding-right: 2.2rem;
}
.audit-field > span {
  position: absolute;
  top: 1rem;
  left: 0.95rem;
  color: #055e68;
  font-size: 0.86rem;
  pointer-events: none;
  transition: all 0.15s ease;
}
.audit-field input:focus,
.audit-field select:focus {
  outline: 2px solid #055e68;
  border-color: #055e68;
  outline-offset: 1px;
}
.audit-field input:focus + span,
.audit-field input:not(:placeholder-shown) + span,
.audit-field select + span {
  top: 0.35rem;
  color: #055e68;
  font-size: 0.67rem;
}
.audit-field.is-valid:after {
  position: absolute;
  top: 0.95rem;
  right: 0.9rem;
  color: #2f8a5f;
  content: "\2713";
  font-weight: 700;
}
.audit-field.is-invalid input,
.audit-field.is-invalid select {
  border-color: #ff8d6e;
}
.audit-error,
.audit-submit-error {
  margin-top: 0.8rem;
  color: #ff8d6e;
  font-size: 0.85rem;
  font-weight: 600;
}
.audit-footer {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  padding: 0.75rem 2rem;
  background: #f5f8f8;
  color: #5a7877;
  font-size: 0.72rem;
}
.audit-footer a {
  color: #055e68;
  text-decoration: underline;
}
.audit-loading {
  padding: 3rem 0 2.5rem;
  text-align: center;
}
.audit-spinner {
  display: block;
  width: 3.2rem;
  height: 3.2rem;
  margin: 0 auto 1.2rem;
  border: 4px solid #e8f2f2;
  border-top-color: #055e68;
  border-radius: 50%;
  animation: home-audit-spin 0.8s linear infinite;
}
.audit-loading b,
.audit-loading > span:last-child {
  display: block;
}
.audit-loading b {
  color: #004952;
  font-size: 1.15rem;
  font-weight: 500;
}
.audit-loading > span:last-child {
  color: #5a7877;
  font-size: 0.92rem;
}
.audit-success {
  padding: 0.5rem 0;
}
.audit-success h2 {
  margin: 0.8rem 0 0.45rem;
  padding-right: 2.5rem;
  color: #004952;
  font-size: clamp(1.45rem, 2.7vw, 2rem);
  font-weight: 500;
  line-height: 1.2;
}
.audit-success > p {
  margin: 0;
  color: #5a7877;
  font-size: 0.92rem;
  line-height: 1.5;
}
.audit-email-preview {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0 1.1rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid #dfe4e5;
  border-radius: 0.9rem;
  background: #f5f8f8;
}
.audit-email-avatar {
  display: grid;
  flex: 0 0 2.8rem;
  width: 2.8rem;
  height: 2.8rem;
  place-items: center;
  border-radius: 50%;
  background: #004952;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
}
.audit-email-details {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.25rem;
  color: #5a7877;
  font-size: 0.88rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.audit-email-details strong {
  color: #055e68;
  font-size: 0.95rem;
}
.audit-success > .audit-success-help {
  margin-top: 0;
}
.audit-success .audit-nav {
  margin-top: 1.2rem;
}
.audit-success .audit-nav .btn {
  min-width: 10rem;
}
.audit-success > .audit-preview-note {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed #dfe4e5;
  color: #5a7877;
  font-size: 0.72rem;
}
.audit-success-icon {
  display: grid;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  place-items: center;
  border-radius: 50%;
  background: #e8f2f2;
  color: #055e68;
  font-size: 1.5rem;
}
@keyframes home-audit-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 640px) {
  .audit-modal {
    padding: 0.75rem;
  }
  .audit-dialog {
    max-height: calc(100vh - 1.5rem);
    max-height: calc(100dvh - 1.5rem);
    border-radius: 1.25rem;
  }
  .audit-flow {
    padding: 1.4rem 1.25rem 1.1rem;
  }
  .audit-footer {
    padding: 0.65rem 1.25rem;
  }
  .audit-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .audit-fields {
    grid-template-columns: 1fr;
  }
  .audit-field.wide {
    grid-column: auto;
  }
  .audit-nav .btn {
    min-width: 0;
    flex: 1;
  }
}
@media (max-height: 800px) and (min-width: 641px) {
  .audit-dialog {
    max-height: 94vh;
    max-height: 94dvh;
  }
  .audit-flow {
    padding-top: 1.25rem;
    padding-bottom: 1rem;
  }
  .audit-question {
    margin: 1.15rem 0 0.95rem;
  }
  .audit-option {
    padding: 0.55rem 0.65rem 0.6rem;
  }
  .audit-option.is-selected {
    padding: calc(0.55rem - 1px) calc(0.65rem - 1px) calc(0.6rem - 1px);
  }
  .audit-footer {
    padding: 0.6rem 2rem;
  }
}
@media (max-width: 640px) {
  .audit-email-preview {
    gap: 0.75rem;
    margin: 1rem 0;
    padding: 0.9rem;
  }
  .audit-email-details {
    font-size: 0.8rem;
  }
  .audit-email-details strong {
    font-size: 0.86rem;
  }
  .audit-success .audit-nav .btn {
    min-width: 9rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .audit-option,
  .audit-progress span,
  .audit-field > span {
    transition-duration: 0.01ms;
  }
  .audit-spinner {
    animation-duration: 0.01ms;
  }
}
/* Keep the audit dialog centered in the viewport at every screen size. */
.audit-modal:not([hidden]) {
  animation: home-audit-backdrop 0.18s ease-out both;
}
.audit-modal:not([hidden]) .audit-dialog {
  animation: home-audit-dialog-in 0.22s ease-out both;
}
@keyframes home-audit-backdrop {
  from {
    background: rgba(13, 59, 62, 0);
  }
  to {
    background: rgba(13, 59, 62, 0.55);
  }
}
@keyframes home-audit-dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
