/*
 * termos.css — Modal dos Termos de Uso e checkbox de aceite.
 * Compartilhado por cadastro.html e checkout.html (CLU-63/CLU-64);
 * o comportamento está em assets/js/termos.js.
 */

/* ---- Checkbox (newsletter / aceite dos termos) ---- */
.checkbox-aceite {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.checkbox-aceite input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-text-muted);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  transition: border-color var(--transition), background-color var(--transition);
  position: relative;
}

.checkbox-aceite input[type="checkbox"]:checked {
  border-color: var(--color-primary);
  background-color: var(--color-primary);
}

.checkbox-aceite input[type="checkbox"]:checked::after {
  content: '\f00c';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  font-size: 11px;
  color: #fff;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.checkbox-aceite input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ---- Terms modal customisation ---- */
.terms-modal-dialog {
  max-width: 700px;
  width: 100%;
  background-color: rgba(68, 68, 68, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-lg);
  /* O termo vigente tem ~25 mil caracteres: o card nunca passa da tela e
     só a área do texto rola — os botões ficam sempre visíveis. */
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
}

.terms-modal-dialog .modal__title {
  font-size: 21px;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0 0 16px;
}

.terms-modal-version {
  font-size: 14px;
  color: #D5D5D5;
  margin: -10px 0 12px;
}

.terms-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 60vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
  color: #FEFEFE;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  padding-right: 8px;
  margin-bottom: 20px;
}

.terms-scroll::-webkit-scrollbar {
  width: 6px;
}

.terms-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.terms-scroll::-webkit-scrollbar-thumb {
  background-color: var(--color-border);
  border-radius: 3px;
}

.terms-modal-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.terms-status {
  color: #D5D5D5;
  white-space: normal;
}

.terms-status--erro {
  color: #FF8A80;
}

.btn-ciente:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-fechar {
  flex: 1;
  background-color: transparent;
  color: #FEFEFE;
  border: none;
  border-radius: 16px;
  padding: 10px 20px;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  position: relative;
  transition: background-color var(--transition);
}

.btn-fechar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to left, #868686, #656365, #404040, #2A2A2A);
  padding: 1px;
  border-radius: 16px;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.btn-fechar:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.btn-ciente {
  flex: 1;
  background-color: #FF6900;
  color: #FEFEFE;
  border: none;
  border-radius: 16px;
  padding: 10px 20px;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition: background-color var(--transition);
}

.btn-ciente:hover {
  background-color: var(--color-primary-dark);
}

@media (max-width: 580px) {
  .terms-modal-actions {
    flex-direction: column;
  }

  .terms-modal-dialog {
    padding: 18px;
  }

  .terms-scroll {
    font-size: 15px;
  }
}

.checkbox-aceite__texto {
  color: #D5D5D5;
  font-size: 0.9375rem;
  line-height: 1.5;
}
