/*
Theme Name: KITT Minimal
Author: KITT
Version: 1.0
*/
:root {
  --kitt-color-correct: #2563eb; /* 正解・完了：青系 */
  --kitt-color-retry: #ea580c;   /* 再挑戦・注意：オレンジ系 */
  --kitt-color-hint: #93c5fd;    /* ヒント：薄青 */

  --kitt-color-bg-correct: #eff6ff; /* 正解・完了背景 */
  --kitt-color-bg-retry: #fff7ed;   /* 再挑戦・注意背景 */
  --kitt-color-bg-hint: #f0f9ff;    /* ヒント背景 */
}

body {
  margin: 40px;
  background-color: #f0f0f0;
  font-family: sans-serif;
}

h1 {
  font-size: 32px;
}

h2 {
  color: #333;
}

/* ========================================
   KITT Lesson Base
======================================== */

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.container > h1 {
  margin-bottom: 32px;
}

/* 現テンプレート上では未使用の可能性あり。
   本番前の全面整理までは削除せず保留。 */
.kitt-lesson-container {
  max-width: 800px;
}

/* ========================================
   KITT Lesson Layout / Step Nav
======================================== */

.kitt-lesson-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.kitt-step-nav {
  width: 140px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.kitt-step-nav button {
  display: flex;
  width: 100%;
  padding: 12px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  transition: all 0.2s ease;
}

.kitt-step-nav-label {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.kitt-step-nav-state {
  font-size: 12px;
  line-height: 1.2;
  opacity: 0.9;
}

.kitt-step-nav button.is-current {
  background: #222;
  color: #fff;
  border-color: #222;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

.kitt-step-nav button.is-done {
  background: #e8f7e8;
  color: #1f6b1f;
  border-color: #b7e0b7;
}

.kitt-step-nav button.is-done .kitt-step-nav-state::before {
  content: "✓ ";
  font-weight: 700;
}

.kitt-step-nav button.is-upcoming {
  background: #ffffff;
  color: #667085;
  border-color: #d0d5dd;
}

.kitt-step-nav button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.kitt-lesson-main {
  flex: 1;
  min-width: 0;
  margin-top: 8px;
}

/* ========================================
   KITT Progress Bar
======================================== */

.kitt-progress-wrap {
  margin-top: -8px;
  margin-bottom: 16px;
}

.kitt-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.kitt-progress-step-text,
.kitt-progress-percent-text {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #344054;
}

.kitt-progress {
  width: 100%;
  height: 10px;
  margin-top: -8px;
  margin-bottom: 16px;
  background: #ddd;
  border-radius: 6px;
  overflow: hidden;
}

.kitt-progress-bar {
  width: 0%;
  height: 100%;
  background: #2c7be5;
  transition: width 0.3s ease;
}

/* ========================================
   KITT Lesson Step Design
======================================== */

.kitt-step {
  display: none;
  margin: 0 0 32px;
  border: 1px solid #dcdfe3;
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kitt-step.active {
  display: block;
}

.kitt-step:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.step-header {
  padding: 14px 18px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.step1 .step-header {
  background: #2c7be5;
}

.step2 .step-header {
  background: #00a65a;
}

.step3 .step-header {
  background: #f39c12;
}

.step4 .step-header {
  background: var(--kitt-color-correct);
}

/* 現テンプレートでは主に .step-content を使用。
   .step-body は互換維持のため残す。 */
.step-body,
.step-content {
  margin: 0;
  padding: 18px;
  font-size: 16px;
  line-height: 1.9;
  color: #222222;
  background: #ffffff;
}

.step-body p,
.step-content p {
  margin: 0 0 1em;
}

.step-body p:last-child,
.step-content p:last-child {
  margin-bottom: 0;
}

.step-body ul,
.step-body ol,
.step-content ul,
.step-content ol {
  margin: 0 0 1em 1.4em;
}

.step-body li,
.step-content li {
  margin-bottom: 0.4em;
}

.step-body strong,
.step-content strong {
  font-weight: 700;
}

.step-body a,
.step-content a {
  text-decoration: underline;
}

.step-actions {
  margin-top: 16px;
  padding: 0 18px 18px;
}

.step-feedback {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: #555;
  min-height: 1.6em;
}

.step-feedback.is-success,
#step4-feedback.is-success {
  color: #166534;
  font-weight: 700;
}

.step-feedback.is-success,
#step4-feedback.is-success,
#step4-feedback.kitt-feedback--correct,
#step4-feedback.kitt-feedback--complete {
  color: #1e40af;
  font-weight: 700;
}

.step-feedback.is-error,
#step4-feedback.is-error,
#step4-feedback.kitt-feedback--retry {
  color: var(--kitt-color-retry);
  font-weight: 700;
}

/* ========================================
   Step4 Lock UI
======================================== */

.step-check-area {
  padding: 0 18px 18px;
}

.step-check-area input[type="text"] {
  width: 100%;
  max-width: 320px;
  box-sizing: border-box;
  margin-bottom: 10px;
  padding: 10px 12px;
  font-size: 16px;
  border: 1px solid #ccd3db;
  border-radius: 8px;
}

.step-check-area button,
.step-actions button {
  display: inline-block;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  background: #2c7be5;
  color: #fff;
  cursor: pointer;
}

.step-check-area button:hover,
.step-actions button:hover {
  opacity: 0.92;
}

.step-actions button[disabled],
#step4-check:disabled {
  background: #9aa5b1;
  cursor: not-allowed;
  opacity: 0.55;
}

.step-check-area input[type="text"]:disabled,
#step4-answer:disabled {
  background: #f5f7fa;
  color: #667085;
  cursor: not-allowed;
}

