:root {
  color-scheme: light;
  --pay-bg: #f2f3f5;
  --pay-surface: #ffffff;
  --pay-surface-soft: #f8f8f9;
  --pay-ink: #111317;
  --pay-muted: #68707b;
  --pay-line: #dedfe3;
  --pay-line-strong: #c9cbd1;
  --pay-accent: #D0AF51;
  --pay-success: #216e42;
  --pay-success-bg: #eef7f1;
  --pay-warning: #806100;
  --pay-warning-bg: #fff7df;
  --pay-danger: #9a3737;
  --pay-danger-bg: #fff1f1;
  --pay-radius: 18px;
  --pay-radius-lg: 26px;
  --pay-shadow: 0 24px 70px rgba(14,18,25,.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 50% -10%, rgba(208,175,81,.075), transparent 30rem),
    var(--pay-bg);
  color: var(--pay-ink);
  font-family: inherit;
  line-height: 1.5;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

main,
.wrap {
  width: min(1040px, calc(100% - 48px));
  margin: 52px auto 80px;
}

.card,
.shell {
  background: var(--pay-surface);
  border: 1px solid var(--pay-line);
  border-radius: var(--pay-radius-lg);
  padding: clamp(28px, 4vw, 48px);
  box-shadow: var(--pay-shadow);
}

.eyebrow,
.provider-logo {
  margin: 0;
  color: #787f89;
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .115em;
  text-transform: uppercase;
}

h1 {
  margin: 10px 0 8px;
  max-width: 780px;
  font-size: clamp(2rem, 4.2vw, 3.15rem);
  line-height: 1.02;
  letter-spacing: -.035em;
}
h2 { color: var(--pay-ink); }
.muted,
.intro,
.lead,
.note,
.store,
.methods,
.meta,
.security,
.hint { color: var(--pay-muted); }
.muted,
.intro,
.lead { font-size: 1rem; line-height: 1.65; }

/* Common top navigation */
.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.lang,
.back {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  gap: 8px;
  color: var(--pay-ink);
  text-decoration: none;
  font-size: .86rem;
  font-weight: 750;
}
.lang {
  padding: 8px 13px;
  border: 1px solid var(--pay-line);
  border-radius: 999px;
  background: var(--pay-surface);
}
.lang:hover,
.back:hover { text-decoration: underline; }

/* Order information */
.origin {
  margin: 28px 0 0;
  padding: 15px 18px;
  border: 1px solid var(--pay-line);
  border-left: 3px solid var(--pay-accent);
  border-radius: 12px;
  background: #fcfcfc;
}
.origin strong { display: block; font-size: .92rem; }
.origin span { display: block; margin-top: 4px; color: var(--pay-muted); font-size: .84rem; }

.summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 28px 0 36px;
  overflow: hidden;
  border: 1px solid var(--pay-line);
  border-radius: 14px;
  background: var(--pay-line);
}
.summary > div,
.summary .pill {
  min-width: 0;
  padding: 17px 19px;
  background: var(--pay-surface-soft);
  border-radius: 0;
}
.summary small,
.pill small {
  display: block;
  margin-bottom: 4px;
  color: #7a818b;
  font-size: .76rem;
  font-weight: 650;
}
.summary strong,
.pill strong {
  display: block;
  font-size: 1.05rem;
  letter-spacing: -.01em;
}

/* Method lists */
.card > h2,
.shell > h2 {
  margin: 34px 0 12px;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #555c66;
}
.options,
.providers { display: grid; gap: 10px; }
.option,
.provider {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--pay-line);
  border-radius: 15px;
  background: var(--pay-surface);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
