@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800;900&display=swap');

:root {
  --primary: #237fc7;          /* Logo Royal Blue */
  --primary-hover: #1a639c;    /* Darker Blue */
  --primary-soft: #e8f2fa;     /* Light Sky Blue */
  --primary-soft-border: rgba(35, 127, 199, 0.15);
  --accent-cyan: #2ae5ff;      /* Electric Cyan from Logo */
  --accent-mint: #76f8d4;      /* Logo Mint/Teal */
  --dark-navy: #121828;        /* Logo Dark Slate */
  --ink: #1f2937;              /* Dark text */
  --muted: #6b7280;            /* Muted text */
  --paper: #f4f8fb;            /* Soft light background */
  --card: #ffffff;             /* Card background */
  --line: #e5e7eb;             /* Divider lines */
  --blue-glow: rgba(35, 127, 199, 0.06);
  --green: #10b981;            /* Success Green */
  --green-soft: #ecfdf5;
  --red: #ef4444;              /* Error Red */
  --red-soft: #fef2f2;
  --yellow: #f59e0b;           /* Warning Yellow */
  --yellow-soft: #fffbeb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(18, 24, 40, 0.05), 0 2px 4px -1px rgba(18, 24, 40, 0.02);
  --shadow-lg: 0 8px 16px -3px rgba(18, 24, 40, 0.08), 0 4px 6px -2px rgba(18, 24, 40, 0.03);
  --shadow-xl: 0 16px 24px -5px rgba(18, 24, 40, 0.1), 0 8px 8px -5px rgba(18, 24, 40, 0.03);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  color-scheme: light;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--paper); scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: inherit; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 5% 5%, rgba(42, 229, 255, 0.05), transparent 20%),
    radial-gradient(circle at 95% 95%, rgba(35, 127, 199, 0.04), transparent 25%),
    radial-gradient(circle at 50% 50%, rgba(244, 248, 251, 1), rgba(232, 242, 250, 0.8));
}

.site-header {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(35, 127, 199, 0.08);
  flex: 0 0 auto;
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-size: 17px;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.03em;
  color: var(--dark-navy);
}

.brand-logo {
  height: 30px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--primary);
  border-radius: 9px;
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 16px;
}

.environment-badge, .currency-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, .8);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.checkout-layout {
  width: min(1180px, calc(100% - 32px));
  margin: 14px auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(460px, 1.15fr);
  gap: clamp(20px, 4vw, 50px);
  align-items: center;
  flex: 1 0 auto;
}

.intro-panel { max-width: 480px; text-align: left; }
.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1, h2, h3, h4 {
  font-family: 'Outfit', sans-serif;
  color: var(--dark-navy);
  letter-spacing: -.03em;
  text-wrap: balance;
}

.intro-panel h1 {
  margin: 0;
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -.035em;
}

.intro-copy {
  max-width: 450px;
  margin: 12px 0 16px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

.trust-list { display: grid; gap: 10px; }
.trust-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.4);
  transition: all 0.2s ease;
}
.trust-item:hover {
  border-color: var(--primary-soft-border);
  background: rgba(255, 255, 255, 0.85);
  transform: translateY(-1px);
}
.trust-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--primary);
  background: var(--primary-soft);
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 700;
}
.trust-item strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--dark-navy);
  margin-bottom: 2px;
}
.trust-item div span {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}

.payment-card, .result-card, .admin-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(226, 232, 240, 0.7);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.payment-card { padding: 20px 24px; }
.card-heading {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.card-heading h2 {
  margin: 0;
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.2;
  font-weight: 700;
}
.currency-chip { color: var(--primary); border-color: var(--primary-soft-border); background: var(--primary-soft); }

.field {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  text-align: left;
}
.field > span:first-child {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--dark-navy);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.field em {
  color: var(--muted);
  font-style: normal;
  font-weight: 400;
  font-size: 11px;
}
.field input, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  outline: none;
  color: var(--ink);
  background: #ffffff;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input {
  height: 40px;
  padding: 0 12px;
}
.field textarea {
  min-height: 64px;
  padding: 10px 12px;
  resize: vertical;
}
.field input:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--blue-glow);
  background: #ffffff;
}
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] {
  border-color: var(--red);
  background: var(--red-soft);
}
.field small {
  min-height: 14px;
  color: var(--muted);
  font-size: 11px;
  margin-top: 1px;
}
.field-error {
  color: var(--red) !important;
  font-weight: 500;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.amount-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.amount-prefix {
  position: absolute;
  left: 14px;
  z-index: 1;
  color: var(--muted);
  font-size: 17px;
  font-weight: 700;
  pointer-events: none;
  font-family: 'Outfit', sans-serif;
}
.amount-field input {
  height: 54px;
  padding-left: 48px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--primary);
  font-family: 'Outfit', sans-serif;
}
.amount-field input:focus {
  color: var(--primary-hover);
}

.primary-button, .secondary-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-md);
  border: 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 14.5px;
  text-decoration: none;
  transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
}
.primary-button {
  width: 100%;
  padding: 0 20px;
  color: white;
  background: linear-gradient(135deg, var(--primary), #48b2ec);
  box-shadow: 0 3px 8px rgba(35, 127, 199, 0.2);
}
.primary-button:hover {
  background: linear-gradient(135deg, var(--primary-hover), var(--primary));
  box-shadow: 0 5px 12px rgba(35, 127, 199, 0.3);
  transform: translateY(-1px);
}
.primary-button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(35, 127, 199, 0.2);
}
.primary-button:disabled {
  opacity: .65;
  cursor: wait;
  transform: none;
  box-shadow: none;
}
.primary-button.compact {
  width: auto;
  min-width: 160px;
}
.secondary-button {
  padding: 0 20px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}
