/* JK-Art Homework — Design aligned with main website */

:root {
  --paper: #fbf7f1;
  --paper-soft: #f6efe5;
  --sand: #efe6da;
  --ink: #2b2723;
  --soft: #6b5f55;
  --mute: #9b8e80;
  --clay: #bd5b3d;
  --clay-dk: #a8492f;
  --brick: #6e2c2a;
  --sage: #5e7153;
  --line: #e7dccd;
  --line2: #ddd0c0;
  --glow: 0 14px 30px rgba(189, 91, 61, 0.3);
  --shadow: 0 18px 50px rgba(70, 45, 30, 0.08);
  --font-sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.serif {
  font-family: var(--font-serif);
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- HEADER ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper-soft);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  gap: 30px;
  height: 84px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  flex: 0 0 auto;
}

.logo .mk {
  width: 46px;
  height: 52px;
  background: var(--horse) center / contain no-repeat;
}

.logo .wm {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 0.95;
  letter-spacing: 0.01em;
}

.logo .tg {
  display: block;
  font-size: 0.52rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mute);
  margin-top: 4px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--soft);
}

@media (min-width: 1080px) {
  .nav-links {
    gap: 28px;
    font-size: 0.93rem;
  }
}

.nav-links a {
  color: inherit;
  text-decoration: none;
  line-height: 1.15;
  transition: color 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--clay);
}

.nav-cta {
  flex: 0 0 auto;
}

.hw-user {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--soft);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle[aria-expanded='true'] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded='true'] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded='true'] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 860px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 84px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 12px 28px 20px;
    background: var(--paper-soft);
    border-bottom: 1px solid var(--line);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-links a:last-child {
    border-bottom: none;
  }

  .nav-toggle {
    display: flex;
  }

  header .nav {
    position: relative;
  }

  .nav .nav-cta {
    display: none;
  }
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: var(--font-sans);
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
  border: 1.5px solid transparent;
  text-decoration: none;
  transition: transform 0.18s, background 0.18s, box-shadow 0.18s, border-color 0.18s, color 0.18s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--clay);
  color: #fff;
  box-shadow: var(--glow);
}

.btn-primary:hover {
  background: var(--clay-dk);
  transform: translateY(-1px);
  color: #fff;
}

.btn-ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.nav .btn {
  padding: 0.72rem 1.5rem;
  font-size: 0.92rem;
}

.btn-sm {
  padding: 0.62rem 1.25rem;
  font-size: 0.9rem;
}

.hw-btn-disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* ---------- TYPOGRAPHY ---------- */
.eyebrow {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--clay);
  margin-bottom: 12px;
}

.sec-head {
  margin-bottom: 36px;
}

.sec-head h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.08;
  margin-bottom: 10px;
}

.sec-head p {
  color: var(--soft);
  max-width: 52ch;
  line-height: 1.6;
}

/* ---------- INTRO / LOGIN ---------- */
.hw-intro {
  padding: 56px 0 48px;
  background: linear-gradient(180deg, var(--paper-soft) 0%, var(--paper) 100%);
  border-bottom: 1px solid var(--line);
}

.hw-intro-grid {
  max-width: 720px;
}

.hw-intro-text h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 600;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 18px;
}

.hw-intro-text .lead {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--soft);
  margin-bottom: 24px;
  max-width: 54ch;
}

.hw-features {
  list-style: none;
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.hw-features li {
  position: relative;
  padding-left: 22px;
  color: var(--soft);
  line-height: 1.55;
  font-size: 0.96rem;
}

.hw-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--clay);
}

.hw-welcome {
  font-size: 0.92rem;
  color: var(--soft);
  margin-bottom: 16px;
}

.hw-welcome a {
  color: var(--clay);
}

.hw-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.hw-panel h2 {
  font-size: 1.9rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.hw-panel-note,
.hw-panel-foot {
  font-size: 0.9rem;
  color: var(--mute);
  line-height: 1.55;
  margin-bottom: 16px;
}

.hw-panel-foot {
  margin-top: 16px;
  margin-bottom: 0;
}

.hw-panel-welcome p {
  color: var(--soft);
  margin-bottom: 20px;
  line-height: 1.6;
}

.hw-form {
  display: grid;
  gap: 12px;
}

.hw-form label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--soft);
}

