/* ================================================================== */
/* Checkout — paleta Somos Saúde (azul/cyan)                          */
/* Layout inspirado no checkout do Cartão de TODOS (stepper + aside)  */
/* ================================================================== */

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

html { font-size: 62.5%; }

body {
  min-height: 100vh;
  font-family: "Inter", sans-serif;
  background-color: #f7f8fa;
  color: #001f35;
}

button, input, select { font-family: inherit; }
button { border: none; cursor: pointer; background: transparent; }
a { text-decoration: none; color: inherit; }

/* =================== LAYOUT =================== */

.checkout-layout {
  width: 100%;
  max-width: 130rem;
  margin: 0 auto;
  padding: 4rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36rem;
  gap: 4rem;
  align-items: start;
}

.checkout-form-area {
  background: #ffffff;
  border-radius: 0.8rem;
  padding: 4rem;
  border: 0.1rem solid #e5e7eb;
}

.checkout-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.35rem;
  font-weight: 600;
  color: #1673b9;
  margin-bottom: 2rem;
  transition: color 0.2s;
}

.checkout-back-link:hover { color: #062234; }

.checkout-back-link svg { width: 1.5rem; height: 1.5rem; stroke-width: 2.4; }

.checkout-logo {
  width: 16rem;
  height: auto;
  margin-bottom: 3rem;
  display: block;
}

/* =================== STEPPER =================== */

.checkout-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4rem;
  position: relative;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  flex-shrink: 0;
  z-index: 2;
}

.step-circle {
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  background: #e5e7eb;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  border: 0.2rem solid #e5e7eb;
  transition: all 0.3s;
}

.step.is-active .step-circle {
  background: #3d9ed0;
  color: #ffffff;
  border-color: #3d9ed0;
  box-shadow: 0 0 0 0.5rem rgba(61, 158, 208, 0.18);
}

.step.is-done .step-circle {
  background: #22c55e;
  color: #ffffff;
  border-color: #22c55e;
}

.step.is-done .step-circle::before {
  content: "✓";
  font-size: 1.7rem;
  font-weight: 900;
}

.step.is-done .step-number { display: none; }

.step-label {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.05rem;
  color: #9ca3af;
  text-transform: uppercase;
}

