/* BC Ethics LMS — Styling matched to AllenComm course theme */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

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

:root {
  --bc-white: #ffffff;
  --bc-brown: #5f4d4d;
  --bc-orange: #ba5216;
  --bc-orange-hover: #a04812;
  --bc-blue: #2a6496;
  --bc-gray: #666666;
  --bc-light-gray: #cccccc;
  --bc-cream: #ebebeb;
  --bc-green: #9eb52a;
  --bc-black: #000000;
  --bc-bg: #f5f3f0;
}

body {
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--bc-brown);
  background: var(--bc-bg);
  min-height: 100vh;
}

body.course-active {
  overflow: hidden;
}

/* --- Auth View --- */

#auth-view {
  min-height: 100vh;
  display: flex;
  background: var(--bc-brown);
}

.auth-split {
  display: flex;
  width: 100%;
  min-height: 100vh;
  animation: authFadeIn 0.6s ease-out;
}

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

/* Hero Panel */
.auth-hero {
  flex: 1;
  position: relative;
  background: url('/course/files/images/bc_demo_00_hero3.jpg') center/cover no-repeat;
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
}

.auth-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(95, 77, 77, 0.3) 0%,
    rgba(95, 77, 77, 0.6) 50%,
    rgba(95, 77, 77, 0.85) 100%
  );
}

.auth-hero-content {
  position: relative;
  z-index: 1;
  padding: 3rem;
  max-width: 520px;
}

.auth-hero-logo {
  height: 100px;
  margin-bottom: 1.25rem;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}

.auth-hero-title {
  font-family: '1545 Faucheur W01', Georgia, serif;
  color: var(--bc-white);
  font-size: 2.4rem;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 1rem;
  text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.auth-hero-desc {
  color: rgba(255,255,255,0.85);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.auth-hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--bc-white);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.03em;
}

/* Form Panel */
.auth-form-panel {
  width: 480px;
  flex-shrink: 0;
  background: var(--bc-white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  overflow-y: auto;
}

.auth-form-inner {
  width: 100%;
  max-width: 400px;
}

.auth-form-heading {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--bc-brown);
  margin-bottom: 0.35rem;
}

.auth-form-subtitle {
  font-size: 0.9rem;
  color: var(--bc-gray);
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  width: 100%;
  padding-right: 3.5rem;
}

.password-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--bc-gray);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  font-family: inherit;
}

.password-toggle:hover {
  color: var(--bc-orange);
}

/* --- Forms --- */

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--bc-brown);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-group input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--bc-light-gray);
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--bc-orange);
  box-shadow: 0 0 0 2px rgba(186, 82, 22, 0.15);
}

.form-row {
  display: flex;
  gap: 0.75rem;
}

.form-row .form-group {
  flex: 1;
}

.form-error {
  display: none;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  padding: 0.55rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.form-toggle {
  text-align: center;
  font-size: 0.85rem;
  color: var(--bc-gray);
  margin-top: 1.25rem;
}

.form-toggle a {
  color: var(--bc-orange);
  text-decoration: none;
  font-weight: 500;
}

.form-toggle a:hover {
  text-decoration: underline;
}

/* --- Buttons --- */

.btn {
  display: inline-block;
  padding: 0.7rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s, opacity 0.2s;
  text-align: center;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--bc-orange);
  color: var(--bc-white);
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  background: var(--bc-orange-hover);
}

.btn-secondary {
  background: var(--bc-brown);
  color: var(--bc-white);
}

.btn-secondary:hover:not(:disabled) {
  background: #4a3c3c;
}

.btn-outline {
  background: transparent;
  color: var(--bc-orange);
  border: 2px solid var(--bc-orange);
}

.btn-outline:hover:not(:disabled) {
  background: var(--bc-orange);
  color: var(--bc-white);
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
}

/* --- Dashboard View --- */

#dashboard-view {
  display: none;
  min-height: 100vh;
}

.dash-header {
  background: var(--bc-brown);
  color: var(--bc-white);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dash-header-left img {
  height: 40px;
}

.dash-header-left h1 {
  font-family: '1545 Faucheur W01', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 400;
}

.dash-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
}

.dash-header-right a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.8rem;
}

.dash-header-right a:hover {
  color: var(--bc-white);
}

.dash-content {
  max-width: 720px;
  margin: 2.5rem auto;
  padding: 0 1.5rem;
}

.dash-welcome {
  margin-bottom: 2rem;
}

.dash-welcome h2 {
  font-size: 1.6rem;
  font-weight: 300;
  margin-bottom: 0.25rem;
}

.dash-welcome p {
  color: var(--bc-gray);
  font-size: 0.9rem;
}

.course-card {
  background: var(--bc-white);
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  overflow: hidden;
}

.course-card-banner {
  background: var(--bc-brown);
  color: var(--bc-white);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.course-card-banner h3 {
  font-family: '1545 Faucheur W01', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 400;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-not-started, .status-unknown {
  background: rgba(255,255,255,0.2);
  color: var(--bc-white);
}

.status-incomplete {
  background: var(--bc-orange);
  color: var(--bc-white);
}

.status-completed, .status-passed {
  background: var(--bc-green);
  color: var(--bc-white);
}

.status-failed {
  background: #dc2626;
  color: var(--bc-white);
}

.course-card-body {
  padding: 1.5rem 2rem;
}

.progress-bar-container {
  background: var(--bc-cream);
  border-radius: 6px;
  height: 10px;
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.progress-bar {
  background: var(--bc-green);
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
  width: 0%;
}

.course-score {
  font-size: 0.9rem;
  color: var(--bc-gray);
  margin-bottom: 1.25rem;
  display: none;
}

.course-card-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

/* --- Course View (iframe) --- */

#course-view {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bc-black);
  flex-direction: column;
}

.course-toolbar {
  background: var(--bc-brown);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.course-toolbar span {
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
}

.course-toolbar .btn-sm {
  background: rgba(255,255,255,0.15);
  color: var(--bc-white);
  border: none;
}

.course-toolbar .btn-sm:hover {
  background: rgba(255,255,255,0.25);
}

#course-iframe-container {
  flex: 1;
  overflow: hidden;
}

#course-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* --- Responsive --- */

@media (max-width: 900px) {
  .auth-split {
    flex-direction: column;
  }

  .auth-hero {
    min-height: 280px;
    flex: none;
    align-items: flex-end;
  }

  .auth-hero-content {
    padding: 2rem 1.5rem;
  }

  .auth-hero-logo {
    height: 72px;
    margin-bottom: 0.75rem;
  }

  .auth-hero-title {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
  }

  .auth-hero-desc {
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }

  .auth-form-panel {
    width: 100%;
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 600px) {
  .dash-header { padding: 0.75rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
  .dash-content { margin: 1.5rem auto; }
  .course-card-banner { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .course-card-actions { flex-direction: column; }
  .course-card-actions .btn { width: 100%; }
  .form-row { flex-direction: column; gap: 0; }
}