#step4-feedback {
  display: block;
  margin: 16px 0 6px;
  padding: 0 18px;
  min-height: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #555;
  box-sizing: border-box;
}

#step4-feedback.is-rescue,
#step4-feedback.kitt-feedback--hint {
  margin: 16px 24px 0;
  padding: 12px 16px;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.6;
  color: #1e40af;
  background: var(--kitt-color-bg-hint);
  border: 1px solid var(--kitt-color-hint);
  border-radius: 8px;
}

.step4-hint-area {
  margin: 0;
  padding: 0 18px;
  box-sizing: border-box;
}

.step4-hint-controls {
  display: block;
  margin: 6px 0 10px;
  padding: 0;
}

.step4-hint-button,
.step4-hint-controls button,
button.step4-hint-button {
  display: inline-block;
  margin: 0;
  vertical-align: top;
}

.step4-hint-box {
  display: none;
  margin-top: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: #f7f9fc;
  border: 1px solid #d9e2f0;
  border-radius: 10px;
  line-height: 1.7;
}

.step4-main-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.step4-back-button,
.step4-back-button.is-rescue-only {
  display: none;
}

.step4-back-button.is-visible,
.step4-back-button.is-rescue-only.is-visible {
  display: inline-block;
}

/* ========================================
   Lesson Complete Area
======================================== */

.lesson-complete-message {
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  margin-top: 24px;
  padding: 24px;
  background: var(--kitt-color-bg-correct);
  border: 1px solid #bfdbfe;
  border-radius: 16px;
  color: #1e40af;
  font-weight: 700;
}

.lesson-complete-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lesson-complete-title,
.lesson-complete-text {
  margin: 0;
}

.lesson-complete-title {
  font-size: 18px;
  font-weight: 700;
}

.lesson-complete-text {
  max-width: 34em;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.9;
  color: #1e3a8a;
}

.step4-explanation {
  margin-top: 4px;
  line-height: 1.8;
}

.lesson-complete-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.kitt-day-next-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 20px;
  background-color: #3b82f6;
  color: #ffffff;
  border-radius: 10px;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 600;
  line-height: 1;
}

.kitt-day-next-button:hover {
  opacity: 0.9;
}

/* ========================================
   KITT My Page
======================================== */