.step.is-active .step-label,
.step.is-done .step-label { color: #062234; }

.step-line {
  flex: 1;
  height: 0.2rem;
  background: #e5e7eb;
  margin: 0 0.8rem;
  margin-bottom: 2.4rem;
  transition: background 0.3s;
}

.step-line.is-done { background: #22c55e; }

/* =================== STEP CONTENT =================== */

.step-content[hidden] { display: none; }

.step-title {
  font-size: 2.4rem;
  font-weight: 800;
  color: #1673b9;
  margin-bottom: 0.4rem;
  letter-spacing: -0.04rem;
}

.step-subtitle {
  font-size: 1.45rem;
  color: #4b5563;
  margin-bottom: 1.6rem;
}

.step-hint {
  font-size: 1.2rem;
  color: #6b7a90;
  margin-bottom: 2rem;
}

.step-form {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

/* =================== INPUTS =================== */

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem;
}

.form-row--3 {
  grid-template-columns: 2fr 1fr 1fr;
}

.form-field {
  display: flex;
  flex-direction: column;
}

.form-field label {
  font-size: 1.25rem;
  font-weight: 700;
  color: #001f35;
  margin-bottom: 0.7rem;
}

.form-field input,
.form-field select,
.form-select {
  height: 4.4rem;
  width: 100%;
  border: 0.1rem solid #d6dde6;
  border-radius: 0.4rem;
  background: #fafafa;
  padding: 0 1.4rem;
  font-size: 1.4rem;
  font-weight: 500;
  color: #001f35;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.form-field input::placeholder { color: #b0bac9; font-style: italic; }
.form-field input:focus,
.form-field select:focus,
.form-select:focus {
  border-color: #3d9ed0;
  background: #ffffff;
  box-shadow: 0 0 0 0.3rem rgba(61, 158, 208, 0.14);
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237c8ca1' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.4rem center;
  background-size: 1.4rem;
  padding-right: 3.6rem;
  cursor: pointer;
}

/* =================== PASSWORD =================== */

.password-wrap { position: relative; }

.password-wrap input { padding-right: 4.4rem; }

.password-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 4rem;
  height: 4.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7c8ca1;
  transition: color 0.2s;
}

.password-toggle:hover { color: #3d9ed0; }

.password-toggle svg { width: 1.7rem; height: 1.7rem; stroke-width: 2; }

/* =================== CHECKBOX =================== */

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.4rem 1.6rem;
  border: 0.1rem solid #d6dde6;
  border-radius: 0.4rem;
  background: #fafafa;
  font-size: 1.3rem;
  color: #001f35;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  flex-shrink: 0;
  width: 1.8rem;
  height: 1.8rem;
  accent-color: #3d9ed0;
  cursor: pointer;
  margin-top: 0.1rem;
}

.checkbox-row span { line-height: 1.5; }

.checkbox-row a {
  color: #1673b9;
  font-weight: 700;
  text-decoration: underline;
}

/* =================== METHOD INFO =================== */

.method-info {
  padding: 1.4rem 1.6rem;
  background: #eff6ff;
  border-left: 0.3rem solid #3d9ed0;
  border-radius: 0.4rem;
  font-size: 1.3rem;
  color: #1e3a5f;
  line-height: 1.5;
}

.method-info:empty { display: none; }

/* =================== BOTÕES =================== */

.btn-next, .btn-submit {
  width: 100%;
  height: 5rem;
  border-radius: 0.5rem;
  background: linear-gradient(90deg, #2c7fba 0%, #55b7cd 100%);
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.6rem;
  transition: transform 0.2s, filter 0.2s;
}

.btn-next:hover, .btn-submit:hover {
  transform: translateY(-0.1rem);
  filter: brightness(1.05);
}

.btn-submit:disabled, .btn-next:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.btn-spinner svg {
  width: 1.8rem;
  height: 1.8rem;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

.btn-back-edit {
  display: inline-block;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
  color: #1673b9;
  text-decoration: underline;
  margin-top: 0.8rem;
}

.btn-back-edit:hover { color: #062234; }

/* =================== MENSAGEM =================== */

.form-message {
  min-height: 1.6rem;
  font-size: 1.3rem;
  font-weight: 600;
}

.form-message--error   { color: #dc2626; }
.form-message--success { color: #16a34a; }
.form-message--loading { color: #2563eb; }

/* =================== ASIDE — RESUMO =================== */

.checkout-summary {
  position: sticky;
  top: 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.summary-highlight {
  background: linear-gradient(135deg, #1673b9 0%, #55c0db 100%);
  border-radius: 0.8rem;
  padding: 2rem 2.4rem;
  color: #ffffff;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1.4rem;
}

.summary-highlight-label {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
}

.summary-highlight-value {
  font-size: 1.8rem;
  font-weight: 800;
  display: flex;
  align-items: flex-start;
}

.summary-highlight-value > span {
  font-size: 4.4rem;
  line-height: 1;
  font-weight: 900;
  margin: 0 0.2rem;
}

.summary-highlight-value sup {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 0.4rem;
}

.summary-total {
  background: #ffffff;
  border: 0.1rem solid #e5e7eb;
  border-radius: 0.6rem;
  padding: 1.6rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary-total-label {
  font-size: 1.4rem;
  font-weight: 600;
  color: #001f35;
}

.summary-total-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: #1673b9;
}

.summary-plan-name {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: #16a34a;
  padding: 0 0.4rem;
}

.summary-plan-name svg {
  width: 1.6rem;
  height: 1.6rem;
  stroke-width: 2.2;
}

.summary-info {
  font-size: 1.2rem;
  line-height: 1.6;
  color: #4b5563;
  padding: 0 0.4rem;
}

.summary-info p { margin-bottom: 0.6rem; }
.summary-info strong { color: #001f35; font-weight: 700; }

/* =================== RESULTADO (PIX / BOLETO / CARTÃO) =================== */

.step-result {
  text-align: center;
}

.result-icon {
  width: 7.2rem;
  height: 7.2rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
}

.result-icon svg {
  width: 3.6rem;
  height: 3.6rem;
  stroke-width: 2;
}

.result-icon--pending {
  background: #fef3c7;
  color: #b45309;
}

.result-icon--success {
  background: #dcfce7;
  color: #15803d;
}

.result-icon--failed {
  background: #fee2e2;
  color: #b91c1c;
}

.step-result .step-title,
.step-result .step-subtitle { text-align: center; }

.pix-qrcode-wrap {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.pix-qrcode-wrap img {
  width: 24rem;
  height: 24rem;
  border: 0.4rem solid #ffffff;
  border-radius: 0.8rem;
  box-shadow: 0 0.2rem 1.2rem rgba(0, 31, 53, 0.08);
  background: #ffffff;
}

.pix-copy-wrap, .boleto-line-wrap {
  margin: 2rem auto;
  max-width: 50rem;
  text-align: left;
}

.pix-copy-wrap label, .boleto-line-wrap label {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: #001f35;
  margin-bottom: 0.8rem;
}

.pix-copy-input {
  display: flex;
  gap: 0.6rem;
}

.pix-copy-input input {
  flex: 1;
  height: 4.4rem;
  border: 0.1rem solid #d6dde6;
  border-radius: 0.4rem;
  background: #f3f4f6;
  padding: 0 1.4rem;
  font-size: 1.25rem;
  color: #001f35;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.btn-copy {
  height: 4.4rem;
  padding: 0 1.4rem;
  background: #062234;
  color: #ffffff;
  border-radius: 0.4rem;
  font-size: 1.25rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s;
}

.btn-copy:hover { background: #1673b9; }

.btn-copy svg { width: 1.4rem; height: 1.4rem; stroke-width: 2.2; }

.btn-copy.is-copied { background: #16a34a; }

.btn-pdf {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem 1.6rem;
  border: 0.1rem solid #d6dde6;
  border-radius: 0.4rem;
  background: #fafafa;
  font-size: 1.3rem;
  font-weight: 700;
  color: #001f35;
  margin: 1rem auto;
  transition: all 0.2s;
}

.btn-pdf:hover {
  border-color: #1673b9;
  color: #1673b9;
}

.btn-pdf svg { width: 1.5rem; height: 1.5rem; stroke-width: 2.2; }

.result-info {
  font-size: 1.35rem;
  color: #4b5563;
  line-height: 1.55;
  margin: 1.6rem auto;
  max-width: 48rem;
}

/* =================== RESPONSIVO TABLET =================== */

@media (max-width: 980px) {
  .checkout-layout {
    grid-template-columns: 1fr;
    gap: 2.4rem;
    padding: 2.4rem;
  }
  .checkout-summary {
    position: static;
    order: -1;
  }
  .checkout-form-area { padding: 3rem 2.4rem; }
}

/* =================== RESPONSIVO MOBILE =================== */

@media (max-width: 640px) {
  html { font-size: 58%; }

  .checkout-layout { padding: 1.6rem; }

  .form-row, .form-row--3 {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .form-row > .form-field, .form-row--3 > .form-field {
    margin-bottom: 1.6rem;
  }

  .step-label { font-size: 1rem; }
  .checkout-logo { width: 13rem; }
  .checkout-form-area { padding: 2.4rem 1.8rem; }

  .pix-qrcode-wrap img { width: 20rem; height: 20rem; }
}
