/*
Theme Name: Canvas Course Theme
Theme URI: https://jakeson.net
Author: Jake Son
Description: Front-door authentication theme for Canvas Course Manager. Activate together with the Canvas Course Manager plugin on a fresh WordPress install.
Version: 1.0.2
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: canvas-course-theme
*/

:root {
  --ccm-brand: #0374b5;
  --ccm-brand-dark: #025e92;
  --ccm-nav-bg: #394b58;
  --ccm-nav-text: #ffffff;
  --ccm-link: #0374b5;
  --ccm-card: #ffffff;
  --ccm-bg: #f5f5f5;
  --ccm-border: #c7cdd1;
  --ccm-text: #2d3b45;
  --ccm-muted: #6b7780;
  --ccm-danger: #be2612;
  --ccm-success: #0b874b;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.ccm-auth-body {
  min-height: 100vh;
  font-family: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--ccm-bg);
  color: var(--ccm-text);
}
.ccm-auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background:
    linear-gradient(160deg, #2d3b45 0%, #394b58 45%, #0374b5 140%);
}
.ccm-auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--ccm-card);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
  padding: 36px 32px 28px;
}
.ccm-auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.ccm-auth-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--ccm-brand);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.ccm-auth-card h1 {
  font-size: 22px;
  margin: 0 0 4px;
}
.ccm-auth-sub {
  color: var(--ccm-muted);
  font-size: 14px;
  margin: 0 0 24px;
}
.ccm-auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--ccm-border);
}
.ccm-auth-tabs button {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--ccm-muted);
  font-size: 14px;
  font-weight: 600;
}
.ccm-auth-tabs button.is-active {
  color: var(--ccm-brand);
  border-bottom-color: var(--ccm-brand);
}
.ccm-field { margin-bottom: 14px; }
.ccm-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.ccm-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--ccm-border);
  border-radius: 4px;
  font-size: 15px;
}
.ccm-field input:focus {
  outline: 2px solid var(--ccm-brand);
  border-color: var(--ccm-brand);
}
.ccm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 11px 16px;
  background: var(--ccm-brand);
  color: #fff;
  border: 0;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.ccm-btn:hover { background: var(--ccm-brand-dark); }
.ccm-btn-ghost {
  background: transparent;
  color: var(--ccm-link);
  width: auto;
  padding: 8px 0;
}
.ccm-msg {
  padding: 10px 12px;
  border-radius: 4px;
  margin-bottom: 14px;
  font-size: 14px;
}
.ccm-msg-error { background: #fce8e6; color: var(--ccm-danger); }
.ccm-msg-ok { background: #e5f7ed; color: var(--ccm-success); }
.ccm-auth-panel { display: none; }
.ccm-auth-panel.is-active { display: block; }
.ccm-auth-foot {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--ccm-muted);
}
.ccm-screen-reader { position: absolute; left: -9999px; }

/* LMS chrome shared with the plugin (Dashboard + course shell) */
body.ccm-app {
  min-height: 100vh;
  font-family: Lato, "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--ccm-bg);
  color: var(--ccm-text);
}
.ccm-shell { display: flex; min-height: 100vh; }
.ccm-sidenav {
  width: 220px;
  background: var(--ccm-nav-bg);
  color: var(--ccm-nav-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.ccm-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  padding: 16px;
  font-weight: 700;
}
.ccm-mark {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--ccm-brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.ccm-sidenav nav a {
  display: block;
  color: var(--ccm-nav-text);
  text-decoration: none;
  padding: 8px 16px;
  opacity: .9;
}
.ccm-sidenav nav a.is-on, .ccm-sidenav nav a:hover { background: rgba(255,255,255,.08); }
.ccm-nav-label { padding: 16px 16px 6px; font-size: 11px; text-transform: uppercase; opacity: .6; }
.ccm-sidenav-foot { margin-top: auto; padding: 12px 16px; font-size: 12px; opacity: .85; }
.ccm-sidenav-foot a { color: inherit; }
.ccm-main { flex: 1; padding: 24px 32px; max-width: 1100px; }
.ccm-top { display: flex; align-items: center; gap: 12px; }
.ccm-top h1 { flex: 1; }
.ccm-btn {
  background: var(--ccm-brand); color: #fff; border: 0; border-radius: 3px;
  padding: 8px 14px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block;
}
.ccm-btn.ghost { background: #fff; color: var(--ccm-brand); border: 1px solid var(--ccm-border); }
.ccm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.ccm-card { background: var(--ccm-card); border: 1px solid var(--ccm-border); border-radius: 4px; overflow: hidden; text-decoration: none; color: inherit; }
.ccm-card-img { height: 120px; background-size: cover; background-position: center; }
.ccm-card-body { padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.ccm-card-body small { color: var(--ccm-muted); }
@media (max-width: 800px) {
  .ccm-shell { flex-direction: column; }
  .ccm-sidenav { width: 100%; }
}