a.option:hover,
.provider:hover {
  border-color: var(--pay-line-strong);
  box-shadow: 0 8px 24px rgba(14,18,25,.05);
}
a.option:focus-visible,
.btn:focus-visible,
.lang:focus-visible,
.back:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(208,175,81,.28);
  outline-offset: 2px;
}
.option strong,
.provider h2 { display: block; margin: 0; font-size: .98rem; }
.option span { display: block; margin-top: 3px; color: var(--pay-muted); font-size: .88rem; }
.action,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--pay-ink);
  border-radius: 10px;
  background: var(--pay-ink);
  color: #fff;
  padding: 9px 15px;
  text-decoration: none;
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.inactive { background: #fbfbfc; }
.inactive .action {
  border-color: #e9eaed;
  background: #eef0f2;
  color: #747b85;
}
.note {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #ececef;
  font-size: .84rem;
}

/* Provider onboarding */
.store { margin-top: 7px; font-size: .92rem; }
.intro { max-width: 720px; margin: 0 0 32px; }
.provider { padding: 22px; }
.provider h2 { margin-top: 4px; }
.provider .meta { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.provider .methods { margin-top: 12px; font-size: .84rem; line-height: 1.55; }
.status,
.state {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f0f1f3;
  color: #656d78;
  font-size: .74rem;
  font-weight: 800;
}
.status.active, .state.active { background: var(--pay-success-bg); color: var(--pay-success); }
.status.pending, .state.pending { background: var(--pay-warning-bg); color: var(--pay-warning); }
.status.error, .state.error { background: var(--pay-danger-bg); color: var(--pay-danger); }

/* Configuration forms */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.grid .field:nth-child(n+2) { grid-column: span 1; }
.field label {
  display: block;
  margin-bottom: 7px;
  color: #454b54;
  font-size: .8rem;
  font-weight: 800;
}
.field input,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--pay-line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--pay-ink);
}
.field input:focus,
.field select:focus { border-color: #a98b39; }
.hint { margin-top: 6px; font-size: .76rem; }
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.btn.secondary {
  border-color: var(--pay-line-strong);
  background: #fff;
  color: var(--pay-ink);
}
.btn.danger {
  border-color: #ead2d2;
  background: #fff;
  color: var(--pay-danger);
}
.message,
.status.ok,
.status.err {
  margin: 0 0 20px;
  padding: 13px 15px;
  border-radius: 10px;
  font-size: .86rem;
}
.message.success,
.status.ok { display: block; background: var(--pay-success-bg); color: var(--pay-success); }
.message.error,
.status.err { display: block; background: var(--pay-danger-bg); color: var(--pay-danger); }
#ep-status.status { display: none; margin-top: 20px; }
#ep-status.status.ok,
#ep-status.status.err { display: block; }
.meta { margin-top: 26px; padding-top: 20px; border-top: 1px solid #ececef; font-size: .82rem; line-height: 1.6; }
.security { margin-top: 14px; font-size: .78rem; }

/* Easypay hosted checkout */
#easypay-checkout {
  width: 100%;
  min-height: 420px;
  margin: 8px 0 0;
  padding: 22px;
  border: 1px solid var(--pay-line);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}
#easypay-checkout iframe {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  border: 0 !important;
}

/* Completion */
.check {
  width: 52px;
  height: 52px;
  margin: 28px 0 18px;
  display: grid;
  place-items: center;
  border: 1px solid #cde3d4;
  border-radius: 50%;
  background: var(--pay-success-bg);
  color: var(--pay-success);
  font-size: 1.45rem;
  font-weight: 900;
}
.lead { max-width: 720px; margin: 0 0 10px; color: #4f5660; }
.payment-complete-note { color: var(--pay-muted); }

@media (max-width: 840px) {
  main,
  .wrap { width: min(100% - 32px, 760px); margin-top: 28px; }
  .card,
  .shell { padding: 28px; border-radius: 22px; }
  h1 { font-size: clamp(1.9rem, 7vw, 2.65rem); }
}

@media (max-width: 640px) {
  body { background: #f5f5f6; }
  main,
  .wrap { width: 100%; margin: 0; }
  .card,
  .shell {
    min-height: 100dvh;
    padding: 24px 18px 34px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .top { align-items: center; gap: 12px; }
  h1 { font-size: clamp(1.75rem, 9vw, 2.25rem); }
  .muted,
  .intro,
  .lead { font-size: .94rem; }
  .origin { margin-top: 22px; }
  .summary { grid-template-columns: 1fr 1fr; margin: 22px 0 30px; }
  .summary > div,
  .summary .pill { padding: 14px; }
  .option,
  .provider {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
  }
  .option .action,
  .provider .btn { width: 100%; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .actions { display: grid; grid-template-columns: 1fr; }
  .actions .btn { width: 100%; }
  #easypay-checkout { padding: 10px 0; border-left: 0; border-right: 0; border-radius: 0; }
  .back { margin-top: 18px; }
}

@media (max-width: 420px) {
  .card,
  .shell { padding-left: 15px; padding-right: 15px; }
  .summary { grid-template-columns: 1fr; }
  .lang { padding: 7px 10px; }
}


/* Manual payment methods */
.manual-toggle { margin: 12px 0 18px; }
.manual-toggle label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}
.manual-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  accent-color: var(--pay-ink);
}
.field textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  padding: 11px 13px;
  border: 1px solid var(--pay-line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--pay-ink);
}
.field textarea:focus {
  border-color: #a98b39;
  outline: 3px solid rgba(208,175,81,.18);
  outline-offset: 1px;
}
.manual-wide { grid-column: 1 / -1; }
.manual-details {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 1px;
  margin: 28px 0;
  overflow: hidden;
  border: 1px solid var(--pay-line);
  border-radius: 14px;
  background: var(--pay-line);
}
.manual-details > div {
  padding: 17px 19px;
  background: var(--pay-surface-soft);
}
.manual-details small {
  display: block;
  margin-bottom: 4px;
  color: #7a818b;
  font-size: .76rem;
  font-weight: 650;
}
.manual-details strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1rem;
}
@media (max-width:640px) {
  .manual-details { grid-template-columns: 1fr; }
}


