.recurly-widget {
  font-family: "Arial", sans-serif;
  max-width: 800px;
  margin: 0 auto;
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.recurly-section-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 2px solid #ddd;
}

.recurly-section {
  margin-bottom: 30px;
  padding: 20px;
  border-radius: 8px;
  background-color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-details-section {
  background-color: #eceff4;
}

.recurly-widget-title {
  text-align: left;
  font-size: 24px;
  font-weight: bold;
  color: #333;
  margin-bottom: 20px;
}


.credit-card-display {
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #f0f0f0;
  padding: 20px;
  border-radius: 8px;
}

.credit-card-display::before {
  content: "Current Billing on File";
  font-weight: bold;
  margin-bottom: 10px;
  font-size: 20px;
}

.credit-card {
  position: relative;
  padding: 15px;
  border-radius: 10px;
  background-color: #121c52;
  color: white;
  width: 260px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
}

.credit-card.visa {
  background: linear-gradient(145deg, #23395d 10%, #1e3c72 50%, #2a5298 90%);
  box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.3),
    0px 0px 12px rgba(42, 82, 152, 0.5);
  border-radius: 10px;
}

.credit-card.mastercard {
  background: linear-gradient(to right, #eb001b, #000);
  box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.3),
    0px 0px 12px rgba(235, 0, 27, 0.5);
  border-radius: 10px;
}

.credit-card.amex {
  background: linear-gradient(145deg, #c0c0c0 10%, #a0a0a0 50%, #000 90%);
  box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.3),
    0px 0px 12px rgba(192, 192, 192, 0.5);
  border-radius: 10px;
}

.credit-card.discover {
  background: linear-gradient(145deg, #ff8c00 10%, #ff6000 50%, #000 90%);
  box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.3),
    0px 0px 12px rgba(255, 96, 0, 0.5);
  border-radius: 10px;
}

.card-logo {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 24px;
  font-weight: bold;
}

.card-type {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 5px;
}

.card-number {
  font-size: 18px;
  letter-spacing: 2px;
  margin-top: 10px;
}

.card-expiry {
  font-size: 14px;
  font-weight: bold;
  color: white;
  bottom: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.2);
  padding: 5px 10px;
  border-radius: 5px;
}


.update-card-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.recurly-form-group {
  margin-bottom: 12px;
}
.recurly-form-row {
  display: flex;
  gap: 12px;
}

.recurly-form-group input,
.recurly-form-group select {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  font-family: Arial, sans-serif;
}



#recurly-cc-widget input[type="text"],
#recurly-cc-widget #card-element {
  border: 1px solid #ccc;
  background-color: #ffffff;
  padding: 10px;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  height: 40px;
  box-sizing: border-box;
}

#recurly-cc-widget input[type="text"]:focus,
#card-element:focus {
  border-color: #007bff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.card-element-container {
  width: 100%;
  position: relative;
  min-height: 40px;
}

#card-element {
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
  padding: 0;
  height: auto;
  min-height: 40px;
  width: 100%;
  box-sizing: border-box;
}

#card-element.recurly-element-focus {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

#card-element.recurly-element-invalid {
  border-color: #dc3545;
}

#card-element iframe {
  width: 100% !important;
  height: 100% !important;
  min-height: 40px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

#card-element * {
  font-size: inherit;
  line-height: inherit;
  box-sizing: border-box;
}

.update-card-button {
  width: 100%;
  background-color: #007bff;
  color: white;
  padding: 10px 20px;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.update-card-button:hover {
  background-color: #0056b3;
}

.message {
  display: none;
  padding: 10px;
  margin-top: 20px;
  border-radius: 4px;
  font-size: 14px;
  text-align: center;
}

.message.show {
  display: block;
}

.message.success {
  background-color: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}

.message.error {
  background-color: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

.message.info {
  background-color: #cce5ff;
  color: #004085;
  border-color: #b8daff;
}

.primary-card {
  border: 2px solid #007bff;
  background: #e6f2ff;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.primary-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: #fff;
  color: green;
  font-size: 12px;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.subscription-list {
  width: 45%;
}
.subscriptions-list h4 {
  font-size: 20px;
  font-weight: bold;
  text-align: left;
  color: #333;
  margin-bottom: 5px;
  font-family: inherit;
}

.subscriptions-list ul {
  padding-left: 15px;
  list-style-type: none;
}

.subscriptions-list ul li {
  padding: 5px 0;
  font-size: 14px;
  font-weight: bold;
  list-style: none;
}

.recurly-hosted-field {
  width: 100% !important;
  background: #fff !important;
  border: 1px solid #ccc !important;
  padding: 10px !important;
  border-radius: 5px !important;
  font-size: 16px !important;
  font-family: Arial, sans-serif !important;
  color: #333 !important;
}

.recurly-hosted-field::placeholder {
  color: #999 !important;
  font-style: italic !important;
}

.recurly-hosted-field:focus {
  border-color: #007bff !important;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5) !important;
}

.recurly-form-group label {
  font-weight: bold;
  margin-bottom: 5px;
}

.recurly-hosted-field,
#recurly-card-number,
#recurly-expiration-month,
#recurly-expiration-year,
#recurly-cvv {
  width: 100%;
  height: 45px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  padding: 12px;
  box-sizing: border-box;
  margin-bottom: 15px;
}

.recurly-hosted-field:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus {
  border-color: #007bff !important;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5) !important;
}

.recurly-form-group {
  margin-bottom: 15px;
}

.recurly-form-group label {
  font-weight: bold;
  margin-bottom: 5px;
  display: block;
}

#recurly-card-number,
#recurly-expiration-month,
#recurly-expiration-year,
#recurly-cvv {
  width: 100%;
  min-height: 45px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  padding: 12px;
  box-sizing: border-box;
  position: relative;
}

#recurly-card-number iframe,
#recurly-expiration-month iframe,
#recurly-expiration-year iframe,
#recurly-cvv iframe {
  width: 100% !important;
  height: 100% !important;
  min-height: 45px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.expiry-group {
  display: flex;
  gap: 15px;
}

.expiry-group .recurly-form-group {
  flex: 1;
}

.recurly-form-row.expiry-group .recurly-form-group {
  flex: 1;
  min-width: 100px;
}

#recurly-cc-message {
  margin: 20px 0;
  transition: opacity 0.3s ease;
  opacity: 0;
}