.hw-form input {
  width: 100%;
  border: 1px solid var(--line2);
  border-radius: 12px;
  padding: 0.78rem 0.9rem;
  font-family: var(--font-sans);
  font-size: 0.96rem;
  color: var(--ink);
  background: var(--paper);
}

.hw-form input:focus {
  outline: 2px solid rgba(189, 91, 61, 0.25);
  border-color: var(--clay);
}

.hw-form .btn {
  margin-top: 6px;
  width: 100%;
  padding: 0.85rem 1.25rem;
}

.hw-alert {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.hw-alert-error {
  background: #fdecea;
  color: var(--brick);
  border: 1px solid #f5c4bc;
}

/* ---------- TASK SLOTS ---------- */
.hw-tasks {
  padding: 56px 0 72px;
}

.hw-day {
  margin-bottom: 40px;
}

.hw-day-title {
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.hw-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.hw-slot-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hw-slot-card-free {
  max-width: 420px;
  border-color: var(--clay);
}

.hw-slot-time {
  background: var(--sand);
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.hw-slot-time .serif {
  display: block;
  font-size: 2rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
}

.hw-slot-day {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  margin-top: 6px;
}

.hw-slot-body {
  padding: 18px 20px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.hw-slot-group {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clay);
  margin-bottom: 8px;
}

.hw-slot-body h4 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.2;
}

.hw-slot-body h4.hw-empty {
  color: var(--mute);
}

.hw-slot-body p {
  font-size: 0.92rem;
  color: var(--soft);
  line-height: 1.55;
  margin-bottom: 16px;
  flex: 1;
}

.hw-slot-body .btn {
  align-self: flex-start;
}

/* ---------- FOOTER ---------- */
footer {
  margin-top: auto;
  background: #241c18;
  color: #c9bbae;
}

.foot {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 2vw, 32px);
  padding: 48px 0 28px;
  align-items: start;
}

.foot > div {
  min-width: 0;
}

@media (max-width: 1024px) and (min-width: 761px) {
  .foot {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px 24px;
  }
}

@media (max-width: 760px) {
  .foot {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

.foot .logo .wm {
  color: #f4ece3;
}

.foot .logo .tg {
  color: #9a8c7d;
}

.foot .logo .mk {
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

.foot h4 {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8a7d6e;
}

.foot ul {
  list-style: none;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.foot a {
  color: #c9bbae;
  text-decoration: none;
  font-size: 0.96rem;
  transition: color 0.15s;
}

.foot a:hover {
  color: #e7a98f;
}

.foot-bottom {
  border-top: 1px solid #3a2f28;
  padding: 22px 0;
  font-size: 0.85rem;
  color: #8a7d6e;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

/* ---------- AUTH PAGES ---------- */
.hw-page {
  padding: 48px 0 72px;
}

.hw-page-narrow {
  max-width: 520px;
  margin: 0 auto;
}

.hw-page-wide {
  max-width: 640px;
  margin: 0 auto;
}

.hw-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.hw-card h1 {
  font-size: 1.9rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.hw-card .hw-form {
  margin-top: 8px;
}

/* ---------- TASK PAGE ---------- */
.hw-task-main {
  padding: 40px 0 72px;
}

.hw-task-grid {
  display: grid;
  gap: 20px;
  max-width: 760px;
  margin: 0 auto;
}

.hw-task-meta {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--clay);
  margin-bottom: 10px;
}

.hw-task-card h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 600;
  margin-bottom: 14px;
}

.hw-task-card p {
  color: var(--soft);
  line-height: 1.65;
}

.hw-task-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.hw-task-nav a {
  color: var(--clay);
  text-decoration: none;
  font-weight: 600;
}

.hw-progress {
  margin: 20px 0;
}

.hw-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--mute);
  margin-bottom: 8px;
}

.hw-progress-bar {
  height: 8px;
  background: var(--sand);
  border-radius: 999px;
  overflow: hidden;
}

.hw-progress-fill {
  height: 100%;
  background: var(--clay);
  border-radius: 999px;
  transition: width 0.3s;
}

.hw-hint {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--paper-soft);
  border-left: 3px solid var(--sage);
  border-radius: 0 12px 12px 0;
  font-size: 0.92rem;
  color: var(--soft);
}

.task-example-img,
.submitted-work-img {
  max-height: 400px;
  width: 100%;
  object-fit: contain;
  background: var(--sand);
  border-radius: 12px;
  margin-top: 16px;
  padding: 8px;
}

.image-preview {
  margin-top: 12px;
}

.image-preview img {
  max-height: 250px;
  object-fit: contain;
  border: 2px dashed var(--line2);
  border-radius: 12px;
  padding: 8px;
  background: #fff;
}

.image-preview.d-none {
  display: none;
}

.analysis-result {
  border: 2px solid var(--clay) !important;
  animation: fadeIn 0.5s ease;
}

.analysis-text {
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: 1rem;
  color: var(--ink);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hw-file-input {
  margin: 12px 0;
}

/* ---------- ADMIN (Bootstrap overrides) ---------- */
body.admin-page,
body.task-page {
  background: var(--paper);
}

.admin-page .navbar,
.task-page .navbar {
  display: none;
}

.admin-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

.admin-topbar {
  background: var(--paper-soft);
  border-bottom: 1px solid var(--line);
  padding: 0;
}

.admin-topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.admin-topbar-brand {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.admin-topbar-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.9rem;
}

.admin-topbar-nav a {
  color: var(--soft);
  text-decoration: none;
  font-weight: 600;
}

.admin-topbar-nav a:hover {
  color: var(--clay);
}

.admin-main {
  flex: 1;
  padding: 40px 0 56px;
}

.admin-main h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3vw, 2.2rem);
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--ink);
}

