:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-strong: #f9fbfc;
  --text: #17202a;
  --muted: #64717f;
  --line: #dbe2e8;
  --accent: #0f8b8d;
  --accent-dark: #0a686a;
  --success: #137a3a;
  --warning: #a86700;
  --danger: #b3261e;
  --shadow: 0 18px 50px rgba(26, 40, 52, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(120deg, rgba(15, 139, 141, 0.10), rgba(239, 184, 16, 0.08)),
    var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.payment-panel {
  width: min(960px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.payment-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 13px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 32px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 10px;
  font-size: 22px;
  line-height: 1.2;
}

p {
  color: var(--muted);
  line-height: 1.5;
}

.status-pill {
  min-width: 126px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  background: var(--panel-strong);
  font-size: 14px;
}

.status-pill.online {
  color: var(--success);
  border-color: rgba(19, 122, 58, 0.28);
  background: rgba(19, 122, 58, 0.08);
}

.status-pill.offline {
  color: var(--warning);
  border-color: rgba(168, 103, 0, 0.28);
  background: rgba(168, 103, 0, 0.08);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  margin-bottom: 22px;
}

.summary-strip div {
  background: var(--panel-strong);
  padding: 16px;
  min-width: 0;
}

.summary-strip span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.summary-strip strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.state-card,
.requisites-layout {
  min-height: 360px;
}

.state-card {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 42px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.state-card[hidden],
.requisites-layout[hidden] {
  display: none;
}

.loader-ring {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 6px solid rgba(15, 139, 141, 0.16);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
  margin-bottom: 24px;
}

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

.timer {
  width: 160px;
  margin-top: 14px;
  padding: 14px 18px;
  border-radius: 8px;
  background: #17202a;
  color: #ffffff;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0;
}

.requisites-layout {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 18px;
}

.requisites-card,
.receipt-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 20px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.section-heading span {
  color: var(--muted);
  font-size: 14px;
}

.requisites-list {
  margin: 0;
}

.requisites-list div {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.requisites-list dt {
  color: var(--muted);
  font-size: 14px;
}

.requisites-list dd {
  margin: 0;
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  overflow-wrap: anywhere;
  font-weight: 650;
}

.icon-button,
.secondary-button,
.primary-button,
.chat-form button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

.icon-button {
  flex: 0 0 auto;
  padding: 7px 10px;
  background: #e7eef2;
  color: var(--text);
  font-size: 12px;
}

.primary-button {
  width: 100%;
  min-height: 48px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

.primary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.secondary-button {
  padding: 12px 18px;
  background: #e7eef2;
  color: var(--text);
}

.icon-button:active,
.primary-button:active,
.secondary-button:active,
.chat-form button:active {
  transform: translateY(1px);
}

.receipt-form {
  display: grid;
  gap: 16px;
}

.file-drop {
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 8px;
  border: 1px dashed #9caab6;
  border-radius: 8px;
  background: #ffffff;
  padding: 20px;
  cursor: pointer;
}

.file-drop input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.file-drop strong {
  color: var(--text);
}

.file-drop span {
  color: var(--muted);
  font-size: 14px;
}

.pulse-dot,
.success-mark {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
}

.pulse-dot {
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(15, 139, 141, 0.38);
  animation: pulse 1.4s infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 22px rgba(15, 139, 141, 0);
  }
}

.success-mark {
  background: rgba(19, 122, 58, 0.12);
  color: var(--success);
  font-size: 42px;
  font-weight: 800;
}

.state-success {
  border-color: rgba(19, 122, 58, 0.25);
}

.state-failed,
.state-error {
  border-color: rgba(179, 38, 30, 0.22);
}

.chat-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
}

.chat-toggle {
  position: relative;
  min-width: 58px;
  min-height: 58px;
  border: 0;
  border-radius: 50%;
  background: #17202a;
  color: #ffffff;
  box-shadow: 0 12px 34px rgba(23, 32, 42, 0.28);
  cursor: pointer;
}

.chat-icon {
  display: inline-grid;
  place-items: center;
  font-weight: 800;
  font-size: 24px;
}

.chat-badge {
  position: absolute;
  right: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #efb810;
  border: 2px solid #17202a;
}

.chat-alert {
  position: absolute;
  right: 68px;
  bottom: 8px;
  width: min(280px, calc(100vw - 110px));
  background: #17202a;
  color: #ffffff;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  text-align: left;
}

.chat-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: min(380px, calc(100vw - 36px));
  height: 500px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.chat-panel[hidden] {
  display: none;
}

.chat-panel header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.chat-panel header span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.close-chat {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.chat-messages {
  padding: 14px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f7f9fb;
}

.message {
  max-width: 84%;
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.message.client {
  align-self: flex-end;
  background: rgba(15, 139, 141, 0.10);
  border-color: rgba(15, 139, 141, 0.22);
}

.message.operator {
  align-self: flex-start;
}

.message small {
  display: block;
  color: var(--muted);
  margin-bottom: 4px;
  font-size: 12px;
}

.message p {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.chat-form input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.chat-form button {
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  padding: 0 14px;
}

@media (max-width: 760px) {
  .payment-panel {
    padding: 18px;
  }

  .payment-header,
  .section-heading {
    display: grid;
  }

  .summary-strip,
  .requisites-layout,
  .requisites-list div {
    grid-template-columns: 1fr;
  }

  .state-card,
  .requisites-layout {
    min-height: auto;
  }

  .chat-widget {
    right: 12px;
    bottom: 12px;
  }
}
