/* ============================================================
   AMERICAN CARRY RIGHTS — Members Portal Stylesheet
   Matches main site branding: red #cc0000, navy #0a2463
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: #f0f2f5;
  color: #222;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { display: block; max-width: 100%; height: auto; }
a   { text-decoration: none; color: inherit; }
button { cursor: pointer; -webkit-appearance: none; border: none; }

/* ── TOP BAR ── */
.topbar {
  background: #cc0000;
  width: 100%;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-flag { font-size: 18px; }
.topbar-title {
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.topbar-secure {
  color: #ffcccc;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.topbar-user {
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-user a {
  color: #ffcccc;
  text-decoration: underline;
  font-size: 10px;
}

/* ── HEADER ── */
.header {
  background: #fff;
  width: 100%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.header-inner {
  padding: 10px 16px 6px;
  text-align: center;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-logo {
  max-height: 56px;
  width: auto;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.header-nav a {
  color: #0a2463;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}
.header-nav a:hover,
.header-nav a.active {
  border-bottom-color: #cc0000;
  color: #cc0000;
}
.header-nav .btn-logout {
  background: #cc0000;
  color: #fff;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background 0.2s;
}
.header-nav .btn-logout:hover { background: #990000; }

/* ── TRICOLOR STRIPE ── */
.tricolor {
  height: 4px;
  width: 100%;
  background: linear-gradient(to right,
    #cc0000 0%, #cc0000 33.33%,
    #d0d0d0 33.33%, #d0d0d0 66.66%,
    #0a2463 66.66%, #0a2463 100%
  );
}

/* ── LOGIN PAGE ── */
.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}
.login-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(10,36,99,0.12);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  border-top: 4px solid #cc0000;
}
.login-card-header {
  text-align: center;
  margin-bottom: 28px;
}
.login-shield {
  font-size: 48px;
  margin-bottom: 10px;
}
.login-title {
  font-size: 22px;
  font-weight: 900;
  color: #0a2463;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.login-subtitle {
  font-size: 13px;
  color: #666;
}
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  text-align: center;
}
.alert-error {
  background: #fff0f0;
  color: #cc0000;
  border: 1px solid #ffcccc;
}
.alert-success {
  background: #f0fff4;
  color: #1a7a3a;
  border: 1px solid #b2f2cb;
}
.login-form .form-group {
  margin-bottom: 18px;
}
.login-form label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #0a2463;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.login-form input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  font-size: 15px;
  color: #222;
  transition: border-color 0.2s;
  outline: none;
}
.login-form input:focus {
  border-color: #0a2463;
}
.btn-login {
  width: 100%;
  background: linear-gradient(135deg, #cc0000, #990000);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 14px;
  border-radius: 6px;
  margin-top: 8px;
  transition: opacity 0.2s, transform 0.1s;
  box-shadow: 0 3px 10px rgba(204,0,0,0.3);
}
.btn-login:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}
.btn-login:active { transform: translateY(0); }
.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: #888;
}
.login-footer a { color: #0a2463; text-decoration: underline; }

/* ── DASHBOARD ── */
.portal-main {
  flex: 1;
  padding: 30px 16px 50px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.welcome-banner {
  background: linear-gradient(135deg, #0a2463, #060f2e);
  color: #fff;
  border-radius: 10px;
  padding: 28px 30px;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.welcome-text h2 {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.welcome-text p {
  font-size: 13px;
  color: #aabfff;
}
.progress-ring-wrap {
  text-align: center;
}
.progress-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: conic-gradient(#cc0000 var(--pct), rgba(255,255,255,0.15) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.progress-circle::before {
  content: '';
  position: absolute;
  width: 60px;
  height: 60px;
  background: #0a2463;
  border-radius: 50%;
}
.progress-pct {
  position: relative;
  z-index: 1;
  font-size: 16px;
  font-weight: 900;
  color: #fff;
}
.progress-label {
  font-size: 10px;
  color: #aabfff;
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── COURSE SECTION ── */
.section-title {
  font-size: 18px;
  font-weight: 900;
  color: #0a2463;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 3px solid #cc0000;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── LESSON LIST ── */
.lesson-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lesson-item {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  transition: box-shadow 0.2s, transform 0.1s;
  text-decoration: none;
  color: inherit;
  border-left: 4px solid transparent;
}
.lesson-item:hover {
  box-shadow: 0 4px 16px rgba(10,36,99,0.12);
  transform: translateY(-1px);
  border-left-color: #cc0000;
}
.lesson-item.completed {
  border-left-color: #1a7a3a;
}
.lesson-item.active {
  border-left-color: #cc0000;
  background: #fff8f8;
}
.lesson-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f0f2f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  color: #0a2463;
  flex-shrink: 0;
}
.lesson-item.completed .lesson-num {
  background: #e6f9ed;
  color: #1a7a3a;
}
.lesson-item.active .lesson-num {
  background: #cc0000;
  color: #fff;
}
.lesson-info {
  flex: 1;
  min-width: 0;
}
.lesson-module {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #999;
  margin-bottom: 2px;
}
.lesson-title {
  font-size: 15px;
  font-weight: 700;
  color: #0a2463;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lesson-status {
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.lesson-status.done   { color: #1a7a3a; }
.lesson-status.todo   { color: #aaa; }
.lesson-status.active { color: #cc0000; }
.lesson-arrow {
  color: #ccc;
  font-size: 18px;
  flex-shrink: 0;
}

/* ── VIDEO LESSON PAGE ── */
.lesson-main {
  flex: 1;
  padding: 24px 16px 50px;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}
.lesson-breadcrumb {
  font-size: 12px;
  color: #888;
  margin-bottom: 16px;
}
.lesson-breadcrumb a {
  color: #0a2463;
  text-decoration: underline;
}
.lesson-header {
  margin-bottom: 20px;
}
.lesson-module-tag {
  display: inline-block;
  background: #0a2463;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 3px;
  margin-bottom: 8px;
}
.lesson-page-title {
  font-size: 24px;
  font-weight: 900;
  color: #0a2463;
  line-height: 1.2;
}

/* ── VIDEO PLAYER ── */
.video-wrap {
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
  margin-bottom: 24px;
  position: relative;
  aspect-ratio: 16/9;
}
.video-wrap video {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── LESSON NAVIGATION ── */
.lesson-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.btn-nav {
  background: #0a2463;
  color: #fff;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
  text-decoration: none;
}
.btn-nav:hover { background: #060f2e; }
.btn-nav.primary {
  background: linear-gradient(135deg, #cc0000, #990000);
}
.btn-nav.primary:hover { background: #990000; }
.btn-complete {
  background: linear-gradient(135deg, #1a7a3a, #145c2c);
  color: #fff;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.2s;
  border: none;
  cursor: pointer;
}
.btn-complete:hover { opacity: 0.9; }
.btn-complete.done {
  background: #e6f9ed;
  color: #1a7a3a;
  border: 2px solid #1a7a3a;
}

/* ── INSTRUCTOR CARD ── */
.instructor-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.instructor-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0a2463, #cc0000);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.instructor-info h4 {
  font-size: 15px;
  font-weight: 800;
  color: #0a2463;
  margin-bottom: 2px;
}
.instructor-info p {
  font-size: 12px;
  color: #666;
}

/* ── FOOTER ── */
.portal-footer {
  background: #060f2e;
  margin-top: auto;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px;
  text-align: center;
  color: #8899cc;
  font-size: 12px;
  line-height: 1.8;
}
.footer-inner a {
  color: #aabfff;
  text-decoration: underline;
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .header-inner { flex-direction: column; gap: 10px; }
  .header-nav   { flex-wrap: wrap; justify-content: center; gap: 10px; }
  .welcome-banner { flex-direction: column; }
  .lesson-item  { flex-wrap: wrap; }
  .lesson-nav   { flex-direction: column; }
  .btn-nav, .btn-complete { width: 100%; justify-content: center; }
  .login-card   { padding: 28px 20px; }
}
