@import url("/assets/fonts/goto-fonts.css");

:root {
  --gm-ink: #071527;
  --gm-muted: #657386;
  --gm-line: rgba(11, 28, 49, 0.12);
  --gm-card: rgba(255, 255, 255, 0.92);
  --gm-panel: rgba(255, 255, 255, 0.84);
  --gm-soft: #f4f8fb;
  --gm-primary: #1488ff;
  --gm-accent: #31ca75;
  --gm-danger: #e84d4d;
  --gm-radius: 20px;
  --gm-font: var(--font-goto-sans), Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --gm-hero-image: url("/assets/gopayments/brand/payments-stage-bg.jpg");
}

* { box-sizing: border-box; }

html,
body {
  min-height: 100%;
  margin: 0;
}

body.gm-body {
  color: var(--gm-ink);
  font-family: var(--gm-font);
  background:
    radial-gradient(circle at 10% 10%, rgba(49, 202, 117, 0.22), transparent 26%),
    radial-gradient(circle at 92% 0%, rgba(20, 136, 255, 0.22), transparent 30%),
    linear-gradient(135deg, #f7fbff 0%, #eef7f2 48%, #fff7ef 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.gm-app {
  min-height: 100dvh;
  padding: clamp(12px, 1.6vw, 22px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
}

.gm-header,
.gm-card,
.gm-panel,
.gm-preview-shell {
  border: 1px solid var(--gm-line);
  box-shadow: 0 18px 54px rgba(15, 36, 61, 0.08);
  backdrop-filter: blur(18px);
}

.gm-header {
  min-height: 70px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: var(--gm-radius);
  background: rgba(255, 255, 255, 0.82);
}

.gm-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.gm-brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.gm-brand span {
  color: var(--gm-ink);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}

.gm-brand b {
  color: var(--gm-primary);
  font-weight: 800;
}

.gm-plus {
  color: var(--gm-accent);
  font-weight: 700;
}

.gm-tabs,
.gm-actions {
  min-width: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.gm-tabs::-webkit-scrollbar,
.gm-actions::-webkit-scrollbar,
.gm-left::-webkit-scrollbar,
.gm-center::-webkit-scrollbar,
.gm-right::-webkit-scrollbar,
.gm-panel::-webkit-scrollbar { display: none; }

.gm-tabs button {
  border: 0;
  border-radius: 999px;
  padding: 9px 12px;
  color: var(--gm-muted);
  background: transparent;
  white-space: nowrap;
}

.gm-tabs button.active {
  color: var(--gm-ink);
  background: rgba(20, 136, 255, 0.1);
}

.gm-icon-button {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.03)),
    linear-gradient(135deg, var(--gm-primary), var(--gm-accent));
  box-shadow: 0 14px 34px rgba(20, 136, 255, 0.18);
}

.gm-icon-button svg,
.gm-config svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gm-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(210px, 250px) minmax(0, 1fr) minmax(260px, 340px);
  gap: 14px;
}

.gm-left,
.gm-center,
.gm-right {
  min-height: 0;
  overflow: auto;
  scrollbar-width: none;
}

.gm-left,
.gm-right {
  display: grid;
  align-content: start;
  gap: 12px;
}

.gm-card,
.gm-panel,
.gm-preview-shell {
  border-radius: var(--gm-radius);
  background: var(--gm-card);
}

.gm-card {
  padding: 14px;
  display: grid;
  gap: 8px;
}

.gm-card small,
.gm-card span,
.gm-help,
.gm-panel-head p,
.gm-hero p,
.gm-module-list small,
.gm-meta-line,
.gm-form span {
  color: var(--gm-muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
}

.gm-card strong {
  font-size: 17px;
  font-weight: 700;
}

.gm-link-button,
.gm-soft-button,
.gm-danger,
.gm-primary {
  min-height: 40px;
  border: 0;
  border-radius: 14px;
  padding: 10px 12px;
  text-align: left;
  font-weight: 650;
}

.gm-link-button,
.gm-soft-button {
  color: var(--gm-ink);
  background: #f2f7fb;
}

.gm-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--gm-primary), #20c7d8);
  text-align: center;
}

.gm-danger {
  color: #fff;
  background: linear-gradient(135deg, var(--gm-danger), #ff8a3d);
}

.gm-center {
  display: grid;
  min-width: 0;
}

.gm-panel {
  display: none;
  min-height: 100%;
  padding: clamp(16px, 2.2vw, 24px);
  overflow: auto;
  scrollbar-width: none;
}

.gm-panel.active {
  display: block;
}

.gm-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.gm-panel-head h2,
.gm-hero h1 {
  margin: 0;
  color: var(--gm-ink);
  font-size: clamp(22px, 2.4vw, 34px);
  font-weight: 760;
  letter-spacing: -0.03em;
}

.gm-panel-head small,
.gm-hero small {
  display: block;
  margin-bottom: 7px;
  color: var(--gm-primary);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gm-hero {
  min-height: 250px;
  display: grid;
  align-items: end;
  padding: clamp(22px, 5vw, 44px);
  border-radius: calc(var(--gm-radius) + 8px);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(7, 21, 39, 0.82), rgba(7, 21, 39, 0.18)),
    var(--gm-hero-image) center / cover no-repeat;
  color: #fff;
}

.gm-hero h1,
.gm-hero p,
.gm-hero small {
  color: #fff;
}

.gm-hero p {
  max-width: 740px;
  margin: 10px 0 0;
}

.gm-grid,
.gm-module-list,
.gm-split {
  display: grid;
  gap: 12px;
}

.gm-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
}

