/* ── 학습자 화면: 파란색 테마 ── */

body.learner-page,
body.learner-auth,
body.learner-page-preview {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-light: #3b82f6;
  --learner-sky: #e0f2fe;
  --learner-blue: #1e40af;
  --learner-line: #bfdbfe;
  --learner-muted: #475569;
  background:
    radial-gradient(circle at 10% 0%, rgba(37, 99, 235, 0.14), transparent 42%),
    radial-gradient(circle at 90% 100%, rgba(14, 165, 233, 0.12), transparent 40%),
    linear-gradient(165deg, #dbeafe 0%, #eff6ff 45%, #f8fafc 100%);
  min-height: 100vh;
}

/* 줄바꿈: 엔터 입력을 자연스럽게 (br 태그 없이) */
.formatted-text {
  white-space: pre-line;
  line-height: 1.75;
  color: #1e293b;
  word-break: keep-all;
}

/* ── 헤더 ── */
.learner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 55%, #3b82f6 100%);
  color: #fff;
  border-bottom: none;
  box-shadow: 0 4px 20px rgba(30, 64, 175, 0.25);
  position: sticky;
  top: 0;
  z-index: 20;
}

.learner-header .brand-inline {
  color: #fff;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.header-emoji {
  font-size: 1.2rem;
}

.learner-btn-ghost {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.learner-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.25);
  text-decoration: none;
}

.learner-btn-primary,
body.learner-auth .btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: none;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.learner-btn-primary:hover,
body.learner-auth .btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

/* ── 로그인 카드 ── */
body.learner-auth .auth-card.learner-login-card {
  width: min(440px, 100%);
  border: 1px solid var(--learner-line);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(30, 64, 175, 0.12);
  padding: 2rem 1.75rem;
  background: rgba(255, 255, 255, 0.95);
}