/* Retailer Admin */
.admin-wrap { width: min(1180px, calc(100% - 48px)); }
.admin-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.admin-topbar h1 { margin-bottom: 10px; }
.admin-login { max-width: 560px; margin-inline: auto; }
.admin-login form { display: grid; gap: 15px; margin-top: 26px; }
.admin-create { margin-bottom: 22px; }
.admin-create h2,
.admin-list-card h2 {
  margin: 0 0 18px;
  font-size: 1.05rem;
  letter-spacing: -.01em;
  text-transform: none;
  color: var(--pay-ink);
}
.admin-create-form {
  display: grid;
  grid-template-columns: 180px minmax(260px,1fr) auto;
  gap: 16px;
  align-items: end;
}
.admin-submit-field .btn { width: 100%; }
.admin-list-card { padding-top: 34px; }
.admin-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}
.admin-section-head .muted { margin: 0; font-size: .84rem; }
.admin-retailers { display: grid; gap: 14px; }
.admin-retailer {
  display: grid;
  grid-template-columns: minmax(210px,.8fr) minmax(360px,1.6fr) auto;
  gap: 22px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--pay-line);
  border-radius: 16px;
  background: var(--pay-surface);
}
.admin-retailer h3 {
  margin: 4px 0 10px;
  font-size: 1.05rem;
  letter-spacing: -.01em;
}
.admin-statuses {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.admin-onboarding label {
  display: block;
  margin-bottom: 7px;
  color: var(--pay-muted);
  font-size: .76rem;
  font-weight: 700;
}
.admin-url-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto auto;
  gap: 8px;
}
.admin-url {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--pay-line);
  border-radius: 10px;
  background: var(--pay-surface-soft);
  color: #3e444d;
  font-size: .79rem;
}
.btn.danger {
  border-color: #dfcaca;
  background: #fff7f7;
  color: #883d3d;
}
.btn.danger:hover { background: #fff0f0; }
.admin-retailer-actions {
  display: grid;
  gap: 8px;
  justify-items: stretch;
  justify-self: end;
}
.admin-retailer-actions form { margin: 0; }
.admin-retailer-actions .btn { width: 100%; white-space: nowrap; }
@media (max-width: 920px) {
  .admin-create-form { grid-template-columns: 1fr 1fr; }
  .admin-submit-field { grid-column: 1 / -1; }
  .admin-retailer { grid-template-columns: 1fr; }
  .admin-retailer-actions { justify-self: start; }
}
@media (max-width: 640px) {
  .admin-wrap { width: min(100% - 24px, 1180px); }
  .admin-topbar { display: block; }
  .admin-topbar > .btn { margin-top: 10px; }
  .admin-create-form { grid-template-columns: 1fr; }
  .admin-submit-field { grid-column: auto; }
  .admin-url-row { grid-template-columns: 1fr 1fr; }
  .admin-url { grid-column: 1 / -1; }
  .admin-url-row .btn { width: 100%; }
}


/* Delivery authority — selection belongs to nopCommerce checkout */
.fulfillment-authority-note {
  display: grid;
  gap: 4px;
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px solid var(--pay-line);
  border-radius: 12px;
  background: var(--pay-surface-soft);
}
.fulfillment-authority-note strong {
  font-size: .82rem;
  color: var(--pay-ink);
}
.fulfillment-authority-note span {
  color: var(--pay-muted);
  font-size: .84rem;
  line-height: 1.45;
}




/* Easypay first-load modal */
.easypay-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(245, 246, 248, .82);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 1;
  transition: opacity .2s ease;
}

.easypay-loading-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.easypay-loading-modal {
  width: min(420px, calc(100vw - 40px));
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 26px;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid var(--pay-line);
  border-radius: 16px;
  box-shadow: 0 18px 55px rgba(0,0,0,.12);
}

.easypay-loading-spinner {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 3px solid rgba(0,0,0,.12);
  border-top-color: rgba(0,0,0,.78);
  border-radius: 50%;
  animation: elegia-spin .8s linear infinite;
}

.easypay-loading-copy {
  display: grid;
  gap: 5px;
}

.easypay-loading-copy strong {
  font-size: .98rem;
  line-height: 1.3;
  color: var(--pay-ink);
}

.easypay-loading-copy span {
  font-size: .82rem;
  line-height: 1.45;
  color: var(--pay-muted);
}

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

@media (max-width: 520px) {
  .easypay-loading-modal {
    padding: 20px;
    border-radius: 14px;
  }
}