.admin-page .card {
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.admin-page .card-header {
  background: var(--paper-soft);
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  color: var(--ink);
}

.admin-page .table {
  --bs-table-bg: transparent;
  font-size: 0.92rem;
}

.admin-page .table thead th {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  border-bottom-color: var(--line);
}

.admin-page .form-control,
.admin-page .form-select {
  border-color: var(--line2);
  border-radius: 12px;
  font-family: var(--font-sans);
}

.admin-page .form-control:focus,
.admin-page .form-select:focus {
  border-color: var(--clay);
  box-shadow: 0 0 0 0.2rem rgba(189, 91, 61, 0.15);
}

.admin-preview-img {
  max-height: 150px;
  object-fit: contain;
  background: var(--sand);
  border-radius: 8px;
  padding: 4px;
}

.btn-primary {
  background-color: var(--clay) !important;
  border-color: var(--clay) !important;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--clay-dk) !important;
  border-color: var(--clay-dk) !important;
}

.btn-outline-primary {
  color: var(--clay) !important;
  border-color: var(--clay) !important;
}

.btn-outline-primary:hover {
  background-color: var(--clay) !important;
  border-color: var(--clay) !important;
  color: #fff !important;
}

/* ---------- AUTH (Bootstrap standalone pages) ---------- */
body.auth-page {
  background: var(--paper);
  font-family: var(--font-sans);
  color: var(--ink);
  min-height: 100vh;
}

.auth-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 28px 72px;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.auth-card {
  border: 1px solid var(--line) !important;
  border-radius: 20px !important;
  box-shadow: var(--shadow) !important;
}

.auth-card-wide {
  max-width: 100%;
}

.auth-card .card-body h1,
.auth-card .card-body .h4 {
  font-family: var(--font-serif);
  color: var(--ink);
}

.auth-card .form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--soft);
}

.auth-card .form-control {
  border-color: var(--line2);
  border-radius: 12px;
  font-family: var(--font-sans);
}

.auth-card .form-control:focus {
  border-color: var(--clay);
  box-shadow: 0 0 0 0.2rem rgba(189, 91, 61, 0.15);
}

@media (max-width: 860px) {
  .hw-slots {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .hw-slot-body .btn {
    white-space: normal;
    text-align: center;
  }

  .wrap {
    padding: 0 20px;
  }
}