.secondary-button:hover {
  background: var(--paper);
  border-color: var(--muted);
  color: var(--dark-navy);
  transform: translateY(-1px);
}
.secondary-button:active {
  transform: translateY(1px);
}
.payment-actions {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 10px;
  margin-top: 6px;
}

.primary-button.is-loading, .secondary-button.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.primary-button.is-loading::after, .secondary-button.is-loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
.primary-button.is-loading::after {
  color: #ffffff;
}
.secondary-button.is-loading::after {
  color: var(--primary);
}

.generated-link {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--primary-soft-border);
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  text-align: left;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.generated-link[hidden] { display: none; }
.generated-link .eyebrow {
  margin-bottom: 4px;
  color: var(--primary);
}
.generated-link strong {
  font-size: 14px;
  color: var(--dark-navy);
  font-family: 'Outfit', sans-serif;
}
.link-copy-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  margin: 10px 0 8px;
}
.link-copy-row input {
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: #ffffff;
  font-size: 12px;
  outline: none;
}
.link-copy-row input:focus {
  border-color: var(--primary);
}
.copy-button {
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-sm);
  color: white;
  background: var(--primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.2s;
}
.copy-button:hover {
  background: var(--primary-hover);
}
.text-link {
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}
.text-link:hover {
  color: var(--primary-hover);
}

.gateway-note {
  margin: 12px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.lock-icon {
  width: 9px;
  height: 8px;
  display: inline-block;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  position: relative;
}
.lock-icon::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  left: 0px;
  top: -5px;
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
}
.form-message {
  min-height: 14px;
  margin: -4px 0 10px;
  font-size: 12px;
}
.form-message.is-error {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #b91c1c;
  background: var(--red-soft);
  border: 1px solid rgba(239, 68, 68, 0.15);
  font-weight: 500;
  text-align: left;
}

footer {
  width: min(1180px, calc(100% - 32px));
  margin: 16px auto 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  flex: 0 0 auto;
  margin-top: auto;
}
footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
footer a:hover {
  text-decoration: underline;
}

.result-page { min-height: 100vh; display: flex; flex-direction: column; }
.result-shell {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px 16px 40px;
}
.result-card {
  width: min(520px, 100%);
  padding: 24px 30px;
  text-align: center;
}
.result-card h1 {
  margin: 0 auto 12px;
  max-width: 440px;
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 800;
  line-height: 1.15;
}
.result-copy {
  max-width: 420px;
  margin: 0 auto 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.status-symbol {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
}
.status-symbol::after {
  font-size: 26px;
  font-weight: 700;
}
.status-symbol.is-success {
  color: var(--green);
  background: var(--green-soft);
  border: 2px solid rgba(16, 185, 129, 0.2);
  animation: scaleUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.status-symbol.is-success::after {
  content: "✓";
}
.status-symbol.is-failed {
  color: var(--red);
  background: var(--red-soft);
  border: 2px solid rgba(239, 68, 68, 0.2);
  animation: shake 0.5s ease-in-out;
}
.status-symbol.is-failed::after {
  content: "×";
}
.status-symbol.is-pending {
  color: var(--yellow);
  background: var(--yellow-soft);
  border: 2px solid rgba(245, 158, 11, 0.2);
}
.status-symbol.is-pending::after {
  content: "…";
}
.status-symbol.is-loading {
  border: 3px solid var(--line);
  border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}

@keyframes scaleUp {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.receipt {
  margin: 20px 0;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  text-align: left;
}
.receipt div {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--line);
}
.receipt div:last-child {
  border-bottom: 0;
}
.receipt dt {
  color: var(--muted);
  font-size: 12.5px;
}
.receipt dd {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--dark-navy);
  text-align: right;
  overflow-wrap: anywhere;
}
.result-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 40px;
}
.admin-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 24px;
}
.admin-heading h1 {
  margin: 0;
  font-size: clamp(28px, 3.5vw, 38px);
  font-weight: 800;
  line-height: 1.1;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.summary-card {
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  text-align: left;
}
.summary-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-soft-border);
}
.summary-card span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.summary-card strong {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
}
.admin-card {
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
th {
  color: var(--muted);
  background: var(--paper);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
td {
  font-size: 13px;
  color: var(--ink);
}
tbody tr {
  transition: background 0.15s;
}
tbody tr:hover {
  background: var(--primary-soft);
}
tbody tr:last-child td {
  border-bottom: 0;
}
.status-pill {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .01em;
  text-transform: capitalize;
}
.status-pill.confirmed {
  color: var(--green);
  background: var(--green-soft);
}
.status-pill.pending {
  color: var(--yellow);
  background: var(--yellow-soft);
}
.status-pill.failed {
  color: var(--red);
  background: var(--red-soft);
}
.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 900px) {
  .checkout-layout {
    margin-top: 14px;
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .intro-panel {
    max-width: 100%;
  }
  .trust-list {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  .trust-item {
    align-items: center;
    flex-direction: column;
    text-align: center;
    padding: 12px 10px;
  }
  .trust-item div span {
    display: none;
  }
}

@media (max-width: 640px) {
  .site-header, .checkout-layout, footer, .admin-shell {
    width: min(100% - 24px, 1180px);
  }
  .site-header {
    min-height: 48px;
  }
  .checkout-layout {
    margin: 8px auto 24px;
  }
  .intro-panel h1 {
    font-size: 26px;
  }
  .trust-list {
    grid-template-columns: 1fr;
  }
  .trust-item {
    flex-direction: row;
    text-align: left;
    align-items: flex-start;
  }
  .trust-item div span {
    display: block;
  }
  .payment-card {
    border-radius: var(--radius-lg);
    padding: 16px 18px;
  }
  .card-heading {
    margin-bottom: 16px;
  }
  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .payment-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .summary-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .admin-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
