/* ============================================
   내신 등급 계산기 전용 스타일
   ============================================ */

/* 폼 레이아웃 */
.naeshin-form,
.target-form {
  background: var(--glass-bg, rgba(255,255,255,0.9));
  border: 1px solid var(--glass-border, #E0DED6);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.naeshin-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.naeshin-field label {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary, #1e293b);
}

html.dark .naeshin-field label { color: #e2e8f0; }

.score-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.score-input-wrap .form-input {
  flex: 1;
}

.input-suffix {
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  white-space: nowrap;
}

/* 결과 카드 */
.naeshin-result-card {
  background: var(--glass-bg, rgba(255,255,255,0.9));
  border: 1px solid var(--glass-border, #E0DED6);
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  margin-top: 1.5rem;
}

.naeshin-grade-display {
  font-size: 4.5rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.naeshin-grade-display.grade-top    { color: #15803d; }
.naeshin-grade-display.grade-good   { color: #2563eb; }
.naeshin-grade-display.grade-mid    { color: #d97706; }
.naeshin-grade-display.grade-low    { color: #dc2626; }

.naeshin-percentile {
  font-size: 1rem;
  color: var(--text-secondary, #64748b);
  line-height: 1.7;
  margin-top: 0.5rem;
}

.naeshin-percentile strong {
  color: var(--text-primary, #1e293b);
  font-weight: 700;
}

html.dark .naeshin-percentile strong { color: #e2e8f0; }

.percentile-bar-wrap {
  margin: 1rem auto 0;
  max-width: 360px;
}

.percentile-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary, #94a3b8);
  margin-bottom: 0.25rem;
}

.percentile-bar-track {
  height: 10px;
  background: #e2e8f0;
  border-radius: 5px;
  overflow: hidden;
}

html.dark .percentile-bar-track { background: #334155; }

.percentile-bar-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, #D97757, #E8A080);
  transition: width 0.5s ease;
}

/* 목표 등급 역산 */
.target-result {
  margin-top: 1.25rem;
  background: rgba(217,119,87,0.1);
  border: 1px solid rgba(217,119,87,0.3);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  color: var(--text-primary, #1e293b);
  line-height: 1.6;
}

html.dark .target-result { color: #e2e8f0; }

.target-result strong {
  color: #D97757;
  font-size: 1.125rem;
}

/* 등급 테이블 */
.naeshin-table-wrap {
  overflow-x: auto;
}

.naeshin-table {
  min-width: 500px;
}

.table-note {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary, #64748b);
}

/* 등급 셀 색상 */
.grade-cell { font-weight: 700; text-align: center; }
.grade-cell.g1 { color: #15803d; }
.grade-cell.g2 { color: #16a34a; }
.grade-cell.g3 { color: #2563eb; }
.grade-cell.g4 { color: #3b82f6; }
.grade-cell.g5 { color: #d97706; }
.grade-cell.g6 { color: #f59e0b; }
.grade-cell.g7 { color: #dc2626; }
.grade-cell.g8 { color: #b91c1c; }
.grade-cell.g9 { color: #7f1d1d; }

/* FAQ */
.faq-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: var(--glass-bg, rgba(255,255,255,0.9));
  border: 1px solid var(--glass-border, #E0DED6);
  border-radius: 0.75rem;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 1rem 1.25rem;
  background: transparent;
  border: none;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

html.dark .faq-question { color: #e2e8f0; }

.faq-question:hover { color: #D97757; }

.faq-answer {
  display: none;
  padding: 0 1.25rem 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary, #64748b);
  line-height: 1.7;
}

.faq-item.open .faq-answer { display: block; }

.faq-item.open .faq-question i { transform: rotate(180deg); }

.faq-question i { transition: transform 0.2s; }

@media (max-width: 768px) {
  .naeshin-grade-display { font-size: 3rem; }
}
