/* ============================================================
   Free trial key request form — shared by the home page and /developers.
   The markup is the same on both pages (ids read by js/access-request.js),
   so its look lives here once instead of as inline styles on one page and
   .keygen-* rules on the other.
   ============================================================ */
.ra {
  --ra-accent: var(--accent, #00d4ff);
  --ra-text2: var(--text2, rgba(192,200,216,0.7));
  --ra-text3: var(--text3, rgba(192,200,216,0.4));
  --ra-line: rgba(255,255,255,0.08);
  --ra-field: rgba(0,0,0,0.35);
  --ra-bad: #ff5d6c;
  background: linear-gradient(180deg, rgba(0,212,255,0.05), rgba(0,212,255,0.015));
  border: 1px solid rgba(0,212,255,0.16);
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 40px;
}
.ra-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 6px; }
.ra-head h3 { margin: 0; font-size: 18px; font-weight: 700; color: #fff; }
.ra-badge {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
  color: var(--ra-accent); background: rgba(0,212,255,0.1);
  border: 1px solid rgba(0,212,255,0.3); border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
.ra-lede { margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: var(--ra-text2); }

/* What an approval hands over. The figures mirror API_TIERS.free in server.js
   and are pinned by test/api-free-trial-key.test.js. */
.ra-trial {
  border: 1px solid var(--ra-line); border-radius: 12px;
  background: rgba(0,0,0,0.25); padding: 18px; margin-bottom: 22px;
}
.ra-trial-head { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 12px; }
.ra-limits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.ra-limit { border: 1px solid var(--ra-line); border-radius: 10px; padding: 10px 12px; background: rgba(255,255,255,0.02); }
.ra-limit code { display: block; font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 700; color: var(--ra-accent); white-space: nowrap; }
.ra-limit span { display: block; font-size: 11px; color: var(--ra-text3); margin-top: 2px; }
.ra-trial p { margin: 0 0 10px; font-size: 13px; line-height: 1.6; color: var(--ra-text2); }
.ra-trial p:last-child { margin-bottom: 0; }
.ra-trial strong { color: #fff; }
.ra-trial a { color: var(--ra-accent); text-decoration: none; white-space: nowrap; }
.ra-eps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0 0 12px; }
.ra-ep {
  display: flex; flex-direction: column; gap: 1px; min-width: 0;
  padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,0.03);
  font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--ra-text2);
}
.ra-ep span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ra-ep span:last-child { font-family: inherit; font-size: 11px; color: var(--ra-text3); }

.ra-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ra-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ra-field.ra-wide { grid-column: 1 / -1; }
.ra-field > span { font-size: 12px; font-weight: 600; color: var(--ra-text2); letter-spacing: 0.2px; }
.ra-field input, .ra-field textarea {
  width: 100%; box-sizing: border-box; padding: 11px 14px;
  background: var(--ra-field); border: 1px solid var(--ra-line); border-radius: 9px;
  color: #fff; font-family: inherit; font-size: 14px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ra-field textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.ra-field input::placeholder, .ra-field textarea::placeholder { color: var(--ra-text3); }
.ra .ra-field input:focus, .ra .ra-field textarea:focus { border-color: rgba(0,212,255,0.5); box-shadow: 0 0 0 3px rgba(0,212,255,0.12); }
/* .ra in front: html.ui-v2 input[type="text"] (css/ui-v2.css) outranks a two-class rule. */
.ra .ra-field.ra-bad input, .ra .ra-field.ra-bad textarea { border-color: rgba(255,93,108,0.6); }
.ra-field small { font-size: 11px; color: var(--ra-text3); }
.ra-field.ra-bad small { color: var(--ra-bad); }

.ra-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.ra-submit {
  padding: 12px 24px; background: var(--ra-accent); color: #000; border: none; border-radius: 9px;
  font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 700; cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
.ra-submit:hover:not(:disabled) { transform: translateY(-1px); }
.ra-submit:disabled { opacity: 0.45; cursor: not-allowed; }
.ra-hint { flex: 1; min-width: 200px; font-size: 12px; color: var(--ra-text3); }

.ra-result {
  display: none; margin-top: 18px; padding: 16px 18px; border-radius: 10px;
  background: rgba(0,212,255,0.08); border: 1px solid rgba(0,212,255,0.3);
  color: var(--ra-accent); font-size: 14px; font-weight: 600;
}
.ra-result small { display: block; margin-top: 4px; font-weight: 400; color: var(--ra-text2); }
.ra-error {
  display: none; margin-top: 14px; padding: 10px 14px; border-radius: 9px; font-size: 13px;
  color: var(--ra-bad); background: rgba(255,93,108,0.08); border: 1px solid rgba(255,93,108,0.3);
}
.ra-note { font-size: 12px; color: var(--ra-text3); margin-top: 16px; }
.ra-note a { color: var(--ra-accent); text-decoration: none; }

@media (max-width: 640px) {
  .ra { padding: 20px 16px; }
  .ra-grid, .ra-eps { grid-template-columns: 1fr; }
  .ra-limits { grid-template-columns: 1fr 1fr; }
  .ra-limit:last-child { grid-column: 1 / -1; }
  .ra-submit { width: 100%; }
}
