/* ================================================================
   Allvoca — 시험지 생성기 (form + printable sheets)
   ================================================================ */

.test-main { padding: 8px 0 96px; }

/* ---------------- form ---------------- */
.test-form {
  background: var(--paper-raised); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 36px 32px;
  max-width: 640px;
}
.tf-field { margin-bottom: 26px; }
.tf-field > label {
  display: block; font-size: 15px; font-weight: 700; margin-bottom: 10px;
}
.tf-hint { font-size: 13px; font-weight: 500; color: var(--ink-faint); margin-left: 6px; }

.tf-field input[type="text"],
.tf-field input[type="number"],
.tf-field select {
  width: 100%; padding: 12px 18px;
  border: 1.5px solid var(--line); border-radius: 10px;
  font-family: var(--font-kr); font-size: 15.5px; font-weight: 500;
  background: var(--paper); color: var(--ink); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.tf-field input:focus, .tf-field select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.tf-field input[type="number"] { font-family: var(--font-latin); font-weight: 700; }

.tf-row { display: flex; gap: 10px; align-items: center; }
.tf-tilde { font-weight: 700; color: var(--ink-faint); flex: none; }

.tf-checks { display: flex; flex-direction: column; gap: 10px; }
.tf-check {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 10px;
  padding: 12px 16px; background: var(--paper);
  transition: border-color .15s;
}
.tf-check:hover { border-color: var(--ink); }
.tf-check input { width: 17px; height: 17px; accent-color: var(--accent); flex: none; }

.tf-error {
  color: #c0272d; font-size: 14.5px; font-weight: 600;
  background: #fdf0f0; border: 1px solid #f3d3d4; border-radius: 10px;
  padding: 12px 16px; margin-bottom: 20px;
}

.tf-actions .btn { width: 100%; justify-content: center; }

/* ---------------- result toolbar ---------------- */
.test-result { margin-top: 40px; }
.tr-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.tr-toolbar .tf-hint { margin-left: 0; flex-basis: 100%; }

/* ---------------- printable sheet (screen preview) ---------------- */
.sheet {
  background: #fff; color: #666;
  border: 1px solid var(--line); border-radius: 4px;
  box-shadow: 0 12px 32px -16px rgba(20, 20, 20, .3);
  width: 210mm; max-width: 100%;
  min-height: 280mm; padding: 14mm 13mm;
  margin: 0 auto 32px;
}

.sheet-header {
  display: flex; justify-content: space-between; align-items: stretch;
  border: 1px solid #333; padding: 12px 16px; margin-bottom: 14px;
}
.sheet-brand .sheet-logo {
  font-family: var(--font-latin); font-weight: 800; font-size: 21px;
  letter-spacing: -0.5px; color: #141414; line-height: 1.2;
}
.sheet-brand .sheet-logo .answer-tag { color: #d11; font-size: 14px; margin-left: 6px; }
.sheet-meta { font-size: 11.5px; margin-top: 6px; line-height: 1.75; }
.sheet-meta b { color: #333; }
.sheet-name {
  display: flex; align-items: flex-end;
  font-size: 17px; font-weight: 800; color: #000;
}

.sheet table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sheet td {
  border: 1px solid #333; height: 41px;
  padding: 3px 8px; vertical-align: middle;
  word-break: break-word; line-height: 1.35;
}
.sheet td.q { width: 21%; }
.sheet td.a { width: 29%; color: #d11; font-weight: 600; }
.sheet td .word-num {
  font-family: var(--font-latin); font-size: 8px; font-weight: 700;
  color: #d11; opacity: .75; margin-left: 4px; white-space: nowrap;
}
.sheet .fs-eng { font-size: 10pt; }
.sheet .fs-kor { font-size: 8pt; }

/* ---------------- print ---------------- */
@page { size: A4 portrait; margin: 0; }

@media print {
  body { background: #fff; }
  body > .site-header, body > main .study-hero, .test-form,
  .tr-toolbar, body > footer { display: none !important; }
  .test-main { padding: 0; max-width: none; margin: 0; }
  .test-result { margin: 0; }
  .sheet {
    border: 0; border-radius: 0; box-shadow: none;
    width: auto; min-height: 0; margin: 0;
    padding: 14mm 13mm;
    break-after: page;
  }
  .sheet:last-child { break-after: auto; }
  .sheet td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------------- responsive ---------------- */
@media (max-width: 860px) {
  .test-form { padding: 26px 20px; }
  .sheet { width: 100%; min-height: 0; padding: 18px 14px; overflow-x: auto; }
  .tr-toolbar .btn { width: 100%; justify-content: center; }
}
