/* ============================================
   Rigora, Table 1 generator.
   Builds on the design tokens in style.css. No token is redefined here.
   ============================================ */

/* ---- Hero trust row ---- */
.t1-trust { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 22px; }
.t1-trust-item { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-sm); color: var(--text-secondary); }
.t1-trust-item svg { flex: none; color: var(--success); }

/* ---- Tool shell ---- */
.t1-tool { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-md); overflow: hidden; }
.t1-step { padding: 28px; border-top: 1px solid var(--border-light); }
.t1-step:first-child { border-top: none; }
#configStep, #resultStep { display: none; }
.t1-step-h { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.t1-step-h h2 { font-size: var(--text-lg); margin: 0; }
.t1-step-n { font-family: var(--font-serif); font-size: 14px; font-weight: var(--weight-bold); color: #fff; background: var(--primary);
  width: 27px; height: 27px; border-radius: 999px; display: flex; align-items: center; justify-content: center; flex: none; position: relative; top: 2px; }
.t1-sub { font-size: var(--text-xs); color: var(--text-muted); margin-left: auto; }
.t1-lbl { display: block; font-size: 13px; font-weight: var(--weight-semibold); color: var(--text-secondary); margin-bottom: 7px; }

#dataInput { min-height: 132px; resize: vertical; font-family: var(--font-mono); font-size: 13px; line-height: 1.5; white-space: pre; overflow: auto; }
.t1-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.t1-parsed { display: none; align-items: center; gap: 8px; margin-top: 14px; font-size: var(--text-sm); color: var(--text-secondary); }
.t1-parsed.is-on { display: flex; }
.t1-parsed b { color: var(--text); }
.t1-err { display: none; margin-top: 12px; font-size: var(--text-sm); color: var(--danger); }
.t1-err.is-on { display: block; }

/* ---- Config ---- */
.t1-cfg { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .t1-cfg { grid-template-columns: 1fr; } }
.t1-opts { display: flex; flex-direction: column; gap: 16px; }
.t1-varbox { border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--bg-subtle); max-height: 380px; overflow: auto; }
.t1-varrow { display: flex; align-items: center; gap: 11px; padding: 9px 13px; border-bottom: 1px solid var(--border-light);
  background: transparent; will-change: transform;
  transition: box-shadow .2s var(--ease), scale .18s var(--ease), background .25s var(--ease); }
.t1-varrow:last-child { border-bottom: none; }
.t1-varrow input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.t1-vname { flex: 1; min-width: 0; font-size: 14px; font-weight: var(--weight-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t1-varrow select { width: auto; padding: 5px 28px 5px 10px; font-size: 12.5px; border-radius: var(--radius-sm); }
.t1-varrow.is-excluded .t1-vname { color: var(--text-muted); text-decoration: line-through; }

.t1-grip { display: flex; align-items: center; flex: none; padding: 3px 1px; border-radius: 4px;
  color: var(--text-muted); cursor: grab; touch-action: none; transition: color .18s var(--ease); }
.t1-grip:hover { color: var(--accent); }
.t1-grip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.t1-varrow.is-shifting { transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .2s var(--ease), scale .18s var(--ease); }
.t1-varrow.is-dragging { position: relative; z-index: 20; background: var(--bg); border-radius: 8px; border-bottom-color: transparent;
  scale: 1.015; box-shadow: 0 12px 30px rgba(15,38,48,.18), 0 2px 6px rgba(15,38,48,.08); cursor: grabbing; }
.t1-varrow.is-dragging .t1-grip { cursor: grabbing; color: var(--accent); }
.t1-varrow.just-dropped { animation: t1Settle .5s cubic-bezier(.2,.8,.2,1); }
@keyframes t1Settle { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
body.t1-reordering, body.t1-reordering * { user-select: none; -webkit-user-select: none; }
body.t1-reordering { cursor: grabbing; }

.t1-toggle { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; }
.t1-switch { width: 42px; height: 24px; border-radius: 999px; background: var(--border); flex: none; position: relative; margin-top: 1px; transition: background .2s var(--ease); }
.t1-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .2s var(--ease); }
input[type=checkbox].t1-sw { position: absolute; opacity: 0; pointer-events: none; }
input[type=checkbox].t1-sw:checked + .t1-switch { background: var(--accent); }
input[type=checkbox].t1-sw:checked + .t1-switch::after { left: 21px; }
input[type=checkbox].t1-sw:focus-visible + .t1-switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.t1-toggle-txt b { display: block; font-size: 14px; }
.t1-toggle-txt span { font-size: 12.5px; color: var(--text-muted); }
.t1-note { display: none; gap: 9px; align-items: flex-start; font-size: 12.5px; color: var(--text-secondary);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent); border-radius: var(--radius); padding: 11px 13px; }
.t1-note.is-on { display: flex; }
.t1-note svg { flex: none; color: var(--accent-ink); margin-top: 1px; }
.t1-genrow { display: flex; justify-content: flex-end; margin-top: 22px; }

/* ---- Result ---- */
.t1-result-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px 28px; border-top: 1px solid var(--border-light); }
.t1-result-head h2 { font-size: var(--text-lg); margin: 0; }
.t1-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.t1-confirm { display: none; align-items: center; gap: 9px; padding: 2px 28px 4px; font-size: var(--text-sm); color: var(--success); }
.is-revealed .t1-confirm { display: flex; }
.t1-tablecard { position: relative; padding: 28px 28px 6px; }
.t1-journal { overflow-x: auto; }
.t1-cap { font-family: var(--font-serif); font-size: var(--text-base); color: var(--text); margin-bottom: 14px; }

