/* ── CTA Brand Colors ────────────────────────────────────────────── */
:root {
  --bg: #faf7f2;
  --bg-card: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #5a5a5a;
  --text-muted: #9a9a9a;
  --border: #e5e0d8;
  --orange: #e8751a;
  --orange-dark: #c95f0e;
  --orange-light: #fdf1e6;
  --green: #2d6a4f;
  --green-light: #e8f5ee;
  --red: #d32f2f;
  --red-light: #fde8e8;
  --moss: #4a7c59;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--text-primary); line-height: 1.6;
}

/* ── Login ───────────────────────────────────────────────────────── */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 2rem;
  background: linear-gradient(135deg, var(--orange-light) 0%, var(--bg) 50%, var(--green-light) 100%);
}
.login-card {
  background: var(--bg-card); border-radius: 24px; padding: 2.5rem;
  width: 100%; max-width: 400px; box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  text-align: center; border: 1px solid var(--border);
}
.logo { height: 60px; margin-bottom: 1.5rem; }
.login-card h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.25rem; }
.subtitle { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1.5rem; }

.field { text-align: left; margin-bottom: 1rem; }
.field label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 0.3rem; color: var(--text-secondary); }
.field input {
  width: 100%; padding: 0.75rem 1rem; border: 1.5px solid var(--border);
  border-radius: 12px; font-size: 0.95rem; outline: none; transition: border-color 0.2s;
  background: var(--bg);
}
.field input:focus { border-color: var(--orange); }

.error { color: var(--red); font-size: 0.85rem; margin-bottom: 0.5rem; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn-primary {
  width: 100%; padding: 0.8rem 1.5rem; background: var(--orange); color: white;
  border: none; border-radius: 12px; font-size: 1rem; font-weight: 600;
  cursor: pointer; transition: background 0.2s, transform 0.1s;
}
.btn-primary:hover { background: var(--orange-dark); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary:active { transform: scale(0.98); }

.btn-lg { padding: 1rem 2rem; font-size: 1.1rem; margin-top: 1rem; }

.btn-small {
  padding: 0.35rem 0.7rem; border: 1px solid var(--border); border-radius: 8px;
  background: white; font-size: 0.78rem; cursor: pointer; transition: all 0.15s;
}
.btn-small:hover { background: var(--orange-light); }
.btn-small.danger { color: var(--red); border-color: #f5c6c6; }
.btn-small.danger:hover { background: var(--red-light); }

.btn-logout {
  padding: 0.5rem 1rem; background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  font-size: 0.85rem;
}
.btn-logout:hover { background: var(--orange-light); color: var(--orange); }

/* ── Topbar ──────────────────────────────────────────────────────── */
.topbar {
  background: white; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.topbar-inner {
  max-width: 1000px; margin: 0 auto; padding: 0.75rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar-left { display: flex; align-items: center; gap: 0.75rem; }
.topbar-logo { height: 32px; }
.topbar-title { font-weight: 700; font-size: 1rem; }
.user-badge { 
  font-size: 0.85rem; font-weight: 600; color: var(--green);
  margin-right: 0.75rem; 
}

/* ── Layout ──────────────────────────────────────────────────────── */
.container { max-width: 900px; margin: 2rem auto; padding: 0 1rem; }

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; padding: 1.5rem 2rem; margin-bottom: 1.5rem;
}
.card h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.5rem; }
.card p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1rem; }
.hint { color: var(--text-muted); font-size: 0.8rem !important; }
code { 
  background: var(--orange-light); padding: 0.15rem 0.4rem; border-radius: 4px;
  font-size: 0.85em; color: var(--orange-dark);
}

/* ── Upload form ─────────────────────────────────────────────────── */
.upload-form { margin-top: 1rem; }
.file-drop {
  border: 2px dashed var(--border); border-radius: 16px; padding: 2rem;
  text-align: center; cursor: pointer; transition: all 0.2s;
  background: var(--bg);
}
.file-drop:hover { border-color: var(--orange); background: var(--orange-light); }
.file-drop p { margin: 0; color: var(--text-muted); }

.file-info {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--green-light); border: 1px solid var(--green);
  border-radius: 12px; padding: 0.75rem 1rem; margin-bottom: 0.5rem;
}

/* ── Upload area (student) ───────────────────────────────────────── */
.upload-area {
  border: 2px dashed var(--border); border-radius: 16px; padding: 2.5rem;
  text-align: center; cursor: pointer; transition: all 0.2s;
  background: var(--bg); margin-bottom: 0.75rem;
}
.upload-area:hover { border-color: var(--orange); background: var(--orange-light); }
.upload-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }

.checkbox-label {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 1rem;
  cursor: pointer;
}
.checkbox-label input { width: 18px; height: 18px; accent-color: var(--orange); }

.progress-bar {
  background: var(--border); border-radius: 12px; height: 28px;
  position: relative; overflow: hidden; margin-bottom: 0.75rem;
}
.progress-fill {
  background: var(--green); height: 100%; width: 0%;
  transition: width 0.3s; border-radius: 12px;
}
.progress-bar span {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: 0.75rem; font-weight: 600; color: white; text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* ── Results ─────────────────────────────────────────────────────── */
.result-box { 
  border-radius: 12px; padding: 1rem; margin: 0.75rem 0; display: none;
}
.result-box .success { color: var(--green); font-weight: 600; }
.result-box .warn { color: var(--orange-dark); font-weight: 600; }
.result-box .error { color: var(--red); font-weight: 600; }
.result-box a { color: var(--orange); text-decoration: underline; }
.result-box ul { margin: 0.5rem 0 0 1.5rem; font-size: 0.85rem; color: var(--text-secondary); }

/* ── Table ───────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
thead th {
  text-align: left; padding: 0.6rem 0.75rem; font-weight: 600;
  color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.05em; border-bottom: 2px solid var(--border);
}
tbody td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }
tbody tr:hover { background: var(--orange-light); }
.actions { display: flex; gap: 0.3rem; }
.badge {
  background: var(--orange); color: white; border-radius: 20px;
  padding: 0.1rem 0.6rem; font-size: 0.75rem; font-weight: 600;
  vertical-align: middle; margin-left: 0.5rem;
}
a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }
