/* E-CONNECT — Design system */
:root {
  --ink: #0f1f1a;
  --ink-soft: #2a3d35;
  --muted: #5c7268;
  --paper: #f3f7f4;
  --white: #ffffff;
  --brand: #0d7a5f;
  --brand-deep: #065f4a;
  --brand-bright: #14a886;
  --accent: #e8a317;
  --accent-soft: #fff3d6;
  --danger: #c43c3c;
  --success: #1a8f5c;
  --info: #1e6f9f;
  --line: rgba(15, 31, 26, 0.1);
  --shadow: 0 18px 50px rgba(6, 40, 32, 0.12);
  --radius: 14px;
  --font: "Outfit", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-deep); text-decoration: none; }
a:hover { color: var(--brand-bright); }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; margin: 0 0 0.5em; font-weight: 700; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.mt { margin-top: 1rem; }
.container { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(243, 247, 244, 0.85);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h); gap: 1rem;
}
.logo { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--ink); font-weight: 700; }
.logo:hover { color: var(--ink); }
.logo-mark {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--brand-bright), var(--brand-deep));
  color: #fff; font-family: var(--display); font-size: 1.15rem;
}
.logo-text { letter-spacing: 0.04em; font-size: 1.05rem; }
.site-nav { display: flex; align-items: center; gap: 1.1rem; }
.site-nav > a:not(.btn) { color: var(--ink-soft); font-weight: 500; font-size: 0.95rem; }
.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer; padding: 0.4rem;
  flex-direction: column; gap: 5px;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.7rem 1.2rem; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 24px rgba(13, 122, 95, 0.28); }