.kitt-mypage {
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.kitt-mypage h2 {
  margin-bottom: 24px;
  font-size: 28px;
  line-height: 1.4;
}

.kitt-mypage-card {
  margin-bottom: 28px;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
}

.kitt-mypage-card h3 {
  margin: 0 0 16px;
  font-size: 20px;
  line-height: 1.4;
}

.kitt-mypage-card p {
  margin: 0 0 14px;
  line-height: 1.8;
}

.kitt-mypage-progress-meta {
  margin: 10px 0;
  font-size: 15px;
  line-height: 1.7;
  color: #555;
}

.kitt-mypage-button {
  display: inline-block;
  margin-top: 8px;
  padding: 12px 22px;
  color: #fff;
  background: #1f6feb;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.kitt-mypage-button:hover {
  color: #fff;
  background: #185abc;
  text-decoration: none;
}

.kitt-mypage-button-secondary {
  margin-left: 10px;
  background: #555;
}

.kitt-mypage-button-secondary:hover {
  background: #333;
}

.kitt-course-select-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

/* ========================================
   My Page - Course Name
======================================== */

.kitt-mypage-course-name {
  margin: 8px 0 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.6;
}

/* ========================================
   Login Page
======================================== */

.kitt-login-box {
  max-width: 520px;
  margin: 80px auto 0;
  padding: 32px;
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.kitt-login-box h2 {
  margin-top: 0;
  margin-bottom: 24px;
  text-align: center;
}

.kitt-login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.kitt-login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kitt-login-field label {
  font-weight: 700;
}

.kitt-login-field input {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  border: 1px solid #bbb;
  border-radius: 8px;
  box-sizing: border-box;
}

.kitt-login-remember {
  font-size: 14px;
}

.kitt-login-submit,
.kitt-login-button {
  display: inline-block;
  padding: 10px 22px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.kitt-login-submit:hover,
.kitt-login-button:hover {
  opacity: 0.9;
}

.kitt-login-error {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 8px;
  color: #9f1239;
  font-weight: 700;
}

.kitt-login-success {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  color: #166534;
  font-weight: 700;
}

/* ========================================
   My Page Logout
======================================== */

.kitt-mypage-logout {
  max-width: 520px;
  margin: 24px auto 0;
  text-align: right;
}

.kitt-logout-button {
  display: inline-block;
  padding: 9px 18px;
  background: /*#f3f4f6*/#FFF;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}

.kitt-logout-button:hover {
  background: #f3f4f6;
  color: #111827;
  text-decoration: none;
}

/* ==============================
   KITT Lesson Body Readability v0.1
   Lesson本文の可読性確認用
   ============================== */

.kitt-step-body {
  font-size: 17px;
  line-height: 1.8;
}

.kitt-step-body p {
  margin: 0 0 1em;
}

.kitt-note,
.kitt-point {
  margin: 1.4em 0;
  padding: 1em 1.1em;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  background: #f8fafc;
}

.kitt-box-title {
  display: block;
  margin-bottom: 0.6em;
  font-weight: 700;
}

.kitt-key {
  font-weight: 700;
}

.kitt-note p,
.kitt-point p {
  margin: 0 0 0.6em;
}

.kitt-note p:last-child,
.kitt-point p:last-child {
  margin-bottom: 0;
}

/* ==============================
   KITT Lesson Practice v0.1
   練習問題・注目ボックス用
   ============================== */

.kitt-focus-box {
  margin: 1.4em 0;
  padding: 1em 1.1em;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  background: #f8fafc;
}

.kitt-focus {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1.5px;
}

.kitt-practice {
  margin: 1.4em 0;
}

.kitt-question {
  margin: 0 0 0.4em;
  font-weight: 700;
}

.kitt-answer {
  margin: 0 0 1.2em;
}

.kitt-answer:last-child {
  margin-bottom: 0;
}

@media (max-width: 600px) {
  .kitt-step-body {
    font-size: 16px;
    line-height: 1.8;
  }

  .kitt-note,
  .kitt-point {
    padding: 0.9em 1em;
  }
}

/* ========================================
   Responsive
======================================== */

@media (max-width: 768px) {
  .container {
    padding: 24px 18px 40px;
  }

  .container > h1 {
    margin-bottom: 24px;
  }

  .kitt-progress-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .kitt-lesson-layout {
    flex-direction: column;
    gap: 18px;
  }

  .kitt-step-nav {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  .kitt-step-nav button {
    width: calc(50% - 5px);
    min-width: 0;
    align-items: center;
    text-align: center;
    padding: 12px 10px;
    font-size: 14px;
  }

  .kitt-lesson-main {
    width: 100%;
    margin-top: 0;
  }

  .kitt-progress {
    margin-top: 0;
    margin-bottom: 16px;
  }

  .step-header {
    padding: 13px 16px;
    font-size: 17px;
  }

  .step-content,
  .step-body {
    padding: 16px;
    font-size: 15px;
  }

  .step-actions,
  .step-check-area {
    padding: 0 16px 1px;
  }

  .step-check-area input[type="text"] {
    max-width: 100%;
    font-size: 16px;
  }

  .lesson-complete-message {
    align-items: stretch;
    gap: 14px;
    padding: 20px 16px;
  }

  .lesson-complete-actions {
    width: 100%;
    justify-content: center;
  }

  .kitt-day-next-button {
    text-align: center;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    }
  }

@media (max-width: 640px) {
  .container {
    padding: 24px 20px 40px;
  }

  .step-header {
    padding: 12px 15px;
    font-size: 16px;
  }

  .step-content,
  .step-body {
    padding: 15px;
    font-size: 15px;
  }

  .lesson-complete-actions {
    justify-content: center;
  }

  .kitt-day-next-button {
    width: 100%;
    max-width: 280px;
  }
}

/* ========================================
   My Page Responsive
======================================== */

@media (max-width: 640px) {
  body {
    margin: 0;
  }

  .container {
    padding: 20px 16px 32px;
  }

  .container > h1 {
    margin-bottom: 18px;
    font-size: 28px;
  }

  .kitt-mypage {
    padding: 12px 0 40px;
  }

  .kitt-mypage h2 {
    margin: 0 0 18px;
    font-size: 26px;
  }

  .kitt-mypage-card {
    margin-bottom: 18px;
    padding: 18px 20px;
  }

  .kitt-mypage-card h3 {
    margin-bottom: 12px;
    font-size: 20px;
  }

  .kitt-mypage-card p {
    margin-bottom: 10px;
    line-height: 1.75;
  }

  .kitt-mypage-logout {
    margin: 18px auto 0;
    padding: 0 16px;
  }
}

@media (max-width: 640px) {
  .kitt-mypage > h2 {
    display: none;
  }

  .kitt-mypage {
    padding-top: 0;
  }
}
