/* Treino do AI Builder: mesmo visual da capa da apresentação (azul-noite, acentos azul e laranja). */

.treino {
  --night: #05070D;
  --night-2: #0B2A5C;
  --sky: #4DA6FF;
  --royal: #0A6CFF;
  --line: #1E6BFF;
  --orange: #FF7A1A;
  --orange-text: #FF8A1F;
  --soft: #C9D6EA;
  --ok: #067647;
  --ok-soft: #ECFDF3;
  --no: #B42318;
  --no-soft: #FEF3F2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #FCFCFD;
  background: var(--night) radial-gradient(ellipse at 50% 0%, var(--night-2) 0%, var(--night) 62%) no-repeat;
  background-size: 100% 900px;
  position: relative;
  overflow-x: hidden;
}
.treino h1, .treino h2, .treino h3 { color: inherit; }
.treino main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 16px 16px 48px; position: relative; z-index: 1; }
.treino :focus-visible { box-shadow: 0 0 0 3px var(--night), 0 0 0 5px var(--sky); }
.treino [tabindex="-1"]:focus, .treino [tabindex="-1"]:focus-visible { outline: none; box-shadow: none; }
.treino .btn-primary { background: var(--orange); color: #1F2044; }
.treino .btn-primary:hover:not(:disabled) { background: #FF8F3D; }
.treino .btn-ghost { background: transparent; color: #FCFCFD; border-color: rgba(255, 255, 255, .45); }
.treino .btn-ghost:hover { background: rgba(255, 255, 255, .08); }
.btn-lg { min-height: 52px; padding: 14px 28px; font-size: 17px; }

/* Formas da capa */
.tr-deco { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.tr-deco span { position: absolute; display: block; border-radius: 28px; }
.tr-deco .d1 { top: 56px; left: 0; width: 70px; height: 170px; border: 3px solid var(--line); border-left: 0; border-radius: 0 28px 28px 0; }
.tr-deco .d2 { top: 40px; right: -40px; width: 120px; height: 120px; background: var(--sky); }
.tr-deco .d3 { top: 420px; right: 0; width: 60px; height: 180px; border: 3px solid var(--line); border-right: 0; border-radius: 28px 0 0 28px; }
.tr-deco .d4 { top: 640px; left: -30px; width: 110px; height: 80px; background: var(--orange); border-radius: 28px 28px 0 0; opacity: .9; }
@media (max-width: 1239px) {
  .tr-deco .d1, .tr-deco .d3, .tr-deco .d4 { display: none; }
}
@media (min-width: 721px) and (max-width: 1239px) {
  .tr-deco .d2 { display: none; }
}
@media (max-width: 720px) {
  .tr-deco .d2 { width: 64px; height: 64px; right: -24px; top: 80px; border-radius: 18px; }
}

/* Barra do topo */
.tr-top { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; justify-content: space-between; padding: 8px 0 24px; }
.tr-brand { margin: 0; font-weight: 700; font-size: 15px; letter-spacing: .01em; color: var(--sky); }
.tr-steps { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; order: 3; flex-basis: 100%; }
.tr-steps li { flex: 1; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .16); }
.tr-steps li.done { background: var(--sky); }
.tr-steps li.current { background: linear-gradient(90deg, var(--orange), #FFB800); }
.tr-score { margin: 0; font-weight: 700; font-size: 15px; padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); font-variant-numeric: tabular-nums; }
.tr-score.bump { animation: bump .5s ease; }
@keyframes bump { 40% { transform: scale(1.15); background: var(--orange); border-color: var(--orange); } }
@media (min-width: 720px) {
  .tr-steps { order: 0; flex-basis: 240px; flex: 0 1 240px; }
}

/* Textos */
.tr-screen { max-width: 760px; }
.tr-kicker { display: inline-block; margin: 0 0 16px; padding: 6px 16px; border: 2px solid var(--orange); border-radius: 999px; color: var(--orange-text); font-weight: 600; font-size: 14px; }
.tr-title { font-size: clamp(32px, 7vw, 56px); line-height: 1.05; margin: 0 0 16px; letter-spacing: -0.03em; }
.tr-title:focus { outline: none; }
.tr-lead { font-size: clamp(17px, 2.4vw, 20px); color: var(--soft); max-width: 640px; line-height: 1.5; }
.tr-tag { display: inline-block; margin: 0 0 16px; font-weight: 600; color: var(--sky); }
.tr-sub { display: block; color: var(--soft); font-size: 14px; font-weight: 400; }
.tr-best { color: var(--soft); font-size: 15px; }
.tr-done-line { display: flex; align-items: center; gap: 8px; color: var(--sky); font-weight: 600; margin-bottom: 20px; }
.tr-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 24px 0; }
.tr-actions:empty { display: none; }

.tr-phase-list { list-style: none; padding: 0; margin: 28px 0 8px; display: grid; gap: 12px; }
.tr-phase-list li { display: flex; gap: 16px; align-items: center; padding: 14px 18px; border-radius: 16px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); }
.tr-phase-list strong { display: block; font-size: 17px; }
.tr-num { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; background: var(--royal); }

/* Carta e opções */
.tr-card { background: #FFFFFF; color: var(--title); border-radius: 24px; padding: 28px 24px; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
.tr-card-text { margin: 0; font-size: clamp(21px, 3.6vw, 28px); line-height: 1.3; letter-spacing: -0.02em; color: var(--title); }
.tr-card-text:focus { outline: none; }
.tr-options { display: grid; gap: 10px; margin-top: 16px; }
@media (min-width: 720px) { .tr-screen > .tr-options { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tr-option {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 12px 16px; text-align: left;
  background: rgba(255, 255, 255, .08); color: #FCFCFD; border: 2px solid rgba(255, 255, 255, .22); border-radius: 14px;
  font-weight: 600; font-size: 16px; line-height: 1.35; cursor: pointer; transition: background-color .15s, border-color .15s, transform .1s;
}
.tr-option:hover:not(:disabled) { background: rgba(255, 255, 255, .14); border-color: var(--sky); }
.tr-option:active:not(:disabled) { transform: scale(.99); }
.tr-option:disabled { cursor: default; opacity: .55; }
.tr-option.right { opacity: 1; background: var(--ok-soft); color: var(--ok); border-color: #12B76A; }
.tr-option.wrong { opacity: 1; background: var(--no-soft); color: var(--no); border-color: #F04438; }
.tr-option-long { font-weight: 500; font-size: 15px; align-items: flex-start; }
.tr-key { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: rgba(255, 255, 255, .14); }
.tr-option.right .tr-key { background: #12B76A; color: #FFFFFF; }
.tr-option.wrong .tr-key { background: #F04438; color: #FFFFFF; }

.tr-feedback { display: none; margin-top: 16px; padding: 16px 18px; border-radius: 14px; background: #FFFFFF; color: var(--text); }
.tr-feedback.show { display: block; animation: rise .25s ease; }
.tr-feedback p { margin: 0 0 6px; }
.tr-feedback p:last-child { margin: 0; }
.tr-feedback .tr-sub { color: var(--muted); }
.tr-verdict { font-weight: 700; font-size: 17px; }
.tr-verdict.ok { color: var(--ok); }
.tr-verdict.no { color: var(--no); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* Fase 2: prompt e conversa */
.tr-screen:has(.tr-split) { max-width: none; }
.tr-split { display: grid; gap: 20px; }
.tr-split > .tr-chat { order: -1; }
@media (min-width: 900px) {
  .tr-split { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
  .tr-split > .tr-chat { order: 0; position: sticky; top: 16px; }
}
.tr-block-title { font-size: 22px; margin: 0 0 4px; }
.tr-block-title:focus { outline: none; }

.tr-chat { background: #EFEAE2; color: #111B21; border-radius: 22px; padding: 16px; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
.tr-chat-head { margin: -16px -16px 14px; padding: 12px 16px; border-radius: 22px 22px 0 0; background: #075E54; color: #FFFFFF; font-weight: 600; font-size: 15px; }
.tr-bubble { max-width: 92%; padding: 8px 12px 10px; border-radius: 12px; margin-bottom: 10px; font-size: 15px; line-height: 1.45; box-shadow: 0 1px 1px rgba(0, 0, 0, .12); }
.tr-bubble.in { background: #FFFFFF; border-top-left-radius: 4px; }
.tr-bubble.out { background: #D9FDD3; margin-left: auto; border-top-right-radius: 4px; }
.tr-bubble.changed { animation: glow 1.2s ease; }
@keyframes glow { 0% { box-shadow: 0 0 0 4px var(--orange); } 100% { box-shadow: 0 1px 1px rgba(0, 0, 0, .12); } }
.tr-who { display: block; font-size: 12px; font-weight: 700; color: #667781; margin-bottom: 2px; }
.tr-note { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 12px; font-size: 14px; color: #3B4A54; }
.tr-note.alert { color: var(--no); font-weight: 600; }
.tr-note .icon { margin-top: 2px; }
.tr-meter span { display: block; font-size: 13px; font-weight: 600; color: #3B4A54; margin-bottom: 6px; }
.tr-meter-bar { height: 10px; border-radius: 999px; background: rgba(0, 0, 0, .1); overflow: hidden; }
.tr-meter-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--orange), #12B76A); transition: width .8s ease; }

.tr-prompt { margin-top: 8px; padding: 16px 18px; border-radius: 16px; background: rgba(255, 255, 255, .06); border: 1px dashed rgba(255, 255, 255, .25); }
.tr-prompt h3 { font-size: 15px; margin: 0 0 10px; color: var(--sky); }
.tr-prompt ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tr-prompt li { font-size: 14px; color: rgba(255, 255, 255, .45); }
.tr-prompt li.filled { color: var(--soft); }
.tr-prompt strong { display: block; font-size: 12px; letter-spacing: .06em; color: rgba(255, 255, 255, .55); }
.tr-prompt li.filled strong { color: var(--orange-text); }

/* Resultado */
.tr-big { font-size: 20px; color: var(--soft); margin: 0 0 8px; }
.tr-big strong { font-size: 56px; color: #FCFCFD; letter-spacing: -0.03em; margin-right: 4px; }
.tr-phase-scores { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 8px; max-width: 520px; }
.tr-phase-scores li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 16px; border-radius: 12px; background: rgba(255, 255, 255, .06); }
.tr-copy-status { color: var(--sky); font-weight: 600; }
.tr-panel { margin-top: 28px; padding: 24px; border-radius: 20px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); }
.tr-panel h2 { font-size: 22px; margin-bottom: 12px; }
.tr-takeaways { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--soft); }
.tr-panel-light { background: #FFFFFF; color: var(--text); border: 0; }
.tr-panel-light h2 { color: var(--title); }
.tr-panel-light .tr-sub { color: var(--muted); margin-bottom: 16px; }
.tr-check { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tr-check li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; }
.tr-check input { flex: none; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--orange); }
.tr-check label { cursor: pointer; }
.tr-check strong { display: block; color: var(--title); }
.tr-check span { color: var(--muted); font-size: 15px; }

.tr-footer { position: relative; z-index: 1; text-align: center; padding: 16px; font-size: 13px; color: rgba(255, 255, 255, .5); }

@media (prefers-reduced-motion: reduce) {
  .tr-score.bump, .tr-feedback.show, .tr-bubble.changed { animation: none; }
  .tr-meter-fill { transition: none; }
}
