/* ============================================
   Label with Badge
   ============================================ */

.ipag-label-with-badge {
  gap: 0.5em;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ipag-label-badge {
  width: auto;
  height: auto;
  opacity: 0.8;
  max-width: 32px;
  max-height: 32px;
  object-fit: contain;
  transition: opacity 0.3s ease;

  &:hover {
    opacity: 1;
  }
}

/* ============================================
   Saved Cards Selection
   ============================================ */

.ipag-saved-cards-option {
  gap: 2em;
  padding: 1em;
  display: flex;
  border-radius: 8px;
  margin-bottom: 1.5em;
  background-color: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.ipag-card-selection {
  display: flex;
  align-items: center;

  label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    gap: 0.5em;
    margin: 0;

    input[type='radio'] {
      cursor: pointer;
      margin: 0;
    }
  }
}

/* ============================================
   Card Container & Preview Styles
   ============================================ */

.ipag-gateway-credit-form .card_wrapper {
  position: relative;
  perspective: 1200px;
  margin-bottom: 1.75em;
}

.ipag-gateway-credit-form .card_container {
  color: #fff;
  max-width: 300px;
  border-radius: 12px;
  aspect-ratio: 4/2.35;
  padding: 1.5rem 1rem;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  transform-style: preserve-3d;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition:
    border-color 0.6s ease-in-out,
    box-shadow 0.4s ease-out,
    transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Base gradient layer with smooth transition */
.ipag-gateway-credit-form .card_container::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    #3a4d5c 0%,
    #2c3e50 20%,
    #34495e 40%,
    #2c3e50 60%,
    #3a4d5c 80%,
    #1f2937 100%
  );
  transition: background 0.75s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
}

/* Ensure content is above gradient layer */
.ipag-gateway-credit-form .card_container > * {
  position: relative;
  z-index: 1;
}

/* ============================================
   Card Brand Variants
   ============================================ */

/* Visa - Blue theme */
.ipag-gateway-credit-form .card_container.brand-visa::before {
  background: linear-gradient(
    135deg,
    #0f3a7d 0%,
    #1a5c8a 20%,
    #2b7a9e 40%,
    #1e4d7b 60%,
    #0d2a4d 80%,
    #051829 100%
  );
  opacity: 1;
}

/* Mastercard - Red/Orange theme */
.ipag-gateway-credit-form .card_container.brand-mastercard::before {
  background: linear-gradient(
    135deg,
    #7a2e24 0%,
    #8f3b25 20%,
    #a64b2a 40%,
    #8f3b25 60%,
    #7a2e24 80%,
    #5c1f1b 100%
  );
  opacity: 1;
}

/* Mastercard - Darkest variant */
.ipag-gateway-credit-form .card_container.brand-mastercard.darkest::before {
  background: linear-gradient(
    135deg,
    #a83d2e 0%,
    #cc5a29 20%,
    #8b6914 40%,
    #a85f2a 60%,
    #cc5a29 80%,
    #6b1f1f 100%
  );
  opacity: 1;
}

/* Shimmer effect overlay para brilho sutil */
.ipag-gateway-credit-form .card_container::after {
  content: '';
  left: -10%;
  bottom: -30%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  position: absolute;
  pointer-events: none;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.05) 0%,
    transparent 70%
  );
}

/* Card hover effect with subtle lift */
.ipag-gateway-credit-form .card_container:hover {
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.15),
    0 6px 16px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-5px) rotateX(2deg);
}

/* ============================================
   Accepted Brands (Blocks)
   ============================================ */

.ipag-gateway-credit-form .ipag-accepted-brands {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  color: #5b6b79 !important;
  font-size: 0.85rem;
}

.ipag-gateway-credit-form .ipag-accepted-brands-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.25rem;
  padding: 0;
  margin: 0;
}

.ipag-gateway-credit-form .ipag-accepted-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.ipag-gateway-credit-form .ipag-accepted-brand img {
  height: 22px;
  width: auto;
  max-width: 48px;
  object-fit: contain;
  opacity: 0.85;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.08));
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    filter 0.2s ease;
}

