/* Tryouts: landing de convocatorias + formulario de postulación.
   Usa los tokens de assets/css/tokens.css. */

/* ── Landing ─────────────────────────────────────────────────────── */
.tryout-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.tryout-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--sp-3);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--t-base), transform var(--t-base);
}
.tryout-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}
.tryout-card__main { min-width: 0; }
.tryout-card__team {
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-red);
  margin: 0;
  font-weight: 600;
}
.tryout-card__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--text-1);
  margin: 0 0 8px;
}
.tryout-card__intro {
  font-size: .9rem;
  color: var(--text-2);
  margin: 0 0 12px;
  max-width: 60ch;
}
.tryout-card__info {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  align-items: start;
  gap: 7px 28px;
}
.tryout-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  color: var(--text-3);
}
.tryout-info-row__icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--text-3);
  opacity: .75;
}
.tryout-card__reqs {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--border);
}
.tryout-info-row--label span:last-child { font-weight: 600; color: var(--text-2); }
.tryout-reqs {
  margin: 0;
  padding: 0;
  list-style-position: inside;
  color: var(--text-2);
  line-height: 1.75;
}
.tryout-reqs--card {
  list-style: none;
  padding-left: 22px;
  margin: 6px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tryout-reqs--card li {
  position: relative;
  font-size: .8rem;
  color: var(--text-3);
  line-height: 1.4;
}
.tryout-reqs--card li::before {
  content: '';
  position: absolute;
  left: -14px;
  top: .5em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-3);
  opacity: .6;
}
.tryout-card__side {
  display: flex;
  align-items: center;
}
.tryout-card__cta {
  font-size: .85rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent-red);
  border: 1px solid var(--accent-red);
  border-radius: var(--radius-btn);
  padding: 8px 18px;
  white-space: nowrap;
}
.tryout-card:hover .tryout-card__cta { background: var(--accent-red-hover); border-color: var(--accent-red-hover); }

.tryout-empty,
.tryout-notice {
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--sp-6) var(--sp-3);
}
.tryout-empty h2,
.tryout-notice h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-1);
  margin: 0 0 10px;
}
.tryout-empty p,
.tryout-notice p {
  color: var(--text-2);
  margin: 0 auto var(--sp-3);
  max-width: 52ch;
}

/* ── Detalle + formulario ──────────────────────────────────────────
   Sin max-width propio: usa el ancho de .container como el resto del sitio.
   El padding-top de .section genérico (128px) es para secciones sueltas; aquí
   ya viene precedido del propio padding del hero, así que sobra casi todo.
   Ojo: <main> se interpone entre .form-banner y .section, así que el
   combinador '+' no basta; hay que apuntar al descendiente dentro de main. */
.form-banner + main .section { padding-top: var(--sp-4); }

.tryout-brief {
  display: grid;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
/* Aquí sí cabe todo en una columna: no hace falta repartir en varias como en la tarjeta. */
.tryout-brief .tryout-card__info { grid-template-columns: 1fr; max-width: 420px; }
.tryout-status {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-card);
  padding: var(--sp-2);
  margin-bottom: var(--sp-3);
  font-size: .88rem;
  color: var(--text-2);
}
.tryout-status strong { display: block; color: var(--text-1); margin-bottom: 2px; }
.tryout-status__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
  background: var(--text-3);
}

.tryout-section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-1);
  margin: var(--sp-4) 0 14px;
}
.tryout-section-title:first-of-type { margin-top: 0; }

.tryout-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--bg-card);
  padding: var(--sp-3);
  margin: 0 0 var(--sp-3);
}

.tryout-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}
.tryout-field { display: block; margin-bottom: var(--sp-2); }
.tryout-field > span {
  display: block;
  font-size: .82rem;
  color: var(--text-2);
  margin-bottom: 6px;
}
.tryout-field input,
.tryout-field select,
.tryout-field textarea {
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-btn);
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: .9rem;
  padding: 10px 12px;
  transition: border-color var(--t-fast);
}
.tryout-field input:focus,
.tryout-field select:focus,
.tryout-field textarea:focus {
  outline: none;
  border-color: var(--accent-red);
}
.tryout-field textarea { resize: vertical; }
.tryout-field--sm { max-width: 140px; }
.tryout-field input[readonly] {
  background: rgba(255,255,255,.02);
  color: var(--text-2);
  cursor: default;
  border-style: dashed;
}
.tryout-field input[readonly]:focus { border-color: var(--border-mid); }
.tryout-field .tryout-help { margin: 6px 0 0; }
.tryout-field .tryout-help a { color: var(--text-2); text-decoration: underline; }

