:root {
  --primary: #0070f3;
  --success: #0070f3;
  --error: #ff4d4f;
  --background: #ffffff;
  --foreground: #000000;
  --card: #ffffff;
  --card-foreground: #000000;
  --border: #e2e8f0;
  --input: #f1f5f9;
  --ring: #0070f3;
  --radius: 0.5rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

body {
  background-color: #f9fafb;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 1rem;
}

.container {
  max-width: 450px;
  width: 100%;
}

.card {
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  padding: 2rem;
  transition: all 0.2s ease;
}

.card-header {
  margin-bottom: 1.5rem;
}

.card-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--card-foreground);
  margin-bottom: 0.5rem;
}

.card-header p {
  color: #64748b;
  font-size: 0.875rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.payment-summary-block {
  margin-bottom: 0.35rem;
}

.payment-summary-row {
  color: var(--card-foreground);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.2rem;
}

.payment-summary-row:last-child {
  margin-bottom: 0;
}

.payment-summary-label {
  margin-right: 0.35rem;
}

.payment-summary-value {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.payment-reference {
  color: #64748b;
  font-size: 0.875rem;
  margin-top: 0.15rem;
}

.wrap-id {
  overflow-wrap: anywhere;
  word-break: break-all;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--card-foreground);
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px rgba(0, 112, 243, 0.2);
}

.form-input.error {
  border-color: var(--error);
}

.input-error {
  color: var(--error);
  font-size: 0.75rem;
  margin-top: 0.25rem;
  display: none;
}

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

.input-row {
  display: flex;
  gap: 1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.75rem 1.5rem;
  background-color: var(--primary);
  color: white;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.payment-page .button {
  color: var(--card-foreground);
}

.button:hover {
  background-color: #005ae6;
}

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

.button .spinner {
  margin-right: 0.5rem;
  animation: spin 1s linear infinite;
  display: none;
}

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

.button.loading .spinner {
  display: inline-block;
}

.result {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  display: none;
  animation: fadeIn 0.3s ease;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.result.success {
  background-color: rgba(0, 112, 243, 0.1);
  color: var(--success);
  border: 1px solid rgba(0, 112, 243, 0.2);
  display: flex;
  align-items: center;
}

.result.error {
  background-color: rgba(255, 77, 79, 0.1);
  color: var(--error);
  border: 1px solid rgba(255, 77, 79, 0.2);
  display: flex;
  align-items: center;
}

.result-icon {
  margin-right: 0.5rem;
  display: inline-flex;
  flex-shrink: 0;
}

#result-message {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.generated-link {
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: #f8fafc;
  display: none;
}

.generated-link.show {
  display: block;
}

.generated-link-label {
  color: #334155;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.generated-link-url {
  font-size: 0.85rem;
  color: var(--primary);
  text-decoration: none;
  word-break: break-all;
}

.generated-link-url:hover {
  text-decoration: underline;
}

.generated-reference {
  color: #334155;
  font-size: 0.8rem;
  margin-top: 0.5rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes checkmark {
  0% {
    stroke-dashoffset: 100;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.checkmark {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: checkmark 0.6s ease-in-out forwards;
}

@media (max-width: 640px) {
  .card {
    padding: 1.5rem;
  }

  .input-row {
    flex-direction: column;
    gap: 1.25rem;
  }
}

/* Receipt Popup Styles */
.receipt-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.receipt-popup.show {
  opacity: 1;
  visibility: visible;
}

.receipt-content {
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.receipt-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.receipt-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--card-foreground);
  margin: 0;
}

.close-button {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.close-button:hover {
  color: var(--card-foreground);
}

.receipt-body {
  padding: 1.5rem;
}

.receipt-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.5rem;
  color: var(--success);
}

.receipt-icon {
  margin-bottom: 0.75rem;
}

.receipt-checkmark {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: checkmark 0.6s ease-in-out forwards 0.2s;
}

.receipt-message {
  font-size: 1.125rem;
  font-weight: 600;
}

.receipt-persist-note {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #64748b;
  text-align: center;
}

.receipt-details {
  background-color: var(--input);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}

.receipt-row:last-child {
  margin-bottom: 0;
}

.receipt-label {
  color: #64748b;
  font-weight: 500;
}

.receipt-value {
  font-weight: 500;
  color: var(--card-foreground);
  text-align: right;
  word-break: break-word;
}

.receipt-footer {
  display: flex;
  justify-content: center;
}

.receipt-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background-color: var(--primary);
  color: white;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.receipt-button:hover {
  background-color: #005ae6;
}

@media print {
  body * {
    visibility: hidden;
  }

  .receipt-content, .receipt-content * {
    visibility: visible;
  }

  .receipt-content {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    box-shadow: none;
  }

  .close-button, .receipt-footer {
    display: none;
  }
}

@media (max-width: 640px) {
  .receipt-content {
    max-width: 90%;
  }

  .receipt-row {
    flex-direction: column;
    margin-bottom: 1rem;
  }

  .receipt-value {
    text-align: left;
    margin-top: 0.25rem;
  }
}
