:root {font-family: 'Poppins', sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: #000;
  background-color: #242424;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(to top, #0ba360 0%, #3cba92 100%);
  padding: 24px;
  margin: 0;
  display: flex;
  align-items:center;
  justify-content: center;
}

#highlight {
  position: absolute;
  border: 1px solid #ffffff87;
  border-radius: 12px;
  z-index: 1;
  width: 0;
  height: 0;
  top: 0;
  left: 0;
  box-shadow: 0 0 3px #fff;
  transition: .3s;
}


#highlight.highlight__number {
  width: 220px;
  height: 40px;
  top: 88px;
  left: 18px;
}



#highlight.highlight__holder {
  width: 270px;
  height: 56px;
  top: 152px;
  left: 18px;
}

#highlight.hidden {
  display: none;
}

.card { 
  position: relative;
  max-width: 420px;
  margin: 0 auto;
  transform-style: preserve-3d;
  transition: 1s;
}

.card:hover,
.card.flip {
  transform: none;
}

.card:hover #highlight {
  display: none;
}

.card__front,
.card__back {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 85.6 / 54;
  border-radius: 20px;
  padding: 24px 30px 30px;
  background-image: radial-gradient(circle at 17% 5%, rgba(185, 185, 185,0.1) 0%, rgba(185, 185, 185,0.1) 33.333%,rgba(216, 216, 216,0.1) 33.333%, rgba(216, 216, 216,0.1) 66.666%,rgba(247, 247, 247,0.1) 66.666%, rgba(247, 247, 247,0.1) 99.999%),radial-gradient(circle at 36% 54%, rgba(52, 52, 52,0.1) 0%, rgba(52, 52, 52,0.1) 33.333%,rgba(111, 111, 111,0.1) 33.333%, rgba(111, 111, 111,0.1) 66.666%,rgba(170, 170, 170,0.1) 66.666%, rgba(170, 170, 170,0.1) 99.999%),radial-gradient(circle at 62% 35%, rgba(209, 209, 209,0.1) 0%, rgba(209, 209, 209,0.1) 33.333%,rgba(107, 107, 107,0.1) 33.333%, rgba(107, 107, 107,0.1) 66.666%,rgba(5, 5, 5,0.1) 66.666%, rgba(5, 5, 5,0.1) 99.999%),linear-gradient(45deg, rgb(49, 231, 152),rgb(120, 182, 17));
  box-shadow: 0 33px 50px -15px rgba(50,55,63,.66);
  color: #fff;
  overflow: hidden;
  margin: 0 auto;
  backface-visibility: hidden;
}

@media (max-width: 450px) {
  .card__front,
  .card__back{
    padding: 8px 12px 16px;
  }
}

.card__back { display: none; }

.card__front {
  position: relative;
}

.card__front:before,
.card__back:before {
  content: "";
  display: none;
}

.card__front:after,
.card__back:after {
  content: "";
  display: none;
}

.card__hide_line {
  height: 40px;
  width: 100%;
  background-color: #6b7280;
  position: relative;
  z-index: 1;
}

.card_cvv {
  position: relative;
  z-index: 1;
  margin-top: 24px;
  padding: 0 32px;
  display: flex;
  flex-direction: column;
  align-items: end;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
}

.card_cvv_field {
  margin-top: 6px;
  background-color: #fff;
  border-radius: 12px;
  height: 44px;
  width: 100%;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: end;
  padding: 0 12px;
  font-size: 25px;
  line-height: 21px;
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
  font-size: 24px;
}

.card__number {
  /* word-spacing: 10px; */
  font-size: 22px;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
  display: flex;
  height: 33px;
  overflow: hidden;
}

.card__number span {
  display: flex;
  flex-direction: column;
  transition: .2s;
}

.card__number span.filed { 
  transform: translateY(-33px);
}

.card__number span:nth-child(4n) {
  margin-right: 1px;
}

.card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.card__holder {
  text-transform: uppercase;
}

.card__matricula {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  margin-top: 4px;
}

.card__section__title {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
}

.form {
  border-radius: 12px;
  background: #fff;
  max-width: 600px;
  margin: -130px auto 0;
  padding: 180px 32px 32px;
  border: 1px solid #f1f1f1;
  box-shadow: 0 0 40px rgba(50,55,63,.16);
  display: grid;
  gap: 12px;
}

label {
  display: block;
  margin: 14px 0 4px;
  color: #0d0c22;
  font-weight: 500;
}

input, select {
  height: 52px;
  display: block;
  width: 420px;
  border: 1px solid #6b7280;
  padding: 18px 20px;
  transition: outline 200ms ease, box-shadow 200ms ease;
  border-radius: 12px;
  outline: none;
  background-color: #fff;
  color: #0d0c22;
  font-size: 16px;
}

input:focus,
select:focus {
  border: 1px solid #000;   
  outline: 4px solid rgba(0,0,0,.1);
}

select {
  padding: 0 20px;
}

.filed__group {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.filed__date {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.generate-btn {
  background-image: radial-gradient(circle at 17% 5%, rgba(185, 185, 185,0.1) 0%, rgba(185, 185, 185,0.1) 33.333%,rgba(216, 216, 216,0.1) 33.333%, rgba(216, 216, 216,0.1) 66.666%,rgba(247, 247, 247,0.1) 66.666%, rgba(247, 247, 247,0.1) 99.999%),radial-gradient(circle at 36% 54%, rgba(52, 52, 52,0.1) 0%, rgba(52, 52, 52,0.1) 33.333%,rgba(111, 111, 111,0.1) 33.333%, rgba(111, 111, 111,0.1) 66.666%,rgba(170, 170, 170,0.1) 66.666%, rgba(170, 170, 170,0.1) 99.999%),radial-gradient(circle at 62% 35%, rgba(209, 209, 209,0.1) 0%, rgba(209, 209, 209,0.1) 33.333%,rgba(107, 107, 107,0.1) 33.333%, rgba(107, 107, 107,0.1) 66.666%,rgba(5, 5, 5,0.1) 66.666%, rgba(5, 5, 5,0.1) 99.999%),linear-gradient(45deg, rgb(49, 231, 152),rgb(120, 182, 17));
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 20px;
  width: 100%;
}

.generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.generate-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Overlay de validação */
.validation-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.8);
  display: none;              /* começa escondido */
  align-items: center;
  justify-content: center;
  z-index: 999999;
  backdrop-filter: blur(4px);
  margin: 0;
  padding: 0;
}

/* Quando ativa, o overlay aparece em flex */
.validation-overlay.is-active {
  display: flex;
}

.validation-content {
  background: #fff;
  padding: 40px 60px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  min-width: 300px;
}

.validation-content p {
  margin-top: 20px;
  font-size: 18px;
  font-weight: 500;
  color: #0d0c22;
}

/* Spinner de carregamento */
.validation-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #0ba360;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

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

/* Mensagem de erro */
.error-message {
  background-color: #fee;
  border: 1px solid #fcc;
  color: #c33;
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

/* Campo readonly */
input[readonly] {
  background-color: #f5f5f5;
  cursor: not-allowed;
  opacity: 0.8;
}