.epc {
  --epc-bg: #eef1f4;
  --epc-card: #fff;
  --epc-line: #d8e0e8;
  --epc-text: #17212b;
  --epc-muted: #647386;
  --epc-accent: #16765b;
  color: var(--epc-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.epc * {
  box-sizing: border-box;
  text-transform: none !important;
}

.epc [hidden] {
  display: none !important;
}

.epc-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.epc-panel {
  background: var(--epc-card);
  border: 1px solid var(--epc-line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(28, 42, 58, 0.08);
  padding: 18px;
}

.epc-head,
.epc-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.epc h2,
.epc h3,
.epc p {
  margin: 0;
}

.epc h2 {
  font-size: 1.2rem;
}

.epc-icon {
  width: 36px;
  height: 36px;
  border: 1px solid var(--epc-line);
  border-radius: 8px;
  background: #f7f9fb;
  cursor: pointer;
}

.epc-segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--epc-line);
  border-radius: 8px;
  background: #f7f9fb;
  margin-bottom: 16px;
}

.epc-segment input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  opacity: 0;
}

.epc-segment span {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--epc-muted);
  text-align: center;
  cursor: pointer;
}

.epc-segment input:checked + span {
  background: #fff;
  color: var(--epc-text);
  box-shadow: 0 1px 5px rgba(28, 42, 58, 0.12);
}

.epc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.epc label span,
.epc-results-head span {
  display: block;
  margin-bottom: 6px;
  color: var(--epc-muted);
  font-size: 0.79rem;
  font-weight: 700;
}

.epc input,
.epc select {
  width: 100%;
  min-height: 39px;
  border: 1px solid var(--epc-line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--epc-text);
}

.epc-details {
  border-top: 1px solid var(--epc-line);
  margin-top: 16px;
  padding-top: 12px;
}

.epc-details summary {
  cursor: pointer;
  font-weight: 800;
}

.epc-details .epc-grid {
  margin-top: 12px;
}

.epc-primary {
  width: 100%;
  min-height: 44px;
  margin-top: 18px;
  border: 0;
  border-radius: 8px;
  background: var(--epc-accent);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.epc-results-head {
  border-bottom: 1px solid var(--epc-line);
  padding-bottom: 14px;
}

.epc-results-head p {
  margin-top: 4px;
  color: var(--epc-muted);
}

.epc-empty,
.epc-loading {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--epc-muted);
  text-align: center;
  font-weight: 800;
}

.epc-offers {
  display: grid;
  gap: 10px;
}

.epc-offer {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(4, minmax(112px, 0.6fr)) 150px;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--epc-line);
  border-radius: 8px;
  background: #fff;
}

.epc-offer.is-preferred {
  border-color: rgba(22, 118, 91, 0.65);
  background: linear-gradient(90deg, rgba(22, 118, 91, 0.08), #fff 24%);
}

.epc-offer.is-preferred .epc-offer-main strong {
  color: var(--epc-accent);
}

.epc-provider {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.epc-provider-logo {
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--epc-line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  color: #255f9b;
  font-size: 0.82rem;
  font-weight: 900;
}

.epc-provider-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5px;
}

.epc-provider-logo.is-fallback {
  background: #f7f9fb;
}

.epc-offer strong,
.epc-offer span,
.epc-offer small {
  display: block;
}

.epc-offer small,
.epc-offer span {
  color: var(--epc-muted);
}

.epc-saving.positive strong {
  color: var(--epc-accent);
}

.epc-saving.negative strong {
  color: #a33a36;
}

.epc-saving small {
  font-size: 0.74rem;
}

.epc-offer button {
  width: 100%;
  min-height: 38px;
  border: 1px solid #255f9b;
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: #255f9b;
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  text-transform: none !important;
  white-space: nowrap;
}

.epc-offer-details {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--epc-line);
}

.epc-offer-details h3 {
  margin: 0;
  font-size: 1rem;
}

.epc-offer-details dl {
  display: grid;
  grid-template-columns: minmax(170px, 240px) minmax(0, 1fr);
  gap: 7px 14px;
  margin: 0;
}

.epc-offer-details dt {
  color: var(--epc-muted);
  font-weight: 800;
}

.epc-offer-details dd {
  margin: 0;
}

.epc-offer-details ul {
  margin: 0;
  padding-left: 18px;
}

.epc-contact {
  display: grid;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--epc-line);
}

.epc-contact-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.epc-contact-head h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.epc-contact-head p,
.epc-documents-note,
.epc-contact-status {
  margin: 0;
  color: var(--epc-muted);
  font-size: 0.86rem;
}

.epc-contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
  padding-top: 2px;
}

.epc-contact-choice,
.epc-offer .epc-contact button {
  display: inline-grid;
  place-items: center;
  width: auto;
  min-height: 38px;
  border: 1px solid #255f9b;
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: #255f9b;
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}

.epc-contact-choice,
.epc-offer .epc-contact .epc-contact-submit {
  border-color: var(--epc-accent);
  background: var(--epc-accent);
  color: #fff;
}

.epc-documents-note {
  border-left: 3px solid #f2c14e;
  padding: 8px 10px;
  background: #fffaf0;
  color: #604100;
}

.epc-contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.epc-contact-grid label span {
  display: block;
  margin-bottom: 5px;
  color: var(--epc-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.epc-contact-grid input,
.epc-contact-grid select {
  width: 100%;
  min-height: 39px;
  border: 1px solid var(--epc-line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--epc-text);
}

.epc-offer .epc-contact .epc-contact-submit {
  justify-self: start;
  min-width: 170px;
}

.epc-offer .epc-contact .epc-contact-choice:disabled,
.epc-offer .epc-contact .epc-contact-submit:disabled {
  cursor: wait;
  opacity: 0.72;
}

.epc-contact-status.is-success {
  color: var(--epc-accent);
  font-weight: 800;
}

.epc-contact-status.is-error {
  color: #a33a36;
  font-weight: 800;
}

.epc-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.epc-badge {
  border-radius: 999px;
  padding: 3px 7px;
  background: #e5f3ee;
  color: #0f674d !important;
  font-size: 0.72rem;
  font-weight: 800;
}

.epc-brief {
  margin-top: 18px;
  border: 1px solid var(--epc-line);
  border-radius: 8px;
  padding: 14px;
  background: #f7f9fb;
}

.epc-brief dl {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 8px 12px;
}

.epc-brief dt {
  color: var(--epc-muted);
  font-weight: 800;
}

.epc-brief dd {
  margin: 0;
}

.epc-error {
  padding: 12px;
  border: 1px solid rgba(163, 58, 54, 0.28);
  border-radius: 8px;
  background: #fff4f3;
  color: #a33a36;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .epc-layout,
  .epc-offer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .epc-grid,
  .epc-offer-details dl,
  .epc-contact-grid,
  .epc-brief dl {
    grid-template-columns: 1fr;
  }

  .epc-contact-head {
    display: grid;
  }

  .epc-contact-actions {
    justify-content: stretch;
  }

  .epc-contact-choice,
  .epc-offer .epc-contact button {
    width: 100%;
  }
}