/* Vínculo de Discord: lo gestiona Krown ID, aquí solo se muestra o se lanza */
.discord-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border-radius: var(--radius-btn);
  padding: 10px 14px;
  font-size: .88rem;
  border: 1px solid var(--border-mid);
  background: var(--bg-dark);
  color: var(--text-2);
  width: 100%;
}
.discord-chip.is-linked { border-color: rgba(88,101,242,.45); color: var(--text-1); }
.discord-chip.is-linked svg { color: #5865F2; }
.discord-chip strong { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.discord-chip a { font-size: .78rem; color: var(--text-3); text-decoration: underline; flex-shrink: 0; }
.discord-chip a:hover { color: var(--text-1); }
.discord-chip--cta {
  background: #5865F2;
  border-color: #5865F2;
  color: #fff;
  font-weight: 600;
  justify-content: center;
  transition: background var(--t-fast);
}
.discord-chip--cta:hover { background: #4752c4; }

.tryout-label {
  font-size: .82rem;
  color: var(--text-2);
  margin: 0 0 6px;
}
.tryout-help {
  display: block;
  font-size: .76rem;
  color: var(--text-3);
  font-style: normal;
  margin: 0 0 10px;
}

.tryout-checks { display: flex; flex-wrap: wrap; gap: 10px; }
.tryout-check {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  font-size: .86rem;
  color: var(--text-2);
  cursor: pointer;
  line-height: 1.5;
}
.tryout-check input[type="checkbox"],
.tryout-check input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 19px;
  height: 19px;
  margin-top: 2px;
  flex-shrink: 0;
  border: 1.5px solid var(--border-mid);
  background: var(--bg-card);
  cursor: pointer;
  position: relative;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.tryout-check input[type="checkbox"] { border-radius: 5px; }
.tryout-check input[type="radio"] { border-radius: 50%; }
.tryout-check input[type="checkbox"]:hover,
.tryout-check input[type="radio"]:hover { border-color: var(--accent-red); }
.tryout-check input[type="checkbox"]:checked,
.tryout-check input[type="radio"]:checked {
  background: var(--accent-red);
  border-color: var(--accent-red);
  transform: scale(1.04);
}
.tryout-check input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  inset: 3.5px;
  background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 12.5 9.5 18 20 5.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 12.5 9.5 18 20 5.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.tryout-check input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  inset: 5.5px;
  border-radius: 50%;
  background: #fff;
}
.tryout-check input:focus-visible {
  outline: 2px solid var(--accent-red);
  outline-offset: 2px;
}

/* Selector de agentes: cuatro niveles por agente, como el Excel original */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.pool-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0 0 16px;
  font-size: .76rem;
  color: var(--text-3);
}
.pool-legend__item { display: inline-flex; align-items: center; gap: 7px; }
.pool-dot {
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 5px;
  font-style: normal;
  font-size: .78rem;
  line-height: 1;
  flex-shrink: 0;
}
.pool-dot svg, .pool-opt svg { width: 12px; height: 12px; display: block; }
.pool-dot[data-level="experto"] { background: rgba(245,158,11,.16); color: #f59e0b; }
.pool-dot[data-level="bueno"]   { background: rgba(34,197,94,.16);  color: #22c55e; }
.pool-dot[data-level="abierto"] { background: rgba(156,163,175,.16); color: #9CA3AF; }
.pool-dot[data-level="no"]      { background: rgba(239,68,68,.16);  color: #ef4444; }

.agent-pool { display: grid; gap: var(--sp-3); }
.agent-pool__role {
  font-size: .74rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.agent-pool__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.agent-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 4px 6px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-btn);
  transition: border-color var(--t-fast), background var(--t-fast);
  text-align: center;
}
.agent-tile img { border-radius: 6px; opacity: .4; transition: opacity var(--t-fast); }
.agent-tile__name { font-size: .68rem; color: var(--text-3); }
.agent-tile[data-level="experto"] { border-color: rgba(245,158,11,.5); background: rgba(245,158,11,.08); }
.agent-tile[data-level="bueno"]   { border-color: rgba(34,197,94,.5);  background: rgba(34,197,94,.08); }
.agent-tile[data-level="abierto"] { border-color: var(--border-hover); }
.agent-tile[data-level="no"]      { border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.05); }
.agent-tile[data-level="experto"] img,
.agent-tile[data-level="bueno"] img   { opacity: 1; }
.agent-tile[data-level="abierto"] img { opacity: .7; }
.agent-tile[data-level="experto"] .agent-tile__name,
.agent-tile[data-level="bueno"] .agent-tile__name { color: var(--text-1); }

.agent-tile__levels { display: flex; gap: 3px; }
.pool-opt {
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-mid);
  border-radius: 4px;
  font-size: .72rem;
  line-height: 1;
  color: var(--text-3);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.pool-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pool-opt:hover { border-color: var(--border-hover); color: var(--text-1); }
.pool-opt:focus-within { outline: 2px solid var(--accent-red); outline-offset: 1px; }
.pool-opt.is-on[data-level="experto"] { background: #f59e0b; border-color: #f59e0b; color: #111; }
.pool-opt.is-on[data-level="bueno"]   { background: #22c55e; border-color: #22c55e; color: #111; }
.pool-opt.is-on[data-level="abierto"] { background: #9CA3AF; border-color: #9CA3AF; color: #111; }
.pool-opt.is-on[data-level="no"]      { background: #ef4444; border-color: #ef4444; color: #fff; }

/* Rejilla de disponibilidad */
.avail-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.avail-btn {
  background: var(--bg-dark);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-btn);
  color: var(--text-2);
  font-size: .76rem;
  padding: 5px 12px;
  transition: border-color var(--t-fast), color var(--t-fast);
}
.avail-btn:hover { border-color: var(--border-hover); color: var(--text-1); }
.avail-hint { font-size: .74rem; color: var(--text-3); }

.avail-grid-wrap { overflow-x: auto; }
.avail-grid { border-collapse: collapse; user-select: none; }
.avail-grid th { padding: 2px; }
.avail-grid td { padding: 0; }
.avail-head {
  width: 100%;
  background: none;
  border: 0;
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-3);
  padding: 4px 6px;
  white-space: nowrap;
  border-radius: 4px;
  transition: background var(--t-fast), color var(--t-fast);
}
.avail-head:hover { background: var(--bg-card-alt); color: var(--text-1); }
.avail-cell {
  display: block;
  width: 52px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--border-mid);
  background: var(--bg-dark);
  cursor: pointer;
  transition: background var(--t-fast);
}
.avail-cell:hover { background: var(--bg-card-alt); }
.avail-cell.is-on { background: var(--accent-red); border-color: var(--bg-dark); }
.avail-cell.is-on:hover { background: var(--accent-red-hover); }
.avail-cell:focus-visible { outline: 2px solid var(--text-1); outline-offset: -2px; }

/* Honeypot: fuera de pantalla pero no display:none, que algunos bots lo detectan. */
.form-honey {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.tryout-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.tryout-feedback { margin: 0; font-size: .86rem; min-height: 1.2em; }
.tryout-feedback.is-ok  { color: #10b981; }
.tryout-feedback.is-err { color: #ef4444; }

/* Error de validación: mismo shake que el login de Krown ID */
@keyframes tryout-shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(5px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(3px); }
}
.is-shaking { animation: tryout-shake 320ms ease; }
.is-shaking,
.is-shaking input,
.is-shaking select,
.is-shaking textarea { border-color: var(--accent-red) !important; }

@media (max-width: 720px) {
  .tryout-row { grid-template-columns: 1fr; }
  .avail-cell { width: 38px; }
  .agent-pool__grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
}
