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

html, body {
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

body {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  width: 100%;
}

@media (max-width: 767px) {
  .container {
    padding: 10px;
  }
  
  h1 {
    font-size: 20px;
    margin-bottom: 15px;
  }

  .search-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .search-label {
    margin-bottom: 4px;
  }

  .search-input {
    width: 70%;
    margin-bottom: 0;
  }

  .search-container button, .search-container .btn {
    width: 25%;
    margin-left: 0;
    margin-top: 0;
    font-size: 14px;
    padding: 12px 0;
  }

  .bank-list {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .bank-card {
    padding: 15px;
  }

  .bank-logo {
    max-width: 80px;
    max-height: 50px;
  }

  .bank-card h3 {
    font-size: 16px;
  }

  .bank-card p {
    font-size: 13px;
  }

  .btn {
    padding: 8px 16px;
    font-size: 14px;
    margin: 0 0px;
  }

  #payment-form {
    padding: 20px;
  }

  .payment-btn, .connect-btn {
    padding: 12px;
    font-size: 14px;
  }

  .confirmation-details {
    padding: 20px;
  }

  .detail-item {
    flex-direction: column;
    gap: 5px;
  }

  .detail-label, .detail-value {
    width: 100%;
  }

  .order-summary, .payment-section {
    padding: 15px;
  }

  .summary-item {
    padding: 10px 0;
  }

  .summary-item input[type="text"],
  .summary-item select {
    padding: 8px;
    font-size: 14px;
  }

  .account-card {
    min-width: 150px;
    padding: 15px 10px;
  }

  .account-icon {
    font-size: 2rem;
  }

  .account-title {
    font-size: 1rem;
  }

  .account-subtitle {
    font-size: 0.85rem;
  }

  .account-select-btn, .account-connect-btn {
    padding: 6px 12px;
    font-size: 0.9rem;
  }

  .pay-instructions {
    font-size: 1.5rem;
    margin-bottom: 24px;
  }

  .pay-total-box {
    padding: 16px 20px;
    font-size: 1.5rem;
  }

  .pay-total-label {
    font-size: 1.2rem;
  }

  .pay-total-value {
    font-size: 1.5rem;
  }

  .bank-list-title {
    font-size: 1.2rem;
  }

  .bank-list-subtitle {
    font-size: 1rem;
  }

  .bank-list-input {
    padding: 12px;
    font-size: 1rem;
  }

  .bank-list-item {
    padding: 12px 15px;
    font-size: 1.1rem;
  }

  .bank-list-logo {
    width: 36px;
    height: 36px;
  }

  .bank-list-name {
    font-size: 1rem;
  }

  .autorizar-btn, .pay-btn {
    padding: 16px 0;
    font-size: 1.2rem;
    margin-top: 24px;
  }

  .lightbox-content {
    padding: 20px;
    width: 95%;
  }

  .progress-spinner {
    width: 40px;
    height: 40px;
  }

  .lightbox-message {
    font-size: 1rem;
  }
}

/* Additional improvements for very small screens */
@media (max-width: 480px) {
  .container {
    padding: 8px;
  }

  .bank-list {
    gap: 10px;
  }

  .account-card {
    min-width: 130px;
  }

  .pay-instructions {
    font-size: 1.3rem;
  }

  .pay-total-box {
    padding: 12px 16px;
    font-size: 1.3rem;
  }

  .autorizar-btn, .pay-btn {
    padding: 14px 0;
    font-size: 1.1rem;
  }
}

h1 {
  text-align: center;
  margin-bottom: 30px;
  color: #2c3e50;
}

/* Search Styles */
.search-container {
  margin-bottom: 30px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.search-label {
  display: block;
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
  color: #2c3e50;
}

.search-input {
  width: 70%;
  padding: 15px;
  font-size: 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background-color: white;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 8px rgba(52, 152, 219, 0.5);
}

.search-input::placeholder {
  color: #95a5a6;
}

/* Bank List Styles */
.bank-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.bank-item a {
  text-decoration: none;
  color: inherit;
}

.bank-card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bank-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.bank-logo {
  max-width: 100px;
  max-height: 60px;
  margin-bottom: 15px;
}

.bank-card h3 {
  margin-bottom: 10px;
  color: #2c3e50;
  text-align: center;
}

.bank-card p {
  color: #7f8c8d;
  font-size: 14px;
  text-align: center;
}

/* Button Styles */
.actions {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
  cursor: pointer;
  margin: 0 10px;
}

.btn-primary {
  background-color: #3498db;
  color: white;
}

.btn-primary:hover {
  background-color: #2980b9;
}

.btn-secondary {
  background-color: #95a5a6;
  color: white;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

/* Error Page Styles */
.error-container {
  text-align: center;
  padding: 50px 20px;
}

.error-message {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 30px;
  margin: 30px auto;
  max-width: 600px;
}

.error-message p {
  color: #e74c3c;
  font-size: 18px;
}

/* Payment Form Styles */
#payment-form {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 30px;
  margin: 0 auto;
  max-width: 600px;
}

#payment-form h2 {
  margin-top: 30px;
  margin-bottom: 20px;
  color: #2c3e50;
}

.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
  width: 100%;
}