.gm-grid article,
.gm-module-list article {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--gm-line);
  border-radius: 18px;
  background: linear-gradient(145deg, #fff, rgba(244, 248, 251, 0.88));
}

.gm-grid article span {
  color: var(--gm-accent);
  font-weight: 800;
}

.gm-grid article b,
.gm-module-list b {
  color: var(--gm-ink);
  font-size: 15px;
  font-weight: 760;
  line-height: 1.2;
}

.gm-module-list article {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.gm-module-list article > div:first-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.gm-module-list small,
.gm-meta-line {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gm-meta-line {
  font-size: 10px;
  text-transform: uppercase;
}

.gm-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 7px;
}

.gm-badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(49, 202, 117, 0.3);
  border-radius: 999px;
  padding: 6px 9px;
  color: #133223;
  background: rgba(49, 202, 117, 0.14);
  font-size: 10px;
  font-weight: 650;
}

.gm-badge.limited {
  color: #5b3300;
  border-color: rgba(255, 184, 77, 0.42);
  background: rgba(255, 184, 77, 0.16);
}

.gm-badge.legacy {
  color: #475569;
  border-color: rgba(148, 163, 184, 0.38);
  background: rgba(148, 163, 184, 0.16);
}

.gm-badge.broken {
  color: #7f1d1d;
  border-color: rgba(239, 68, 68, 0.36);
  background: rgba(239, 68, 68, 0.14);
}

.gm-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.gm-config {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(20, 136, 255, 0.18);
  border-radius: 999px;
  color: var(--gm-primary);
  background: #fff;
}

.gm-integration-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.88fr);
  gap: 12px;
}

.gm-integration-list {
  align-content: start;
}

.gm-config-panel {
  position: sticky;
  top: 0;
  align-self: start;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius);
  background: #fff;
}

.gm-config-panel h3 {
  margin: 0;
  font-size: 20px;
}

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

.gm-kv {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 12px;
  background: #f4f8fb;
}

.gm-kv small {
  color: var(--gm-muted);
  font-size: 10px;
  text-transform: uppercase;
}

.gm-kv b {
  font-size: 12px;
  overflow-wrap: anywhere;
}

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

.gm-preview-shell {
  min-height: 360px;
  overflow: hidden;
}

.gm-preview-shell iframe {
  width: 100%;
  height: 520px;
  border: 0;
  background: #fff;
}

.gm-preview-empty {
  min-height: 360px;
  display: grid;
  place-items: center;
  color: var(--gm-muted);
}

.gm-live-log {
  display: grid;
  gap: 7px;
  max-height: 180px;
  overflow: auto;
}

.gm-live-log article,
.gm-crm-log article {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 12px;
  background: #f4f8fb;
}

.gm-live-log code,
.gm-crm-log code {
  color: var(--gm-primary);
  font-size: 11px;
}

.gm-split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.gm-form label {
  display: grid;
  gap: 6px;
}

.gm-form input,
.gm-form select,
.gm-form textarea {
  width: 100%;
  border: 1px solid var(--gm-line);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--gm-ink);
  background: #fff;
}

.gm-form textarea {
  resize: vertical;
}

.gm-form input[type="color"] {
  height: 44px;
  padding: 4px;
}

.gm-meta-console {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(20, 136, 255, 0.14);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(20, 136, 255, 0.06), rgba(49, 202, 117, 0.05));
}

.gm-meta-console h4 {
  margin: 0;
  font-size: 15px;
}

.gm-meta-api-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gm-meta-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.gm-meta-form label {
  min-width: 0;
}

.gm-meta-result,
.gm-code {
  width: 100%;
  max-height: 260px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--gm-line);
  border-radius: 14px;
  color: #123;
  background: #f8fbff;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .gm-workspace,
  .gm-integration-layout {
    grid-template-columns: 1fr;
  }

  .gm-right {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .gm-app { padding: 10px; }
  .gm-header { grid-template-columns: 1fr auto; }
  .gm-tabs { grid-column: 1 / -1; }
  .gm-grid,
  .gm-split,
  .gm-form,
  .gm-right,
  .gm-config-grid,
  .gm-action-grid,
  .gm-meta-api-grid,
  .gm-meta-form {
    grid-template-columns: 1fr;
  }
}