.login-hero {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-emoji {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.learner-brand {
  color: var(--learner-blue);
  font-size: 1.65rem;
  margin: 0;
}

.login-subtitle {
  color: var(--learner-muted);
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
}

.label-with-icon {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.learner-form input,
.learner-form select {
  border-color: #cbd5e1;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.learner-form input:focus,
.learner-form select:focus {
  outline: none;
  border-color: var(--brand-light);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.login-hint {
  text-align: center;
  margin-top: 1.25rem;
}

.learner-empty {
  padding: 1.5rem 0;
}

.empty-emoji {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.learner-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.learner-dialog .dialog-emoji {
  font-size: 2rem;
  text-align: center;
  margin: 0 0 0.5rem;
}

/* ── 안내 본문 ── */
.learner-guide {
  width: min(860px, calc(100% - 2rem));
  margin: 1.5rem auto 2.5rem;
  background: #fff;
  border: 1px solid var(--learner-line);
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(30, 64, 175, 0.1);
  overflow: hidden;
}

.course-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1.75rem 1.5rem 1.5rem;
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #0ea5e9 100%);
  color: #fff;
  border-bottom: none;
  position: relative;
  text-align: left;
}

.hero-content {
  min-width: 0;
  text-align: left;
}

.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-illustration {
  width: 120px;
  height: auto;
  opacity: 0.9;
}

.hero-badge {
  display: inline-block;
  margin: 0 0 0.6rem;
  padding: 0.25rem 0.65rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

.course-hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: -0.03em;
  line-height: 1.3;
  color: #fff;
}

.hero-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.hero-meta li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.45;
}

.meta-icon {
  flex-shrink: 0;
  font-size: 1.05rem;
}

.info-section {
  padding: 1.35rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.info-section:last-of-type {
  border-bottom: none;
}

.info-section h2,
.todo-heading {
  margin: 0 0 0.85rem;
  font-size: 1.08rem;
  color: var(--learner-blue);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  text-align: left;
  justify-content: flex-start;
  width: 100%;
}

.section-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.text-block {
  color: #334155;
}

.image-block {
  margin: 0.85rem 0 0;
}

.image-block img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  background: #f1f5f9;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
}

.image-block figcaption {
  margin-top: 0.4rem;
  font-size: 0.88rem;
  color: var(--learner-muted);
}

.contact-section {
  padding: 1.25rem 1.5rem 1.75rem;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
}

.contact-card {
  background: #fff;
  border: 1px solid var(--learner-line);
  border-radius: 14px;
  padding: 1rem 1.15rem;
  margin-bottom: 0.75rem;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.95rem;
  color: #334155;
}

.contact-row + .contact-row {
  margin-top: 0.45rem;
}

.contact-row.muted {
  color: var(--learner-muted);
  font-size: 0.88rem;
}

.contact-icon {
  font-size: 1.1rem;
}

.contact-hint {
  margin: 0;
  font-size: 0.9rem;
  color: var(--learner-muted);
  text-align: center;
}

/* ── TO DO LIST ── */
.todo-section {
  padding: 1.25rem 1.5rem;
  background: linear-gradient(180deg, #f0f9ff, #fff);
  border-bottom: 1px solid #e2e8f0;
}

.todo-heading {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: var(--learner-blue);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-align: left;
  justify-content: flex-start;
  width: 100%;
}

.todo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.todo-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.85rem 1rem;
  border: 1px solid var(--learner-line);
  border-radius: 12px;
  background: #fff;
  text-align: left;
}

.todo-item.todo-done {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.todo-status {
  font-size: 0.82rem;
  color: var(--learner-muted);
  font-weight: 600;
}

.todo-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: baseline;
  margin-bottom: 0.35rem;
}

.todo-title {
  font-size: 1rem;
  color: #0f172a;
}

.todo-due {
  font-size: 0.85rem;
  color: #0369a1;
  background: #e0f2fe;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.todo-content {
  font-size: 0.92rem;
  color: #475569;
}

.todo-actions {
  display: flex;
  align-items: center;
}

.todo-detail {
  list-style: none;
  margin: -0.35rem 0 0.5rem;
  padding: 0;
}

.todo-detail-card {
  border: 1px dashed var(--learner-line);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  background: #f8fbff;
}

.todo-type-badge {
  font-size: 0.78rem;
  color: #1d4ed8;
  background: #e0edff;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}

.todo-status-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.todo-review-note {
  font-size: 0.82rem;
  color: #334155;
}

/* ── 설문조사 ── */
.survey-section .survey-form {
  display: grid;
  gap: 1rem;
}

.survey-question textarea {
  min-height: 80px;
}

.survey-q-label {
  font-weight: 600;
  margin: 0 0 0.5rem;
  text-align: left;
}

.required-mark {
  color: #dc2626;
}

.survey-options {
  display: grid;
  gap: 0.45rem;
}

.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.95rem;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  text-align: left;
}

.option-row input {
  margin: 0;
}

.survey-alert {
  margin-bottom: 1rem;
}

.survey-done-msg {
  margin: 0 0 1rem;
  color: var(--learner-blue);
  font-weight: 600;
}

.survey-review {
  padding: 0.75rem 0;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.survey-review:last-child {
  border-bottom: none;
}

.alert-ok {
  background: #e8f6ec;
  color: #1f6b3a;
  border-radius: 10px;
  padding: 0.75rem 1rem;
}

.alert-error {
  background: #fdecec;
  color: #a12828;
  border-radius: 10px;
  padding: 0.75rem 1rem;
}

/* ── 반응형 ── */
@media (max-width: 640px) {
  .course-hero {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .hero-content {
    text-align: left;
  }

  .hero-visual {
    order: -1;
    justify-content: flex-start;
  }

  .hero-illustration {
    width: 90px;
  }

  .hero-meta li {
    justify-content: flex-start;
  }

  .learner-guide {
    margin: 1rem auto 2rem;
    border-radius: 16px;
  }
}