.payment-btn, .connect-btn {
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  width: 100%;
}

@media (max-width: 767px) {
  .payment-btn, .connect-btn {
    padding: 15px;
    font-size: 16px;
  }
}

.payment-btn {
  background-color: #3498db;
  color: white;
}

.payment-btn:hover {
  background-color: #2980b9;
}

.connect-btn {
  background-color: #2ecc71;
  color: white;
}

.connect-btn:hover {
  background-color: #27ae60;
}

/* Error Title */
.error-title {
  color: #e74c3c;
}

/* Success Message */
.success-message {
  color: #2ecc71;
  font-weight: bold;
}

/* Loading indicator */
.loading {
  color: #7f8c8d;
  font-style: italic;
  margin: 15px 0;
  text-align: center;
  font-size: 14px;
}

/* Confirmation Page Styles */
.confirmation-details {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 30px;
  margin: 30px auto;
  max-width: 600px;
}

.confirmation-details h2 {
  color: #27ae60;
  margin-bottom: 20px;
  text-align: center;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

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

.detail-label {
  font-weight: bold;
  color: #2c3e50;
}

.detail-value {
  color: #7f8c8d;
}

/* Checkout Styles */
.checkout {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 30px;
}

.order-summary, .payment-section {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
  width: 100%;
}

.order-summary h2, .payment-section h2 {
  margin-bottom: 20px;
  color: #2c3e50;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s ease;
  gap: 10px;
}

.summary-item:last-child {
  border-bottom: none;
}

.item-label {
  font-weight: bold;
  color: #2c3e50;
  margin-right: 10px;
}

.item-value {
  color: #7f8c8d;
}

.summary-item input[type="text"] {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

.summary-item button {
  white-space: nowrap;
  margin-left: 10px;
}

.summary-item select {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  height: 45px;
  background-color: white;
  cursor: pointer;
}

.summary-item select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 8px rgba(52, 152, 219, 0.5);
}

@media (max-width: 767px) {
  .summary-item {
    padding: 12px 0;
  }
  
  .detail-item {
    flex-direction: column;
    gap: 5px;
  }
  
  .detail-label, .detail-value {
    width: 100%;
  }
}

.payment-section {
  display: none;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
  width: 100%;
  border: 2px solid #3498db;
}

.payment-title {
  color: #2c3e50;
  margin-bottom: 0px;
  font-size: 24px;
}

/* Order Summary Styles */
.order-summary {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  padding: 10px;
  width: 100%;
  margin-bottom: 20px;
}

.order-summary h2 {
  font-size: 24px;
  color: #2c3e50;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid #f5f5f5;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s ease;
}

.item-label {
  font-weight: 600;
  color: #2c3e50;
  margin-right: 5px;
  font-size: 16px;
}

.item-value {
  color: #34495e;
  font-size: 16px;
  font-weight: 500;
}

.total-amount .item-label,
.total-amount .item-value {
  font-size: 18px;
  font-weight: 700;
  color: #2c3e50;
}

/* Responsive styles for order summary */
@media (max-width: 767px) {
  .order-summary {
    padding: 20px;
  }

  .order-summary h2 {
    font-size: 20px;
    margin-bottom: 20px;
  }

  .summary-item {
    padding: 12px 0;
  }

  .item-label,
  .item-value {
    font-size: 15px;
  }

  .total-amount .item-label,
  .total-amount .item-value {
    font-size: 17px;
  }
}

/* Connected Accounts Horizontal Scroll */
.connected-accounts-scroll {
  display: flex;
  flex-direction: row;
  gap: 20px;
  overflow-x: auto;
  padding: 20px 0 10px 0;
  margin-bottom: 20px;
  scrollbar-width: thin;
  scrollbar-color: #3498db #f5f5f5;
}
.connected-accounts-scroll::-webkit-scrollbar {
  height: 8px;
}
.connected-accounts-scroll::-webkit-scrollbar-thumb {
  background: #3498db;
  border-radius: 4px;
}
.connected-accounts-scroll::-webkit-scrollbar-track {
  background: #f5f5f5;
}

.account-card {
  background: white;
  border-radius: 8px;
  padding: 10px;
  min-width: 100px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  border: 1px solid #e0e0e0;
}
.account-card:hover {
  box-shadow: 0 4px 16px rgba(44, 62, 80, 0.15);
  border-color: #3498db;
  transform: translateY(-2px) scale(1.03);
}
.account-icon {
  font-size: 1.5rem;
  color: #2c3e50;
}
.account-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #2c3e50;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.account-subtitle {
  font-size: 0.7rem;
  color: #666;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.account-select-btn, .account-connect-btn {
  background-color: #3498db;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.7rem;
  transition: background-color 0.2s ease;
  width: 100%;
  margin-top: auto;
}
.account-select-btn:hover, .account-connect-btn:hover {
  background: #2980b9;
}
.connect-card {
  background: #f6fafd;
  border: 2px dashed #3498db;
  color: #3498db;
}
.connect-card .account-icon {
  color: #3498db;
}
.connect-card .account-title {
  color: #3498db;
}
.connect-card .account-connect-btn {
  background: #2ecc71;
}
.connect-card .account-connect-btn:hover {
  background: #27ae60;
}

