/* PROMEDIF e-invoice — FO */

.pei-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(18, 24, 38, 0.55);
  backdrop-filter: blur(2px);
}

.pei-overlay[hidden] {
  display: none !important;
}

.pei-modal {
  position: relative;
  width: min(560px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
  background: #fff;
  color: #1a1f2c;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  padding: 0;
  font-family: Georgia, "Times New Roman", serif;
}

.pei-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.1rem 2.5rem 0.95rem;
  background: #fff;
  border-bottom: 1px solid #e6e9ef;
  border-radius: 12px 12px 0 0;
}

.pei-logo {
  display: block;
  width: min(220px, 70%);
  height: auto;
}

.pei-modal-content {
  padding: 1.25rem 1.5rem 1.25rem;
}

.pei-close {
  position: absolute;
  top: 0.55rem;
  right: 0.65rem;
  z-index: 2;
  border: 0;
  background: transparent;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  color: #5b6475;
}

.pei-badge {
  display: inline-block;
  margin: 0 0 0.5rem;
  padding: 0.2rem 0.55rem;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0b3d2e;
  background: #d9f2e8;
  border-radius: 4px;
}

.pei-modal h2 {
  margin: 0 0 0.85rem;
  font-size: 1.55rem;
  line-height: 1.2;
  font-weight: 700;
}

.pei-body p {
  margin: 0 0 0.75rem;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #303848;
}

.pei-callout {
  display: grid;
  gap: 0.35rem;
  margin: 0.85rem 0 1rem;
  padding: 0.85rem 1rem;
  background: #f3f6fb;
  border-left: 4px solid #1f4b7a;
  border-radius: 0 8px 8px 0;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
  line-height: 1.4;
}

.pei-callout strong {
  color: #1f4b7a;
}

.pei-warning {
  padding: 0.65rem 0.85rem;
  background: #fff4e8;
  border-radius: 8px;
  color: #7a3e00 !important;
  font-weight: 600;
}

.pei-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.pei-form label {
  display: grid;
  gap: 0.3rem;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
}

.pei-form input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #c9d1de;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 400;
}

.pei-form input:focus {
  outline: 2px solid #1f4b7a;
  outline-offset: 1px;
}

.pei-form-errors {
  color: #a11919;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.88rem;
}

.pei-form-errors:not([hidden]) {
  display: block;
  padding: 0.55rem 0.7rem;
  background: #fdecec;
  border-radius: 8px;
}

.pei-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.pei-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none !important;
  cursor: pointer;
  line-height: 1.2;
}

.pei-btn-primary {
  background: #0f3d2c;
  color: #fff !important;
}

.pei-btn-primary:hover {
  background: #16553d;
  color: #fff !important;
}

.pei-btn-ghost {
  background: #fff;
  border-color: #c9d1de;
  color: #303848 !important;
}

.pei-account-flag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: #fff4e8;
  color: #7a3e00;
  vertical-align: middle;
}

.pei-account-flag--ok {
  background: #d9f2e8;
  color: #0b3d2e;
}

.pei-account-alert {
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  background: #fff4e8;
  border-left: 4px solid #d97706;
  border-radius: 0 8px 8px 0;
}

.pei-account-alert p {
  margin: 0.35rem 0 0.55rem;
}

.pei-page {
  max-width: 640px;
}

.pei-page-intro {
  margin-bottom: 1.25rem;
}

.pei-page-alert {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
}

.pei-page-alert--danger {
  background: #fdecec;
  color: #7a1212;
}

.pei-page-alert--info {
  background: #eef4fb;
  color: #1f4b7a;
}

.pei-page-alert--ok {
  background: #d9f2e8;
  color: #0b3d2e;
}

.pei-page-form .form-group {
  margin-bottom: 1rem;
}

.pei-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

@media (max-width: 575px) {
  .pei-modal-content {
    padding: 1.05rem 1.15rem 1.15rem;
  }

  .pei-logo {
    width: min(180px, 72%);
  }

  .pei-actions,
  .pei-page-actions {
    flex-direction: column;
  }

  .pei-btn,
  .pei-page-actions .btn {
    width: 100%;
  }
}