.ipag-gateway-credit-form .ipag-accepted-brand span {
  font-size: 0.8rem;
  color: #5b6b79;
  font-weight: 600;
  transition:
    color 0.2s ease,
    opacity 0.2s ease,
    transform 0.2s ease;
}

.ipag-gateway-credit-form
  .ipag-accepted-brands-list.has-selected
  .ipag-accepted-brand {
  opacity: 0.35;
  transform: scale(0.95);
}

.ipag-gateway-credit-form
  .ipag-accepted-brands-list.has-selected
  .ipag-accepted-brand
  img {
  filter: grayscale(0.7) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.05));
}

.ipag-gateway-credit-form
  .ipag-accepted-brands-list.has-selected
  .ipag-accepted-brand
  span {
  color: #7a8a98;
}

.ipag-gateway-credit-form
  .ipag-accepted-brands-list.has-selected
  .ipag-accepted-brand.is-selected {
  opacity: 1;
  transform: scale(1.08);
}

.ipag-gateway-credit-form
  .ipag-accepted-brands-list.has-selected
  .ipag-accepted-brand.is-selected
  img {
  opacity: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.18));
}

.ipag-gateway-credit-form
  .ipag-accepted-brands-list.has-selected
  .ipag-accepted-brand.is-selected
  span {
  color: #223140;
}

