/* study-scaffold — basic styling. Intentionally minimal; polish later. */

:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #677889;
  --accent: #2f6feb;
  --accent-dark: #1f54c4;
  --border: #d7dde4;
  --error: #c0392b;
  --notice-bg: #eef3fb;
  --notice-border: #c9ddf6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
}

.container {
  max-width: 1600px;
  margin: 2.5rem auto;
  padding: 2rem 2.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);

}

/* --- application header --- */
.app-header {
  max-width: 1600px;
  margin: 1.5rem auto 0.75rem;
  padding: 0 2.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.app-header + .container {
  margin-top: 0;
}

.app-title {
  font-weight: 600;
}

h1, h2, h3 { line-height: 1.25; margin-top: 0; }
p { margin: 0 0 1rem; }
strong { font-weight: 600; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- forms --- */
label { display: block; font-weight: 600; margin-bottom: 0.4rem; margin-top: 2.5rem; margin-bottom: 1rem; }

input[type="text"], input:not([type]), textarea {
  width: 100%;
  padding: 0.6rem 0.7rem;
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
}
textarea { min-height: 9rem; resize: vertical; }

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 111, 235, 0.15);
}

.field { margin: 1.25rem 0; }

/* --- buttons & button-styled links --- */
button, .btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.6rem 1.1rem;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .btn:hover { background: var(--accent-dark); text-decoration: none; }

/* --- radio choice group (review task) --- */
fieldset.choices {
  border: 1px solid var(--border);
  border-radius: 6px;
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
}
fieldset.choices legend { font-weight: 600; padding: 0 0.4rem; }
.choice { display: flex; align-items: center; gap: 0.5rem; margin: 0.25rem 0; }
.choice label { display: inline; font-weight: 500; margin: 0; }

/* checkbox list (llm_tools): no bullet, label sits right next to the box */
fieldset.choices ul { list-style: none; margin: 0.5rem 0 0; padding: 0; }
fieldset.choices li { display: flex; align-items: center; gap: 0.5rem; margin: 0.25rem 0; }
fieldset.choices li label { display: inline; font-weight: 500; margin: 0; }
fieldset.choices input[type="checkbox"], fieldset.choices input[type="radio"] { margin: 0; flex: none; }


/* example box */

.example {

  background: #e7fff4b2;
  padding: 0.9rem 1rem;

}

/* --- feature prompt box (plan task) --- */
.feature {
  background: #eef3ff;
  border-left: 4px solid var(--accent);
  padding: 0.9rem 1rem;
  border-radius: 6px;
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
}

/* --- example answer box (plan intro) --- */
.solution {
  background: #ceeefa;
  border-left: 4px solid #3a9d5d;
  padding: 0.9rem 1rem;
  border-radius: 6px;
  color: var(--text);
  margin-bottom: 1.25rem;
}

/* --- reusable task instructions --- */
.task-instructions {
  margin: 0 0 1.5rem;
  background: var(--notice-bg);
  border: 1px solid var(--notice-border);
  border-radius: 6px;
}

.task-instructions summary {
  padding: 0.75rem 1rem;
  color: var(--accent-dark);
  font-weight: 600;
  cursor: pointer;
}

.task-instructions-body { padding: 0 1rem 1rem; }
.task-instructions-body > :last-child { margin-bottom: 0; }

/* --- validation errors --- */
.field-hint { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 0.35rem; }
.error { display: block; color: var(--error); font-size: 0.9rem; margin-top: 0.35rem; }

input.is-invalid,
textarea.is-invalid,
fieldset.choices.is-invalid {
  border-color: var(--error);
  background: #fff7f6;
  box-shadow: 0 0 0 1px rgba(192, 57, 43, 0.18);
}

input.is-invalid:focus,
textarea.is-invalid:focus {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.18);
}

/* --- flashed messages (login feedback) --- */
ul.flashes {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--notice-bg);
  border: 1px solid var(--notice-border);
  border-radius: 6px;
}
ul.flashes li { margin: 0; }

/* --- diff viewer --- */
.container #diff {

  max-width: 2000px;
  margin-top: 3rem;
  margin-bottom: 3rem;
  overflow-x: auto;
}

/* --- header nav --- */

.app-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.app-nav a {
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

/* --- application-context block --- */

.app-context h4 {
  margin: 1.25rem 0 0.5rem;
}

.app-context pre {
  overflow-x: auto;
}

/* --- logout button --- */

a.logout {
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

a.logout:hover {
  color: var(--error);
}

.locked-notice {
    padding: 0.75rem 1rem;
    border-left: 4px solid #555;
    background: #f2f2f2;
}

.is-locked input:disabled,
.is-locked textarea:disabled {
    cursor: not-allowed;
    color: #333;
    background: #eee;
    opacity: 1;
}

@media (max-width: 640px) {
  .app-header {
    margin-top: 1rem;
    padding: 0 1rem;
  }

  .container {
    margin: 1rem;
    padding: 1.5rem 1rem;
  }
}
