:root {
  --color-bg:           #FFFFFF;
  --color-bg-page:      #F1F1F4;
  --color-bg-alt:       #F5F5F7;
  --color-text:         #1A1A1A;
  --color-text-muted:   #6E6E73;
  --color-border:       #E0E0E5;
  --color-accent:       #C0C0C8;
  --color-black:        #0A0A0A;
  --color-red:          #D0021B;
  --color-success:      #1A7F37;
  --color-warning-text: #854D0E;
  --color-warning-bg:   #FEF9C3;
  --font:               'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius:             20px;
  --radius-sm:          12px;
  --shadow:             0 8px 40px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
  --transition:         0.2s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--color-bg-page);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

/* ---- Layout ---- */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  justify-content: space-between;
}

.page-header {
  padding: 24px 32px;
}

.logo {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.page-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.page-footer {
  padding: 20px 32px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ---- Payment Card ---- */
.payment-card {
  max-width: 460px;
  width: 100%;
  margin: 0 auto;
  padding: 44px 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--color-bg);
  border: 1px solid rgba(0,0,0,0.05);
  animation: fadeInUp 0.4s ease;
}

/* ---- Card Header ---- */
.card-header {
  text-align: center;
  margin-bottom: 28px;
}

.card-header svg {
  display: block;
  margin: 0 auto 14px;
  color: var(--color-text-muted);
  opacity: 0.6;
}

.card-header h1 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.card-header p {
  font-size: 14px;
  color: var(--color-text-muted);
}

/* ---- Secure note ---- */
.secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #16a34a;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 100px;
  padding: 7px 16px;
  margin-bottom: 24px;
}

/* ---- Amount input ---- */
.amount-wrapper {
  position: relative;
  margin-bottom: 12px;
}

.currency-symbol {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 28px;
  color: var(--color-text-muted);
  pointer-events: none;
  line-height: 1;
}

.input-amount {
  width: 100%;
  height: 68px;
  font-size: 36px;
  font-weight: 500;
  font-family: var(--font);
  text-align: center;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--color-bg-alt);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  padding-right: 52px;
}
.input-amount::placeholder {
  font-size: 28px;
}
.input-amount:focus {
  border-color: var(--color-black);
  background: var(--color-bg);
  box-shadow: 0 0 0 3px rgba(10,10,10,0.06);
}

/* Remove spin buttons */
.input-amount::-webkit-outer-spin-button,
.input-amount::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.input-amount[type=number] {
  -moz-appearance: textfield;
}

/* ---- Error message ---- */
.error-msg {
  color: var(--color-red);
  font-size: 13px;
  text-align: center;
  margin-bottom: 12px;
  display: none;
  animation: fadeIn 0.2s ease;
}

.error-msg.visible {
  display: block;
}

/* ---- Bank logos ---- */
.bank-logos {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
  margin-top: 16px;
}
.bank-logo_{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 30px;
}
.bank-logo_ img{
  max-width: 100%
}

.bank-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

.bank-caption {
  text-align: center;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

/* ---- Pay button ---- */
.btn-pay {
  width: 100%;
  height: 54px;
  background: var(--color-black);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  position: relative;
}

.btn-pay:hover {
  opacity: 0.88;
}

.btn-pay:active {
  transform: scale(0.99);
}

.btn-pay:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-pay.loading {
  color: transparent;
}

.btn-pay.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ---- Status badges ---- */
.status-badge {
  display: inline-block;
  border-radius: 100px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
}

.status-NEW      { background: #F0F0F0; color: #555; }
.status-PAID     { background: #DCFCE7; color: #166534; }
.status-EXPIRED  { background: #FEF9C3; color: #854D0E; }
.status-ERROR,
.status-CANCELLED { background: #FEE2E2; color: #991B1B; }

/* ---- Success page ---- */
.success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  width: 72px;
  height: 72px;
}

.success-icon svg .check-path {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: drawCheck 0.5s ease forwards 0.2s;
}

/* ---- Fail page ---- */
.fail-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  width: 72px;
  height: 72px;
}

/* ---- Success/Fail page content ---- */
.result-card {
  text-align: center;
}

.result-card h1 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 16px;
}

.result-card h1.success-title { color: var(--color-success); }
.result-card h1.fail-title    { color: var(--color-red); }

.fail-reason {
  color: var(--color-text-muted);
  margin-bottom: 20px;
  font-size: 15px;
}

.payment-details {
  text-align: left;
  background: var(--color-bg-alt);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 24px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  color: var(--color-text-muted);
}

.detail-value {
  font-weight: 500;
}

/* ---- Animations ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .payment-card {
    padding: 28px 20px;
    border-radius: 16px;
    box-shadow: none;
    border: none;
  }

  .input-amount {
    font-size: 24px;
  }

  .page-header {
    padding: 16px 20px;
  }
}