.btn-primary:hover { background: var(--brand-deep); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-accent { background: var(--accent); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* Hero — full bleed atmospheric */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: grid; align-items: end;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(120deg, rgba(6, 40, 32, 0.88) 0%, rgba(13, 90, 70, 0.55) 45%, rgba(15, 31, 26, 0.35) 100%),
    radial-gradient(ellipse at 20% 80%, rgba(232, 163, 23, 0.25), transparent 50%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(160deg, #0a3d32, #147a5c 40%, #1a4a6e);
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 800 600' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='680' cy='120' r='180' fill='%23ffffff' fill-opacity='0.04'/%3E%3Ccircle cx='100' cy='480' r='220' fill='%23e8a317' fill-opacity='0.08'/%3E%3C/svg%3E") center/cover;
  pointer-events: none;
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: scale(1) translate(0, 0); }
  to { transform: scale(1.08) translate(-2%, 1%); }
}
.hero-inner {
  position: relative; z-index: 1;
  padding: 4rem 0 5rem;
  max-width: 720px;
}
.hero-brand {
  font-family: var(--display);
  font-size: clamp(2.8rem, 7vw, 4.6rem);
  letter-spacing: -0.02em;
  margin-bottom: 0.35em;
  animation: rise 0.8s ease both;
}
.hero h1 {
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 500;
  color: rgba(255,255,255,0.92);
  margin-bottom: 0.75em;
  animation: rise 0.8s ease 0.1s both;
}
.hero p {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.78);
  max-width: 36ch;
  animation: rise 0.8s ease 0.2s both;
}
.hero-cta {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
  margin-top: 1.75rem;
  animation: rise 0.8s ease 0.3s both;
}
.hero .btn-primary { background: var(--accent); color: var(--ink); box-shadow: 0 10px 30px rgba(232,163,23,0.35); }
.hero .btn-ghost { border-color: rgba(255,255,255,0.35); color: #fff; }
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sections */
.section { padding: 4.5rem 0; }
.section-head { max-width: 560px; margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(1.75rem, 3vw, 2.35rem); }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.feature {
  padding: 1.5rem 0;
  border-top: 2px solid var(--brand);
  transition: transform .25s ease;
}
.feature:hover { transform: translateY(-4px); }
.feature i { color: var(--brand); margin-bottom: 0.75rem; width: 28px; height: 28px; }
.feature h3 { font-size: 1.2rem; }

.split {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 3rem; align-items: center;
}
.panel-visual {
  min-height: 320px; border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(13,122,95,0.9), rgba(30,111,159,0.75)),
    radial-gradient(circle at 70% 30%, rgba(232,163,23,0.4), transparent 45%);
  position: relative; overflow: hidden;
  animation: pulseGlow 6s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%, 100% { filter: saturate(1); }
  50% { filter: saturate(1.15) brightness(1.05); }
}
.panel-visual .stat-float {
  position: absolute; left: 1.5rem; bottom: 1.5rem;
  background: rgba(255,255,255,0.95); color: var(--ink);
  padding: 1rem 1.25rem; border-radius: 12px;
  box-shadow: var(--shadow);
}
.cta-band {
  background: linear-gradient(120deg, var(--brand-deep), #0a4a6e);
  color: #fff; padding: 3.5rem 0; text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band .muted { color: rgba(255,255,255,0.75); }

/* Forms */
.auth-body {
  min-height: 100vh; display: grid; place-items: center;
  background:
    radial-gradient(ellipse at 10% 20%, rgba(20,168,134,0.18), transparent 45%),
    radial-gradient(ellipse at 90% 80%, rgba(232,163,23,0.15), transparent 40%),
    var(--paper);
  padding: 2rem;
}
.auth-card, .form-card {
  width: min(440px, 100%);
  background: var(--white);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.brand-mark {
  font-family: var(--display); font-size: 1.6rem; color: var(--brand-deep); margin-bottom: 0.5rem;
}
label { display: block; font-weight: 600; font-size: 0.88rem; margin: 0.85rem 0 0.35rem; }
input, select, textarea {
  width: 100%; padding: 0.75rem 0.9rem;
  border: 1px solid var(--line); border-radius: 10px;
  font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(13,122,95,0.35); border-color: var(--brand);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.alert {
  padding: 0.85rem 1rem; border-radius: 10px; margin: 1rem 0; font-weight: 500;
}
.alert.success { background: #e5f7ee; color: var(--success); }
.alert.error { background: #fdeaea; color: var(--danger); }
.alert.info { background: #e8f3fa; color: var(--info); }

/* Dashboard */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.dash-sidebar {
  background: var(--ink);
  color: #fff;
  padding: 1.25rem 1rem;
  display: flex; flex-direction: column; gap: 1.25rem;
  position: sticky; top: 0; height: 100vh;
}
.dash-sidebar .logo { color: #fff; }
.dash-sidebar .logo-text { color: #fff; }
.role-pill {
  display: inline-block; margin-top: 0.5rem;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  background: rgba(20,168,134,0.25); color: #9fe8d4;
  padding: 0.25rem 0.55rem; border-radius: 999px;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; overflow-y: auto; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 0.65rem;
  color: rgba(255,255,255,0.72); padding: 0.65rem 0.75rem; border-radius: 10px;
  font-weight: 500; font-size: 0.92rem;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: rgba(255,255,255,0.08); color: #fff;
}
.sidebar-nav a.active { background: var(--brand); }
.sidebar-nav i { width: 18px; height: 18px; }
.sidebar-user {
  display: flex; gap: 0.75rem; align-items: center;
  padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar-user a { color: #9fe8d4; font-size: 0.8rem; display: block; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--brand-bright); display: grid; place-items: center; font-weight: 700;
}
.dash-main { padding: 1.75rem; }
.dash-header {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start;
  gap: 1rem; margin-bottom: 1.75rem;
}
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem;
  margin-bottom: 1.75rem;
}
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
}
.stat .label { color: var(--muted); font-size: 0.85rem; }
.stat .value { font-family: var(--display); font-size: 1.85rem; margin-top: 0.2rem; }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }

.card-list { display: grid; gap: 1rem; }
.item-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; display: grid; gap: 0.5rem;
}
.item-card h3 { font-size: 1.15rem; margin: 0; }
.meta-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; color: var(--muted); font-size: 0.88rem; }
.badge {
  display: inline-flex; align-items: center;
  padding: 0.2rem 0.55rem; border-radius: 6px;
  font-size: 0.75rem; font-weight: 600; background: var(--accent-soft); color: #8a5a00;
}
.badge.green { background: #e5f7ee; color: var(--success); }
.badge.blue { background: #e8f3fa; color: var(--info); }
.badge.red { background: #fdeaea; color: var(--danger); }

.grid-2 { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 1.25rem; }
.panel {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem;
}
.chart-box { position: relative; height: 280px; }

.progress {
  height: 8px; background: #e4ebe7; border-radius: 999px; overflow: hidden;
}
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: inherit; }

.quiz-option {
  display: block; padding: 0.9rem 1rem; margin: 0.5rem 0;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.quiz-option:hover, .quiz-option:has(input:checked) {
  border-color: var(--brand); background: rgba(13,122,95,0.06);
}
.quiz-option input { width: auto; margin-right: 0.6rem; }

.leaderboard li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 0; border-bottom: 1px solid var(--line); list-style: none;
}
.leaderboard { margin: 0; padding: 0; }
.rank { font-weight: 700; color: var(--brand); width: 2rem; }

.site-footer {
  background: var(--ink); color: rgba(255,255,255,0.8); padding: 3rem 0 1.5rem; margin-top: 3rem;
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr repeat(2, 1fr); gap: 2rem; margin-bottom: 2rem;
}
.site-footer a { display: block; color: rgba(255,255,255,0.7); margin: 0.35rem 0; }
.site-footer h4 { color: #fff; font-family: var(--font); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.06em; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1rem; font-size: 0.85rem; }

.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }

@media (max-width: 960px) {
  .split, .grid-2, .footer-grid { grid-template-columns: 1fr; }
  .app-shell { grid-template-columns: 1fr; }
  .dash-sidebar {
    position: relative; height: auto;
    display: grid; grid-template-columns: 1fr;
  }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: var(--header-h);
    background: var(--paper); flex-direction: column; padding: 1rem;
    border-bottom: 1px solid var(--line); align-items: stretch;
  }
  .site-nav.open { display: flex; }
  .form-row { grid-template-columns: 1fr; }
  .hero-inner { padding: 3rem 0 4rem; }
}