#recurly-cc-message.show {
  opacity: 1;
}

.message {
  display: block !important;
  padding: 12px 20px;
  border-radius: 4px;
  margin-bottom: 10px;
  transition: opacity 0.3s ease-in-out;
}

.message {
  opacity: 1 !important;
  transition: none !important;
}

.message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  display: block !important;
}

.message.info {
  background-color: #cce5ff;
  color: #004085;
  border: 1px solid #b8daff;
}

.modal {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  width: 400px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.modal-content button {
  margin-top: 15px;
  padding: 10px 15px;
  border: none;
  border-radius: 5px;
  font-size: 14px;
  cursor: pointer;
}

#confirm-change-payment {
  background-color: #007bff;
  color: white;
}

#close-modal {
  background-color: #ccc;
}

.loading-spinner {
  width: 25px;
  height: 25px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
  margin-right: 10px;
}

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

.modal-message {
  font-size: 16px;
  margin-top: 15px;
  text-align: center;
}
.modal-message.success {
  color: green;
}
.modal-message.error {
  color: red;
}

.subscription-next-billing {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 5px;
}

.charged-to-card {
  font-size: 14px;
  font-weight: bold;
  color: #555;
  margin-top: 5px;
}

.change-payment-method {
  all: unset;
  font-size: 14px;
  font-weight: bold;
  color: #007bff;
  text-decoration: underline;
  cursor: pointer;
}
.change-payment-method:hover {
  all: unset;
  color: #0056b3;
}

.subscription-item {
  padding: 5px 0;
  font-size: 14px;
  font-weight: bold;
  list-style: none;
  position: relative;
  border-bottom: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  margin-bottom: 20px !important;
}

.subscription-item:hover {
  background: #f8f9fa;
  transition: background 0.2s ease-in-out;
}

.subscription-item:last-child {
  border-bottom: 1px solid #ddd;
  margin-bottom: 10px;
}

.subscription-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  background: white;
}

.subscription-table th {
  background: black;
  color: white;
  padding: 14px;
  text-align: left;
  font-size: 16px;
  font-weight: bold;
}

.subscription-table td {
  padding: 15px !important;
  border-bottom: 1px solid #ddd;
  vertical-align: middle;
}

.card-info {
  width: 35%;
  padding: 15px;
}

.subscription-list {
  width: 45%;
}

.no-subscriptions,
.no-action {
  font-size: 14px;
  color: #888;
  text-align: center;
}

.no-card-info {
  text-align: center;
  font-weight: bold;
  color: #555;
  padding: 15px;
}

.action-column {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.subscription-row {
  display: flex;
  width: 100%;
  align-items: flex-start;
  justify-content: space-between;
  padding: 15px;
}

.subscription-row:nth-child(even) {
  background-color: #f9f9f9;
}

.subscription-row:nth-child(odd) {
  background-color: #f1f1f1;
}

.subscription-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  width: 100%;
}

.billing-info {
  width: 280px;
  min-width: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.3),
    0px 0px 12px rgba(42, 82, 152, 0.5);
}

.billing-info,
.subscription-details,
.action-column {
  flex: 1;
  padding: 15px;
}

.subscription-details {
  flex: 1;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.subscription-plan {
  font-size: 18px;
  font-weight: bold;
  color: #1a642d;
  margin-bottom: 5px;
}

.card-label {
  font-size: 16px;
  font-weight: bold;
  color: #007bff;
  margin-bottom: 8px;
}

#payment-method-modal {
  all: unset;
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  all: unset;
  background: white;
  padding: 30px;
  border-radius: 8px;
  width: 500px;
  max-width: 90%;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-body {
  margin-bottom: 20px;
}

#new-payment-method {
  width: 100%;
  font-size: 18px;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  margin-top: 10px;
}

