/* Popup de termos. Sem flex gap nem backdrop-filter: não existem no Chromium 53 (webOS 4.x). */

.terms-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 18, 0.9);
}

.terms-container {
  width: 64%;
  max-width: 1240px;
  min-width: 320px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: left;
  background: linear-gradient(160deg, #1d2142 0%, #12142a 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.75);
  animation: termsIn 0.28s ease-out;
}

.terms-container::before {
  content: '';
  flex-shrink: 0;
  height: 6px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

@keyframes termsIn {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.terms-header {
  flex-shrink: 0;
  padding: 36px 48px 22px;
}

.terms-header h2 {
  margin: 0;
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  text-shadow: none;
}

.terms-subtitle {
  margin-top: 10px;
  font-size: 19px;
  color: #9aa0c3;
}

.terms-version {
  display: inline-block;
  margin-left: 12px;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 15px;
  color: #c9ceff;
  background: rgba(102, 126, 234, 0.22);
}

.terms-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin: 0 48px;
  padding: 26px 30px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

#termsContent {
  margin: 0;
  font-family: Arial, sans-serif;
  font-size: 21px;
  line-height: 1.7;
  color: #d9dcee;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.terms-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 48px 34px;
}

.terms-hint {
  font-size: 16px;
  color: #7f85a8;
}

.terms-actions {
  display: flex;
  flex-shrink: 0;
}

.terms-btn {
  min-width: 200px;
  margin-left: 18px;
  padding: 17px 38px;
  font-size: 21px;
  font-weight: bold;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.terms-btn.accept,
.terms-btn.accept:hover {
  border: 2px solid transparent;
  color: #fff;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.terms-btn.reject,
.terms-btn.reject:hover {
  border: 2px solid rgba(255, 255, 255, 0.28);
  color: #cfd3ea;
  background: transparent;
}

.terms-btn:hover {
  transform: scale(1.04);
}

.terms-btn:focus {
  outline: none;
  transform: scale(1.07);
  box-shadow: 0 0 0 4px #fff, 0 12px 34px rgba(102, 126, 234, 0.55);
}

.terms-body::-webkit-scrollbar {
  width: 10px;
}

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

.terms-body::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.7);
  border-radius: 5px;
}

@media (max-width: 900px) {
  .terms-container { width: 92%; }
  .terms-header { padding: 24px 24px 16px; }
  .terms-header h2 { font-size: 26px; }
  .terms-body { margin: 0 24px; padding: 18px; }
  #termsContent { font-size: 16px; }
  .terms-footer { padding: 18px 24px 24px; }
  .terms-hint { display: none; }
  .terms-btn { min-width: 120px; padding: 13px 22px; font-size: 17px; }
}
