.phai-widget,
.phai-widget * {
  box-sizing: border-box;
}

.phai-widget {
  --phai-blue: #21349a;
  --phai-blue-dark: #111f67;
  --phai-red: #d62828;
  --phai-white: #ffffff;
  --phai-muted: rgba(255, 255, 255, 0.72);
  position: relative;
  isolation: isolate;
  margin-top: clamp(48px, 7vw, 88px);
  padding: clamp(28px, 5vw, 62px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 28px;
  background:    var(--brand-navy-dark);
  box-shadow: 0 28px 80px rgba(17, 31, 103, 0.24);
  font-family: inherit;
}

.phai-glow {
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  filter: blur(2px);
  pointer-events: none;
}

.phai-glow-one {
  width: 360px;
  height: 360px;
  top: -190px;
  right: -110px;
  background: rgba(255, 255, 255, 0.09);
}

.phai-glow-two {
  width: 270px;
  height: 270px;
  left: -120px;
  bottom: -160px;
  background: rgba(214, 40, 40, 0.19);
}

.phai-content {
  width: min(900px, 100%);
  margin-inline: auto;
}

.phai-heading {
  margin-bottom: 30px;
  text-align: center;
}

.phai-eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.phai-heading h2 {
  margin: 0;
  color: var(--phai-white);
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  line-height: 1.12;
}

.phai-heading p {
  max-width: 700px;
  margin: 16px auto 0;
  color: var(--phai-muted);
  font-size: 1rem;
  line-height: 1.7;
}

.phai-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.phai-upload {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  min-height: 128px;
  padding: 22px;
  border: 2px dashed rgba(255, 255, 255, 0.32);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.075);
  cursor: pointer;
  transition: 180ms ease;
}

.phai-upload:hover,
.phai-upload:focus-within,
.phai-upload.is-dragging {
  border-color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.phai-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.phai-upload-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: var(--phai-white);
  color: var(--phai-blue);
  box-shadow: 0 10px 24px rgba(7, 15, 58, 0.17);
}

.phai-upload-icon svg {
  width: 28px;
  height: 28px;
}

.phai-upload-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  color: var(--phai-white);
}

.phai-upload-copy strong {
  font-size: 1.03rem;
}

.phai-upload-copy small {
  color: rgba(255, 255, 255, 0.64);
  line-height: 1.45;
}

.phai-upload-action {
  padding: 11px 15px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  color: var(--phai-white);
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
}

.phai-previews,
.phai-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.phai-preview {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.14);
}

.phai-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.phai-preview span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  overflow: hidden;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(4, 8, 30, 0.76);
  color: #fff;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phai-consent {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.86rem;
  line-height: 1.5;
  cursor: pointer;
}

.phai-consent input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--phai-red);
  flex: 0 0 auto;
}

.phai-submit {
  align-self: center;
  min-width: 245px;
  min-height: 52px;
  padding: 13px 22px;
  border: 0;
  border-radius: 12px;
  background: var(--phai-red);
  color: #fff;
  box-shadow: 0 12px 28px rgba(124, 17, 17, 0.32);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  transition: 180ms ease;
}

.phai-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.phai-submit:disabled {
  cursor: wait;
  opacity: 0.76;
}

.phai-submit > span {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
}

.phai-submit svg {
  width: 20px;
  height: 20px;
}

.phai-spinner {
  width: 19px;
  height: 19px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: phai-spin 0.75s linear infinite;
}

@keyframes phai-spin {
  to { transform: rotate(360deg); }
}

.phai-privacy {
  margin: 0;
  color: rgba(255, 255, 255, 0.54);
  font-size: 0.76rem;
  line-height: 1.5;
  text-align: center;
}

.phai-status {
  margin-top: 22px;
  padding: 14px 16px;
  border-radius: 12px;
  color: #fff;
  font-size: 0.92rem;
  line-height: 1.5;
  text-align: center;
}

.phai-status.is-loading { background: rgba(255, 255, 255, 0.1); }
.phai-status.is-success { background: rgba(24, 135, 79, 0.92); }
.phai-status.is-error { background: rgba(176, 31, 31, 0.94); }

.phai-results {
  margin-top: 24px;
}

.phai-result {
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(4, 10, 44, 0.25);
}

.phai-result img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #e9edf7;
}

.phai-result-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 15px;
}

.phai-result-footer strong {
  color: #172052;
  font-size: 0.92rem;
}

.phai-download {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--phai-blue);
  color: #fff;
  font-size: 0.79rem;
  font-weight: 800;
  text-decoration: none;
}

.phai-download:hover {
  color: #fff;
  filter: brightness(0.92);
}

/*alerta edicas deimage*/
.implantacao-alert {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border-radius: 16px;
  text-align: left;
}

.implantacao-alert-info {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
}

.implantacao-alert-warning {
  border: 1px solid rgba(255, 193, 7, 0.28);
  background: rgba(255, 193, 7, 0.12);
  color: #ffffff;
}

.implantacao-alert-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
}

.implantacao-alert-icon svg {
  width: 20px;
  height: 20px;
}

.implantacao-alert-content strong {
  display: block;
  margin-bottom: 8px;
  font-size: 0.98rem;
  color: white;
}

.implantacao-alert-content ul {
  margin: 0;
  padding-left: 18px;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.6;
}

.implantacao-alert-content li + li {
  margin-top: 4px;
}

@media (max-width: 700px) {
  .phai-widget {
    margin-top: 48px;
    padding: 27px 17px;
    border-radius: 22px;
  }

  .phai-upload {
    grid-template-columns: auto 1fr;
    padding: 18px;
  }

  .phai-upload-action {
    grid-column: 1 / -1;
    text-align: center;
  }

  .phai-previews,
  .phai-results {
    grid-template-columns: 1fr;
  }

  .phai-result-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .phai-download {
    justify-content: center;
  }
}