table.t1-table { border-collapse: collapse; width: 100%; min-width: 540px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
table.t1-table thead th { font-family: var(--font-sans); font-weight: var(--weight-bold); color: var(--text); text-align: right;
  padding: 9px 12px; border-top: 2px solid var(--text); border-bottom: 1px solid #B9C3CF; vertical-align: bottom; white-space: nowrap; }
table.t1-table thead th:first-child { text-align: left; }
table.t1-table thead th small { display: block; font-weight: 500; color: var(--text-muted); font-size: 11.5px; }
table.t1-table td { padding: 7px 12px; text-align: right; border-bottom: 1px solid var(--border-light); color: var(--text-secondary); }
table.t1-table td:first-child { text-align: left; color: var(--text); }
table.t1-table tr.t1-varhead td:first-child { font-weight: var(--weight-semibold); color: var(--text); }
table.t1-table tr.t1-level td:first-child { padding-left: 26px; color: var(--text-secondary); }
table.t1-table tr.t1-last td { border-bottom: 2px solid var(--text); }
table.t1-table td.t1-pv { color: var(--text); }
.t1-foot { padding: 14px 28px 24px; max-width: 80ch; font-size: 12px; line-height: 1.6; color: var(--text-muted); }
.t1-foot b { color: var(--text-secondary); }

/* ---- Email gate ---- */
.t1-blur { filter: blur(7px); opacity: .65; pointer-events: none; user-select: none; transition: filter .5s var(--ease), opacity .5s var(--ease); }
.is-revealed .t1-blur { filter: none; opacity: 1; }
.t1-gate { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; z-index: 5; }
.is-revealed .t1-gate { display: none; }
.t1-gate-card { width: 100%; max-width: 452px; padding: 30px 28px; text-align: center;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.t1-lock { width: 48px; height: 48px; margin: 0 auto 14px; border-radius: var(--radius-lg); background: var(--accent-soft); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center; }
.t1-gate-card h3 { font-size: var(--text-xl); margin-bottom: 8px; }
.t1-sum { font-size: var(--text-sm); color: var(--text-secondary); margin-bottom: 18px; }
.t1-sum b { color: var(--text); }
.t1-gate-form { display: flex; flex-direction: column; gap: 10px; }
.t1-gate-form input { text-align: center; font-size: 15px; padding: 13px; }
#codeInput { font-family: var(--font-mono); font-size: 20px; font-weight: var(--weight-semibold); letter-spacing: .5em; padding: 14px; }
.t1-suggest { display: none; text-align: left; font-size: 13px; color: var(--text-secondary);
  background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 12px; }
.t1-suggest.is-on { display: block; }
.t1-suggest b { color: var(--accent-ink); cursor: pointer; text-decoration: underline; }
.t1-gate-err { min-height: 0; text-align: center; font-size: 13px; color: var(--danger); }
.t1-priv { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 13px; font-size: 12px; color: var(--text-muted); }
.t1-priv svg { flex: none; color: var(--success); }
.t1-badge { display: inline-block; margin-bottom: 6px; font-size: 11px; font-weight: var(--weight-bold); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.t1-back { display: flex; justify-content: space-between; margin-top: 8px; }
.t1-back button { background: none; border: none; padding: 0; font-family: inherit; font-size: 12.5px; font-weight: var(--weight-semibold); color: var(--primary-light); cursor: pointer; }
.t1-back button:hover { text-decoration: underline; }

/* ---- Why cards ---- */
.t1-why { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 28px; }
@media (max-width: 760px) { .t1-why { grid-template-columns: 1fr; } }
.t1-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.t1-k { font-size: 11.5px; font-weight: var(--weight-bold); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); }
.t1-card h3 { font-family: var(--font-sans); font-size: 16.5px; font-weight: var(--weight-bold); margin: 11px 0 7px; }
.t1-card p { font-size: 14px; color: var(--text-secondary); line-height: var(--leading-body); }

/* ---- CTA ---- */
.t1-cta { background: var(--primary); color: #fff; border-radius: var(--radius-xl); padding: clamp(32px, 5vw, 52px); }
.t1-cta .section-tag { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; }
.t1-cta h2 { color: #fff; max-width: 24ch; }
.t1-cta p { margin-top: 16px; max-width: 60ch; font-size: var(--text-md); line-height: var(--leading-body); color: rgba(255,255,255,.82); }
.t1-cta-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.t1-cta .btn-outline { color: #fff; border-color: rgba(255,255,255,.4); }
.t1-cta .btn-outline:hover { background: #fff; color: var(--primary); border-color: #fff; }

/* ---- FAQ ---- */
.t1-faq { border-top: 1px solid var(--border); }
.t1-faq details { border-bottom: 1px solid var(--border); }
.t1-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 2px;
  font-weight: var(--weight-semibold); font-size: 16px; cursor: pointer; list-style: none; }
.t1-faq summary::-webkit-details-marker { display: none; }
.t1-plus { position: relative; flex: none; width: 22px; height: 22px; }
.t1-plus::before, .t1-plus::after { content: ""; position: absolute; background: var(--accent-ink); border-radius: 2px; }
.t1-plus::before { top: 10px; left: 2px; right: 2px; height: 2px; }
.t1-plus::after { left: 10px; top: 2px; bottom: 2px; width: 2px; transition: opacity .2s var(--ease); }
.t1-faq details[open] .t1-plus::after { opacity: 0; }
.t1-faq details p { padding: 0 2px 20px; max-width: 76ch; font-size: 14.5px; color: var(--text-secondary); line-height: var(--leading-body); }

@media (prefers-reduced-motion: reduce) {
  .t1-varrow.is-shifting { transition: none; }
  .t1-varrow.just-dropped { animation: none; }
}

@media print {
  .navbar, .t1-result-head .t1-actions, .t1-gate, .t1-confirm, .footer, .section.bg-subtle, .t1-cta { display: none !important; }
  .t1-tool { border: none; box-shadow: none; }
  .t1-blur { filter: none !important; opacity: 1 !important; }
  .t1-tablecard { padding: 0; }
}
