/* 시험계획 Mini App 스타일. styles.css의 변수를 재사용 (별도 import 불필요 —
   plan.html이 styles.css + plan.css 둘 다 로드). */

:root {
  --plan-card-bg: #ffffff;
  --plan-card-shadow: 0 1px 3px rgba(15, 118, 110, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --plan-success: #16a34a;
  --plan-warn: #d97706;
  --plan-bar-track: #e6efed;
}

.plan-shell {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px;
  font-size: 15px;
  line-height: 1.5;
}

.plan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.plan-header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

.plan-header .logout-btn {
  background: var(--plan-bar-track);
  color: var(--muted);
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
}

/* 진행률 대시보드 */
.dashboard {
  background: var(--plan-card-bg);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--plan-card-shadow);
  margin-bottom: 16px;
}

.dashboard-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}

.dashboard-overall {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
}

.dashboard-overall .pct {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}

.dashboard-overall .label {
  font-size: 13px;
  color: var(--muted);
}

.open-editor-btn {
  display: block;
  width: 100%;
  margin: 8px 0 12px;
  padding: 10px 12px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.section-progress {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.section-progress-row {
  display: grid;
  grid-template-columns: 110px 1fr 36px;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.section-progress-row .name {
  color: var(--ink);
  font-weight: 500;
}

.section-progress-row .bar {
  background: var(--plan-bar-track);
  border-radius: 6px;
  height: 8px;
  overflow: hidden;
}

.section-progress-row .bar-fill {
  background: var(--accent);
  height: 100%;
  transition: width 0.4s ease;
}

.section-progress-row .pct {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

.d-day-card {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 12px;
  font-size: 14px;
}

.d-day-card .label {
  font-size: 12px;
  color: var(--plan-warn);
  font-weight: 600;
}

.d-day-card .value {
  font-size: 18px;
  font-weight: 700;
  color: #78350f;
}

/* 다음 카드 CTA */
.cta-card {
  background: var(--plan-card-bg);
  border-radius: 12px;
  padding: 18px 16px;
  box-shadow: var(--plan-card-shadow);
  margin-bottom: 16px;
  text-align: center;
}

.cta-card h2 {
  margin: 0 0 6px;
  font-size: 17px;
  color: var(--accent);
}

.cta-card p {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--muted);
}

.cta-card button {
  width: 100%;
  min-height: 44px;
  font-size: 15px;
}

/* 질문/카드 폼 */
.q-card {
  background: var(--plan-card-bg);
  border-radius: 12px;
  padding: 18px 16px;
  box-shadow: var(--plan-card-shadow);
  margin-bottom: 16px;
}

.q-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  gap: 8px;
}

.q-card-header .subject {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
}

.q-card-header .progress-hint {
  font-size: 12px;
  color: var(--muted);
}

.q-field {
  margin-bottom: 14px;
}

.q-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--ink);
}

.q-field label .required {
  color: var(--danger);
  margin-left: 2px;
}

.q-field input[type="text"],
.q-field input[type="number"],
.q-field input[type="date"],
.q-field input[type="time"],
.q-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  background: var(--plan-card-bg);
  color: var(--ink);
}

.q-field input:focus,
.q-field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}

.q-field input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.q-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.q-actions button {
  flex: 1;
  min-height: 42px;
}

.q-actions button.secondary {
  flex: 0 0 auto;
  padding: 0 14px;
}

/* 토스트 메시지 */
.toast {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.3);
  z-index: 100;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: calc(100vw - 32px);
}

.toast.show {
  opacity: 1;
}

/* 빈 사이클 안내 */
.empty-state {
  text-align: center;
  padding: 32px 20px;
  background: var(--plan-card-bg);
  border-radius: 12px;
  box-shadow: var(--plan-card-shadow);
}

.empty-state h2 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--accent);
}

.empty-state p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.empty-state input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  margin-bottom: 10px;
}

/* 로딩 인디케이터 */
.loading {
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: 14px;
}

/* 섹션 네비게이션 바 (대시보드 하단) */
.section-nav {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.section-nav button {
  background: var(--plan-bar-track);
  color: var(--ink);
  min-height: 36px;
  font-size: 13px;
  font-weight: 600;
  padding: 0 8px;
}

.section-nav button.complete {
  background: #d1fae5;
  color: #065f46;
}

/* 인터뷰 Q&A 카드 안 — 답답할 때 표로 탈출 */
.escape-to-editor {
  display: block;
  margin-top: 14px;
  padding: 10px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  border: 1px dashed var(--line, #e0e6eb);
  border-radius: 8px;
  background: #f8faf9;
  transition: color .12s ease, border-color .12s ease, background .12s ease;
}
.escape-to-editor:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: #ecfdf5;
}
