/* Decision Tree Builder – Frontend */

.dtb-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, sans-serif;
}

.dtb-page-title {
  text-align: center;
  color: #1e3a5f;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 24px;
}

.dtb-cards {
  position: relative;
  min-height: 320px;
}

.dtb-card {
  display: none;
  animation: dtb-fade 0.3s ease;
}

.dtb-card.dtb-active {
  display: block;
}

@keyframes dtb-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.dtb-card-inner {
  background: #a6e0e6;
  border-radius: 20px;
  padding: 24px 20px 28px;
  position: relative;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

/* Color profiles – kék (alap), zöld, narancs, piros */
.dtb-color-kek .dtb-card-inner { background: #a6e0e6; }
.dtb-color-kek .dtb-card-title,
.dtb-color-kek .dtb-card-subtitle,
.dtb-color-kek .dtb-choice-btn:not(.dtb-selected),
.dtb-color-kek .dtb-field-label { color: #1e3a5f; }
.dtb-color-kek .dtb-choice-btn.dtb-selected,
.dtb-color-kek .dtb-btn-next,
.dtb-color-kek .dtb-card-icon { background: #1e3a5f; color: #fff; border-color: #1e3a5f; }
.dtb-color-kek .dtb-choice-btn { border-color: #1e3a5f; color: #1e3a5f; }

.dtb-color-zold .dtb-card-inner { background: #c8e6c9; }
.dtb-color-zold .dtb-card-title,
.dtb-color-zold .dtb-card-subtitle,
.dtb-color-zold .dtb-choice-btn:not(.dtb-selected),
.dtb-color-zold .dtb-field-label { color: #1b5e20; }
.dtb-color-zold .dtb-choice-btn.dtb-selected,
.dtb-color-zold .dtb-btn-next,
.dtb-color-zold .dtb-card-icon { background: #1b5e20; color: #fff; border-color: #1b5e20; }
.dtb-color-zold .dtb-choice-btn { border-color: #1b5e20; color: #1b5e20; }

.dtb-color-narancs .dtb-card-inner { background: #ffe0b2; }
.dtb-color-narancs .dtb-card-title,
.dtb-color-narancs .dtb-card-subtitle,
.dtb-color-narancs .dtb-choice-btn:not(.dtb-selected),
.dtb-color-narancs .dtb-field-label { color: #e65100; }
.dtb-color-narancs .dtb-choice-btn.dtb-selected,
.dtb-color-narancs .dtb-btn-next,
.dtb-color-narancs .dtb-card-icon { background: #e65100; color: #fff; border-color: #e65100; }
.dtb-color-narancs .dtb-choice-btn { border-color: #e65100; color: #e65100; }

.dtb-color-piros .dtb-card-inner { background: #ffcdd2; }
.dtb-color-piros .dtb-card-title,
.dtb-color-piros .dtb-card-subtitle,
.dtb-color-piros .dtb-choice-btn:not(.dtb-selected),
.dtb-color-piros .dtb-field-label { color: #b71c1c; }
.dtb-color-piros .dtb-choice-btn.dtb-selected,
.dtb-color-piros .dtb-btn-next,
.dtb-color-piros .dtb-card-icon { background: #b71c1c; color: #fff; border-color: #b71c1c; }
.dtb-color-piros .dtb-choice-btn { border-color: #b71c1c; color: #b71c1c; }

/* Icon – 100×100 px körben */
.dtb-card-icon {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: -40px auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.dtb-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dtb-card-title {
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 20px;
  line-height: 1.3;
}

.dtb-card-subtitle {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 16px;
  line-height: 1.4;
}

/* First card – elfogadandó szöveg (checkbox + HTML) */
.dtb-data-notice {
  margin-bottom: 20px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.7);
  border-radius: 12px;
}

.dtb-data-notice-accept {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.875rem;
  line-height: 1.5;
  cursor: pointer;
}

.dtb-data-notice-accept a { text-decoration: underline; }

.dtb-data-notice-accept.dtb-error { color: #c00; }

/* First card – mezők (email + két mező mellé), ikonokkal */
.dtb-card-first .dtb-first-fields {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}

@media (min-width: 520px) {
  .dtb-card-first .dtb-first-fields {
    grid-template-columns: 1fr 1fr;
  }
  .dtb-card-first .dtb-field-wrap.dtb-first-field-card:first-of-type {
    grid-column: 1 / -1;
  }
}

.dtb-card-first .dtb-field-wrap.dtb-first-field-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.dtb-first-field-icon {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #ffeb3b;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 0 auto 12px;
  flex-shrink: 0;
}

.dtb-first-field-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dtb-card-first .dtb-first-field-card .dtb-field-label {
  text-align: center;
}

.dtb-card-first .dtb-field-wrap:not(.dtb-first-field-card) {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.dtb-field-label {
  display: block;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.dtb-field-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dtb-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  background: #f5f5f5;
}

.dtb-field-suffix {
  font-size: 0.875rem;
  color: #666;
}

.dtb-btn-next,
.dtb-first-next {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: opacity 0.2s;
}

.dtb-btn-next:hover:not(:disabled),
.dtb-first-next:hover:not(:disabled) {
  opacity: 0.9;
}

.dtb-first-next:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.dtb-first-next.dtb-loading {
  pointer-events: none;
}

/* Choice buttons – gomb kinézet */
.dtb-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.dtb-choice-btn {
  padding: 12px 18px;
  border: 2px solid;
  border-radius: 10px;
  background: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-align: center;
}

.dtb-choice-btn:hover {
  opacity: 0.9;
}

.dtb-choice-btn.dtb-selected {
  background: inherit;
  color: #fff !important;
}

/* Outcome card */
.dtb-outcome-text {
  margin-bottom: 20px;
  line-height: 1.6;
  text-align: center;
}

.dtb-outcome-btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  transition: opacity 0.2s;
}

.dtb-outcome-btn:hover {
  opacity: 0.9;
  color: #fff;
}

/* Back navigation */
.dtb-nav {
  text-align: center;
  margin-top: 24px;
}

.dtb-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: none;
  background: none;
  color: #1e3a5f;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: opacity 0.2s;
}

.dtb-back:hover {
  opacity: 0.8;
}

.dtb-back-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1e3a5f;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.dtb-error {
  padding: 16px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
}