.ipag-gateway-credit-form .ipag-card-number {
  font-weight: 700;
  line-height: 1.8;
  min-height: 2rem;
  word-spacing: 6px;
  position: relative;
  white-space: nowrap;
  margin-bottom: 1rem;
  font-size: 1.175rem;
  word-break: keep-all;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  font-family: 'Monaco', 'Courier New', monospace;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ipag-gateway-credit-form .ipag-card-name {
  opacity: 0.95;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ipag-gateway-credit-form .ipag-card-expiry {
  opacity: 0.95;
  font-weight: 600;
  font-size: 0.75rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ipag-gateway-credit-form .ipag-card-cvv {
  min-height: 1.5rem;
  display: inline-block;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Focus Effects - Highlight & Dim
   ============================================ */

/* Elementos ofuscados quando há foco em outro campo */
.ipag-gateway-credit-form .card_container.has-focus .is-dimmed {
  opacity: 0.35;
  filter: blur(0.5px);
}

/* Elemento em foco - destaque com brilho */
.ipag-gateway-credit-form .card_container .is-focused {
  opacity: 1;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.6),
    0 0 16px rgba(255, 255, 255, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.3);
  transform: scale(1.01) translateY(-2px);
  filter: brightness(1.2) contrast(1.1);
}

/* Efeito especial para número do cartão focado */
.ipag-gateway-credit-form .ipag-card-number.is-focused {
  letter-spacing: 1px;
  text-shadow:
    0 0 12px rgba(255, 255, 255, 0.7),
    0 0 24px rgba(255, 255, 255, 0.4),
    0 0 36px rgba(255, 255, 255, 0.2),
    0 2px 6px rgba(0, 0, 0, 0.4);
}

.ipag-gateway-credit-form .ipag-card-brand {
  width: 42px;
  aspect-ratio: 4 / 2;
  opacity: 1;
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  object-fit: contain;
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* ============================================
   Form Elements & Layout
   ============================================ */

.ipag-gateway-credit-form .ipag-boleto-description {
  margin: 0;
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid #0073e6;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);

  p {
    margin: 0;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    font-size: 0.95rem;
  }
}

.ipag-gateway-credit-form .form-row {
  position: relative;
  margin-bottom: 1.25rem;
}

.ipag-gateway-credit-form .ipag-input-with-icon {
  position: relative;
}

.ipag-gateway-credit-form .ipag-input-icon {
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  position: absolute;
  right: 1rem;
  z-index: 99;
  top: 50%;
}

.ipag-gateway-credit-form label {
  display: block;
  font-weight: 600;
  color: #223140;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  transition: color 0.2s ease;
}

.ipag-gateway-credit-form .form-row:focus-within > label {
  color: #0073e6;
}

/* ============================================
   Input Fields & Controls
   ============================================ */

.ipag-gateway-credit-form select,
.ipag-gateway-credit-form input[type='text'],
.ipag-gateway-credit-form input[type='tel'],
.ipag-gateway-credit-form input[type='password'],
.ipag-gateway-credit-form .input-text {
  width: 100%;
  height: auto;
  font-size: 1rem;
  min-height: 48px;
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
  padding: 0.85rem 1rem;
  box-sizing: border-box;
  border: 2px solid #e0e4e8;
  box-shadow: inset 0 -1px 0 transparent !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ipag-gateway-credit-form input[type='text']::placeholder,
.ipag-gateway-credit-form input[type='tel']::placeholder,
.ipag-gateway-credit-form input[type='password']::placeholder,
.ipag-gateway-credit-form .input-text::placeholder {
  color: #999;
  font-weight: 400;
}

.ipag-gateway-credit-form input[type='text']:hover,
.ipag-gateway-credit-form input[type='tel']:hover,
.ipag-gateway-credit-form input[type='password']:hover,
.ipag-gateway-credit-form .input-text:hover {
  border-color: #d0d8e0;
  background-color: #fafbfc;
}

.ipag-gateway-credit-form select:focus,
.ipag-gateway-credit-form input[type='tel']:focus,
.ipag-gateway-credit-form input[type='text']:focus,
.ipag-gateway-credit-form input[type='password']:focus,
.ipag-gateway-credit-form .input-text:focus {
  outline: none;
  border-color: #0073e6;
  background-color: #fff;
  box-shadow: inset 0 -1px 1px #0073e6 !important;
}

/* ============================================
   Error States
   ============================================ */

.ipag-gateway-credit-form .form-row.woocommerce-invalid input,
.ipag-gateway-credit-form .form-row.woocommerce-invalid select,
.ipag-gateway-credit-form input.woocommerce-invalid,
.ipag-gateway-credit-form select.woocommerce-invalid {
  border-color: #e74c3c !important;
  background-color: #fef5f5 !important;
}

.ipag-gateway-credit-form .form-row.woocommerce-invalid input::placeholder,
.ipag-gateway-credit-form .form-row.woocommerce-invalid select::placeholder,
.ipag-gateway-credit-form input.woocommerce-invalid::placeholder,
.ipag-gateway-credit-form select.woocommerce-invalid::placeholder {
  color: #e74c3c !important;
}

.ipag-gateway-credit-form .form-row.woocommerce-invalid input:focus,
.ipag-gateway-credit-form .form-row.woocommerce-invalid select:focus,
.ipag-gateway-credit-form input.woocommerce-invalid:focus,
.ipag-gateway-credit-form select.woocommerce-invalid:focus {
  border-color: #c0392b !important;
  box-shadow:
    inset 0 -1px 1px #e74c3c,
    0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

.ipag-gateway-credit-form .woocommerce-invalid label {
  color: #e74c3c !important;
}

.ipag-gateway-credit-form .woocommerce-error {
  display: block;
  color: #e74c3c;
  background: none;
  font-weight: 600 !important;
  border: none;
  padding: 0;
  font-size: 0.875rem !important;
  margin: 0.25rem 0 0 !important;
  font-weight: 500;
  animation: slideDown 0.3s ease-out;

  &::before {
    content: '';
    font-family: 'Font Awesome 5 Free';
    vertical-align: middle;
    display: inline-block;
    position: relative;
    margin-right: 0.25rem;
    color: #e74c3c;
    inset: 0;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ipag-gateway-credit-form select {
  padding: 0.85rem 1rem;
  background: #fff;
  border-radius: 6px;
  border: 2px solid #e0e4e8;
  font-size: 1rem;
  min-height: 48px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  font-family: inherit;
}

.ipag-gateway-credit-form select:hover {
  border-color: #d0d8e0;
  background-color: #fafbfc;
}

.ipag-gateway-credit-form select:focus {
  outline: none;
  border-color: #0073e6;
  box-shadow:
    0 0 0 4px rgba(0, 115, 230, 0.1),
    inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.ipag-gateway-credit-form .select_field {
  padding: 0.85rem 1rem;
  background: #fff;
  border-radius: 6px;
  border: 2px solid #e0e4e8;
  transition: all 0.3s ease;
}

.ipag-gateway-credit-form .select_field:hover {
  border-color: #d0d8e0;
}

.ipag-gateway-credit-form .select_field:focus-within {
  border-color: #0073e6;
  box-shadow: 0 0 0 4px rgba(0, 115, 230, 0.1);
}

/* ============================================
   Layout Helpers
   ============================================ */

.ipag-gateway-credit-form .row-flex {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.ipag-gateway-credit-form .ipag-expiry-col {
  flex: 1 1 auto;

  @media screen and (max-width: 578px) {
    width: 100%;
  }
}

.ipag-gateway-credit-form .ipag-cvv-col {
  width: 160px;

  @media screen and (max-width: 578px) {
    width: 100%;
  }
}

.ipag-gateway-credit-form .half-fill {
  width: calc(50% - 0.5rem);
  display: inline-block;
  box-sizing: border-box;
}

.ipag-gateway-credit-form .box-fill {
  width: 100%;
}

/* ============================================
   Brand & Visual Indicators
   ============================================ */

.ipag-gateway-credit-form .container-brands-accepted {
  display: flex;
  gap: 0.75rem;
  margin: 1rem 0 1.5rem 0;
  flex-wrap: wrap;
}

.ipag-gateway-credit-form .container-brands-accepted img {
  max-height: 32px;
  opacity: 0.75;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.ipag-gateway-credit-form .container-brands-accepted img:hover {
  opacity: 1;
  transform: scale(1.05);
}

.ipag-gateway-credit-form .card_container img.brand {
  position: absolute;
  right: 16px;
  top: 16px;
  height: 28px;
  opacity: 0.95;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.ipag-card-form-fields,
.ipag-card-form-saved-cards {
  padding: 0 1rem;
  margin-top: 0.25rem;

  @media screen and (max-width: 578px) {
    padding: 0;
  }
}

.ipag-saved-cards-list {
  background-color: #fdfdfdfa;
  border: 1px solid #e0e4e8;
  border-radius: 8px;
  user-select: none;
  cursor: default;
  padding: 1rem;
}

/* ============================================
   New Card Radio Option
   ============================================ */

.ipag-gateway-credit-form .ipag-card-option {
  padding: 0;
  overflow: hidden;

  @media screen and (max-width: 578px) {
    margin-top: 0.25rem;
  }
}

.ipag-gateway-credit-form .ipag-card-option input[type='radio'] {
  margin: 0;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #0073e6;
}

.ipag-gateway-credit-form .wc-ipag-card-option-label {
  margin: 0;
  gap: 0.65rem;
  padding: 1rem;
  display: flex;
  cursor: pointer;
  font-weight: 600;
  color: #223140;
  user-select: none;
  align-items: center;
  pointer-events: none;
}

.ipag-gateway-credit-form
  .ipag-card-option
  input[type='radio']:checked
  + .wc-ipag-card-option-label {
  color: #0073e6;
}

/* ============================================
   Checkboxes & Forms Controls
   ============================================ */

.ipag-gateway-credit-form .wc-block-components-checkbox .checkbox-control,
.ipag-gateway-credit-form .wc-block-components-checkbox label.checkbox-control {
  display: inline-flex !important;
  align-items: center;
  gap: 0.65rem;
}

.ipag-gateway-credit-form .wc-block-components-checkbox__mark {
  margin: 0;
  width: 20px;
  height: 20px;
  display: flex;
  flex: 0 0 20px;
  color: #0073e6;
  border-radius: 4px;
  align-items: center;
  justify-content: center;
  border-color: #d0d8e0;
  outline-color: #0073e6;
  transition: all 0.2s ease;
  border: 2px solid #d0d8e0;
}

.ipag-gateway-credit-form .wc-block-components-checkbox__input {
  margin: 0;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.ipag-gateway-credit-form
  .wc-block-components-checkbox__input:hover
  + .wc-block-components-checkbox__mark {
  border-color: #0073e6;
  background-color: rgba(0, 115, 230, 0.05);
}

.ipag-gateway-credit-form
  .wc-block-components-checkbox__input:checked
  + .wc-block-components-checkbox__mark {
  background-color: #0073e6;
  border-color: #0073e6;
  color: #fff;
}

.ipag-gateway-credit-form label.checkbox {
  gap: 0.65rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  user-select: none;
  font-weight: 500;
  color: #223140;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.ipag-gateway-credit-form label.checkbox:hover {
  color: #0073e6;
}

.ipag-gateway-credit-form label.checkbox input[type='checkbox'] {
  margin: 0;
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #0073e6;
  transition: all 0.2s ease;
}

.ipag-gateway-credit-form label.checkbox input[type='checkbox']:hover {
  transform: scale(1.05);
}

.ipag-gateway-credit-form .ipag-check-save-card {
  gap: 0.65rem;
  display: flex;
  margin-top: 1rem;
  padding-top: 1rem;
  align-items: center;
  border-top: 1px solid #e0e4e8;
}

/* ============================================
   Responsive Design
   ============================================ */

@media screen and (max-width: 768px) {
  .ipag-gateway-credit-form .card_container {
    max-width: 100%;
    padding: 16px;
  }

  .ipag-gateway-credit-form .ipag-card-number {
    font-size: 1.15rem;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
  }

  .ipag-gateway-credit-form .row-flex {
    gap: 0.75rem;
  }

  .ipag-gateway-credit-form input[type='text'],
  .ipag-gateway-credit-form input[type='tel'],
  .ipag-gateway-credit-form input[type='password'],
  .ipag-gateway-credit-form .input-text,
  .ipag-gateway-credit-form select {
    font-size: 16px;
  }
}

@media screen and (max-width: 480px) {
  .ipag-gateway-credit-form {
    padding: 0;
  }

  .ipag-gateway-credit-form .half-fill {
    width: 100% !important;
    display: block;
  }

  .ipag-gateway-credit-form .card_container {
    padding: 14px;
    margin-bottom: 1.5rem;
  }

  .ipag-gateway-credit-form .card_wrapper {
    margin-bottom: 1.5rem;
  }

  .ipag-gateway-credit-form .ipag-card-number {
    font-size: 1rem;
    letter-spacing: 2px;
    margin-bottom: 1rem;
  }

  .ipag-gateway-credit-form .ipag-card-name {
    font-size: 0.65rem;
  }

  .ipag-gateway-credit-form .ipag-card-expiry {
    font-size: 0.65rem;
  }

  .ipag-gateway-credit-form .card_container img.brand {
    height: 20px;
    right: 12px;
    top: 12px;
  }

  .ipag-gateway-credit-form .row-flex {
    flex-direction: column;
    gap: 1rem;
  }

  .ipag-gateway-credit-form .form-row {
    margin-bottom: 1rem;
  }

  .ipag-gateway-credit-form label {
    font-size: 0.9rem;
  }

  .ipag-gateway-credit-form .container-brands-accepted {
    gap: 0.5rem;
  }

  .ipag-gateway-credit-form .container-brands-accepted img {
    max-height: 28px;
  }

  .ipag-gateway-credit-form .ipag-accepted-brands {
    gap: 0.5rem;
    font-size: 0.8rem;
  }

  .ipag-gateway-credit-form .ipag-accepted-brand img {
    height: 20px;
    max-width: 42px;
  }
}
