/* ============================================================
   Base
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #e4e5e5;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "Poppins", sans-serif;
}

#app {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  width: 100%;
}

/* Screen visibility */
.screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.hidden {
  display: none !important;
}

/* ============================================================
   Card
   ============================================================ */
.card {
  display: flex;
  flex-direction: column;
  background-color: #fff;
  padding: 20px;
  border-radius: 10px;
  width: 300px;
  max-width: 300px;
  overflow-wrap: break-word;
  text-align: center;
}

/* ============================================================
   Button
   ============================================================ */
.btn {
  padding: 14px;
  border-radius: 30px;
  border: 0;
  background-color: #6922ff;
  color: #f8f8f9;
  font-family: "Poppins", sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: background-color 0.15s;
}

.btn:hover:not(:disabled) {
  background-color: #601fe6;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

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

/* ============================================================
   Inputs
   ============================================================ */
input[type="number"] {
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input {
  border-top: #fff;
  border-left: #fff;
  border-right: #fff;
  border-bottom: 1px solid #a8aaab;
  font-family: "Poppins", sans-serif;
  font-size: 12px;
  text-align: center;
  width: 100%;
  background: transparent;
  outline: none;
  padding: 6px 0;
}

input:focus {
  outline: none !important;
  border-bottom-color: #6922ff;
}

/* Currency label positioned to the right of the amount input */
i {
  position: absolute;
  right: 0;
  padding: 6px 0;
  pointer-events: none;
  font-style: normal;
  font-size: 12px;
  color: #637481;
}

/* ============================================================
   Loading spinner
   ============================================================ */
.loader,
.loader::before,
.loader::after {
  background: #6922ff;
  animation: load1 1s ease-in-out infinite;
  width: 1em;
  height: 4em;
}

.loader {
  color: #6922ff;
  text-indent: -9999em;
  margin: 88px auto;
  position: relative;
  font-size: 11px;
  transform: translateZ(0);
  animation-delay: -0.16s;
}

.loader::before,
.loader::after {
  position: absolute;
  top: 0;
  content: "";
}

.loader::before {
  left: -1.5em;
  animation-delay: -0.32s;
}

.loader::after {
  left: 1.5em;
}

@keyframes load1 {
  0%,
  80%,
  100% {
    box-shadow: 0 0;
    height: 4em;
  }
  40% {
    box-shadow: 0 -2em;
    height: 5em;
  }
}

/* ============================================================
   Back button
   ============================================================ */
.back-button {
  background-color: #e4e5e5;
  color: #637481;
  padding: 4px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  border: none;
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  margin-bottom: 12px;
  border-radius: 10px;
  align-self: flex-start;
  transition: background-color 0.15s;
}

.back-button:hover {
  background-color: #fff;
}

.back-button-arrow {
  font-size: 22px;
}

.back-button-text {
  font-size: 16px;
}

/* ============================================================
   Progress bar
   ============================================================ */
.progress-bar {
  width: 100%;
  height: 4px;
  border-radius: 20px;
  background: #e4e5e5;
}

.progress-bar-inner {
  height: 100%;
  background-color: #6922ff;
  border-radius: 20px;
  transition: width 1s linear;
}

/* ============================================================
   Amount chips
   ============================================================ */
.amount-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.chip {
  padding: 10px 0;
  border-radius: 30px;
  border: 2px solid #e4e5e5;
  background-color: #fff;
  color: #1a1a1a;
  font-family: "Poppins", sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  width: calc(33.333% - 7px);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.chip:hover {
  border-color: #6922ff;
  color: #6922ff;
}

.chip.selected {
  background-color: #6922ff;
  border-color: #6922ff;
  color: #fff;
}

/* ============================================================
   Form — lightning input section
   ============================================================ */
.lightning-header {
  text-align: center;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.lightning-input-fields {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-bottom: 40px;
}

.profile-pic {
  border-radius: 100px;
  margin-bottom: 10px;
  object-fit: cover;
  background: #e4e5e5;
}

.form-username {
  font-weight: 900;
  font-size: 12px;
}

.tip-greeting {
  margin-top: 20px;
  font-weight: 700;
  font-size: 16px;
}

#amount-input {
  font-size: 30px;
  font-weight: 700;
  padding-right: 35px;
}

.amount-container {
  position: relative;
}

/* ============================================================
   QR code container
   ============================================================ */
.lightning-qr-container {
  padding: 0;
  display: flex;
  flex-direction: column;
  background-color: #fff;
  border-radius: 10px;
  width: 300px;
  max-width: 300px;
  overflow-wrap: break-word;
  text-align: center;
}

.lightning-qr-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Connection status row */
.connection-indicator-container {
  font-size: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  cursor: pointer;
  user-select: none;
}

.connection-indicator {
  height: 10px;
  width: 10px;
  border-radius: 100px;
  flex-shrink: 0;
}

.connection-indicator.connected    { background-color: #1cd787; }
.connection-indicator.disconnected { background-color: #ff6b6b; }

.lightning-qr-amount {
  font-size: 24px;
  font-weight: 500;
}

.lightning-qr-memo {
  font-size: 14px;
  font-weight: 500;
  font-style: italic;
  min-height: 1.2em;
}

/* QR code wrapper with overlay profile pic */
.qr-outer {
  position: relative;
  display: inline-block;
  align-self: center;
}

/* qrcodejs renders a canvas or img — ensure it shows as block */
#qr-code canvas,
#qr-code img {
  display: block;
  border-radius: 4px;
}

.qr-user-profile {
  border: 2px solid #fff;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 100px;
  object-fit: cover;
  background: #fff;
}

.lightning-qr-user-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lightning-qr-username {
  font-weight: 700;
}

.lightning-qr-tip-greeting {
  font-size: 14px;
}

/* ============================================================
   Success screen
   ============================================================ */
.success-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: center;
}

.success-amount {
  font-size: 24px;
  font-weight: 500;
}

.success-memo {
  margin-top: 6px;
}

.checkmark {
  width: 100px;
  height: 100px;
  border-radius: 100px;
  background-color: #1bd787;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 70px;
  color: #fff;
}

.success-transaction-id-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-radius: 10px;
  background-color: #f0f0f0;
  padding: 10px;
  text-align: left;
  width: 80%;
}

.success-transaction-id-title {
  font-weight: 700;
  font-size: 14px;
}

.success-transaction-id-subtitle {
  font-size: 12px;
  word-break: break-all;
  color: #637481;
}

/* ============================================================
   Expired screen
   ============================================================ */
.expired-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: center;
}

.expired-amount {
  font-size: 30px;
  font-weight: 500;
}

.expired-memo {
  margin-top: 6px;
}

.expired-text-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.expired-text-title {
  font-size: 24px;
  font-weight: 700;
}

.expired-text-subtitle {
  font-size: 14px;
  color: #637481;
}

/* ============================================================
   Dashboard
   ============================================================ */

.dashboard-wrapper {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: #1a1a1a;
}

.dashboard-balance {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #637481;
}

.btn-link {
  background: none;
  border: none;
  color: #6922ff;
  font-family: "Poppins", sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.btn-link:hover {
  color: #601fe6;
}

/* Override card width for the dashboard layout */
.dashboard-card {
  width: 100%;
  max-width: 100%;
  text-align: left;
}

.card-section-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 16px;
  color: #1a1a1a;
}

/* ============================================================
   Dashboard form fields
   ============================================================ */

.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.field-label {
  font-size: 12px;
  font-weight: 500;
  color: #637481;
}

.field-error {
  font-size: 12px;
  color: #e53e3e;
  margin-top: 2px;
}

/* ============================================================
   Bills table
   ============================================================ */

.bills-state-msg {
  font-size: 13px;
  color: #637481;
  text-align: center;
  padding: 16px 0;
}

.bills-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.bills-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #637481;
  padding: 4px 8px 10px;
  border-bottom: 2px solid #e4e5e5;
}

.bills-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #f0f0f0;
  color: #1a1a1a;
}

.bills-table tr:last-child td {
  border-bottom: none;
}

/* ============================================================
   Status badges
   ============================================================ */

.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: #e4e5e5;
  color: #637481;
}

.status-badge.status-paid {
  background: #e8faf3;
  color: #0da35c;
}

.status-badge.status-pending {
  background: #fff7e6;
  color: #d97706;
}

.status-badge.status-pending_payment {
  background: #fef3f3;
  color: #dc2626;
}