.modal-footer {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.modal-footer button {
  padding: 10px 15px;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
  min-width: 120px;
}

#confirm-change-payment {
  background-color: #007bff;
  color: white;
}

#close-modal {
  background-color: #ccc;
}

select#new-payment-method {
  padding: 12px;
  font-size: 16px;
  width: 100%;
  text-align: left;
  font-weight: bold;
}

.billing-details {
  margin-top: 10px;
  font-size: 14px;
  background: #f8f9fa;
  padding: 10px;
  border-radius: 5px;
  border-left: 4px solid #007bff;
}

.billing-details strong {
  font-size: 14px;
  color: #333;
}

.billing-address {
  background: #fff;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.4;
  margin-top: 12px;
  border: 1px solid #ddd;
  width: 260px;
  box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.billing-address strong {
  font-size: 15px;
  color: #333;
  display: block;
  margin-bottom: 5px;
}

.billing-address p {
  margin: 0;
  color: #444;
  font-weight: 500;
}

.billing-address .icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  vertical-align: middle;
}

.styled-select {
  appearance: none;
  background-color: white;
  background-size: 12px;
  padding-right: 40px;
  font-size: 14px;
  color: #333;
}

.name-fields {
  display: flex;
  gap: 12px;
  width: 100%;
}

#recurly-cc-widget .name-fields .recurly-form-group {
  flex: 1;
}

#recurly-cc-widget .name-fields .recurly-form-group input {
  width: 100%;
}

#recurly-cc-widget select,
#recurly-cc-widget input {
  color: #6c757d !important;
  font-size: 16px;
  font-family: inherit;
}

#recurly-cc-widget select option {
  color: #000;
}

#recurly-cc-widget select:focus,
#recurly-cc-widget input:focus {
  color: #000 !important;
}

.card-actions {
  all: unset;
  gap: 15px !important;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-top: 8px;
}

.set-primary-container,
.remove-card-container {
  all: unset;
  text-align: left;
}

.set-primary-card,
.remove-card-button {
  all: unset;
  background: none;
  border: none;
  font-size: 12px !important;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
}

.remove-card-button {
  all: unset;
  color: red;
}

.remove-card-button:hover {
  all: unset;
  color: darkred;
}

.set-primary-card {
  all: unset;
  color: green;
}

.set-primary-card:hover {
  all: unset;
  color: darkgreen;
}

#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 18px;
  font-weight: bold;
  z-index: 10000;
  text-align: center;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 6px solid rgba(255, 255, 255, 0.3);
  border-top: 6px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

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

#recurly-cc-widget .recurly-form-group select,
#recurly-cc-widget .recurly-form-group input {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  font-family: Arial, sans-serif;
  box-sizing: border-box;
}


#state {
  opacity: 0;
  display: none;
  transition: opacity 0.4s ease-in-out;
}

#country option[value=""] {
  color: #aaa;
}

#country:invalid {
  color: #aaa;
}



@media (max-width: 768px) {
  .subscription-table {
    width: 100%;
    display: block;
    overflow-x: auto;
  }

  .subscription-table thead {
    display: none;
  }

  .subscription-table tbody {
    display: block;
    width: 100%;
  }

  .subscription-table tr {
    display: block;
    border-bottom: 2px solid #ddd;
    margin-bottom: 10px;
    padding: 10px;
    background: #fff;
  }

  .subscription-table td {
    display: block;
    text-align: left;
    padding: 10px;
    font-size: 14px;
    width: 100%;
  }

  .card-info {
    width: 100%;
    text-align: center;
    margin-bottom: 15px;
  }

  .billing-address {
    width: 100%;
    text-align: center;
  }

  .credit-card {
    max-width: 100%;
    text-align: center;
    margin: 0 auto;
  }

  .primary-badge {
    position: relative;
    display: block;
    text-align: center;
    margin-bottom: 10px;
  }

  .subscription-list {
    width: 100%;
  }

  .subscriptions-list ul {
    padding-left: 0;
  }

  .subscription-item {
    padding: 10px;
    text-align: center;
  }

  .change-payment-method {
    font-weight: bold;
    display: inline-block;
    text-decoration: underline;
}

.change-payment-method:hover {
    text-decoration: none;
}

  .billing-details {
    width: 100%;
    text-align: center;
  }

  .card-actions {
    flex-direction: column;
    gap: 10px;
  }

  .set-primary-card, .remove-card-button {
    width: 100%;
    text-align: center;
    display: block;
  }
}

@media (max-width: 768px) {
  .credit-card {
    max-width: 90%;
    padding: 15px;
    margin: 10px auto;
  }
}

.recurly-input-error {
  border: 2px solid red !important;
}

.error-border {
  border: 2px solid red !important;
}


.expired-card {
    border: 2px solid red;
    background: #ffe6e6;
}

.expired-warning {
    color: red;
    font-weight: bold;
    margin-top: 5px;
    text-align: center;
    background: #ffcccc;
    padding: 5px;
    border-radius: 5px;
    width: 260px;
    font-size:12px;
    line-height:15px;
}
.expired-card {
    color: red;
    font-weight:bold;
}