/* Toggleable account card styles */
.account-toggle {
  cursor: pointer;
  border: 2px solid transparent;
  background: #fff;
  transition: border 0.2s, background 0.2s;
}
.account-toggle.selected {
  border: 2px solid #1976d2;
  background: #f6fafd;
  box-shadow: 0 2px 12px rgba(25, 118, 210, 0.08);
}

/* Pay info section styles */
#pay-info-section {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}
.pay-instructions {
  font-size: 2rem;
  color: #656689;
  font-weight: 500;
  margin-bottom: 32px;
  margin-top: 16px;
  line-height: 1.2;
}
.pay-total-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 3px solid #e3e7f0;
  border-radius: 24px;
  padding: 24px 32px;
  margin: 0 auto 32px auto;
  max-width: 500px;
  background: #fff;
  font-size: 2rem;
  font-weight: 700;
  color: #656689;
}
.pay-total-label {
  font-size: 1.4rem;
  font-weight: 700;
  color: #656689;
}
.pay-total-value {
  font-size: 2rem;
  font-weight: 700;
  color: #656689;
}

/* Bank list vertical styles */
.bank-list-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #656689;
  margin-bottom: 8px;
  text-align: left;
}
.bank-list-subtitle {
  font-size: 1.1rem;
  color: #656689;
  margin-bottom: 24px;
  text-align: left;
}
.bank-list-search {
  margin-bottom: 18px;
}
.bank-list-input {
  width: 100%;
  padding: 9px 18px;
  font-size: 16px;
  border: 2px solid #d3d8e3;
  border-radius: 8px;
  background: #fff;
  color: #656689;
  font-weight: 500;
  outline: none;
  margin-bottom: 8px;
  transform: scale(0.8);
  transform-origin: left center;
}
.bank-list-vertical {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 220px; /* Show only 3 items (3x item height + gap) */
  overflow-y: auto;
  padding-right: 4px;
}
.bank-list-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  gap: 10px;
  background-color: white;
  border: 1px solid #e0e0e0;
  margin-bottom: 5px;
}
.bank-list-item:hover {
  border: 2px solid #1976d2;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.08);
}
.bank-list-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
  background: #f5f5f5;
  margin-right: 10px;
}
.bank-list-name {
  font-size: 0.8rem;
  color: #2c3e50;
  font-weight: 500;
}

.autorizar-btn {
  width: 100%;
  max-width: 700px;
  background: #0073e6;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 11px 0;
  font-size: 0.8rem;
  font-weight: 500;
  margin: 16px auto 0 auto;
  display: block;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  opacity: 1;
}
.autorizar-btn:disabled {
  background: #d3d8e3;
  color: #fff;
  cursor: not-allowed;
  opacity: 0.7;
}

.pay-btn {
  width: 100%;
  max-width: 700px;
  background: #0073e6;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 11px 0;
  font-size: 0.8rem;
  font-weight: 500;
  margin: 0 auto;
  display: block;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.pay-btn:hover {
  background: #005bb5;
}

.pay-btn:disabled {
  background: #0073e6;
  opacity: 0.8;
  cursor: not-allowed;
}

.pay-btn .progress-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #fff;
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 1s linear infinite;
}

.bank-list-item.selected {
  border: 2px solid #1976d2;
  background: #f6fafd;
}

#collapse-btn {
  padding: 8px 12px;
  transition: transform 0.3s ease;
}

#collapse-btn.collapsed {
  transform: rotate(-90deg);
}

#collapsible-content {
  transition: max-height 0.3s ease-out;
  max-height: 1000px;
  overflow: hidden;
}

#collapsible-content.collapsed {
  max-height: 0;
}

/* Lightbox styles */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  max-width: 400px;
  width: 90%;
}

.progress-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #0073e6;
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 1s linear infinite;
}

.lightbox-message {
  font-size: 1.2rem;
  color: #2c3e50;
  margin-bottom: 0;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}