/* ============================================================
   Edvorahub Core — shared design system
   Used by the main hub site, iBrainz, and ProjectPadi so the
   whole product family shares one visual language.
   ============================================================ */

:root{
  --navy:        #0C1230;
  --navy-soft:   #1B2352;
  --purple:      #7B2FF7;
  --purple-tint: #A855F7;
  --purple-pale: #F1EEFF;
  --ink:         #14162B;
  --ink-soft:    #6B7086;
  --line:        #E7E6F0;
  --bg:          #FBFAFF;
  --card:        #FFFFFF;
  --ok:          #2E7D5B;
  --ok-bg:       #EAFBF1;
  --warn:        #9A6B00;
  --warn-bg:     #FFF6E0;
  --danger:      #B3261E;
  --danger-bg:   #FDECEC;
  --info-bg:     #E9EDFF;
  --gradient:    linear-gradient(135deg, var(--navy) 0%, #2A1A6E 45%, var(--purple) 100%);

  --font-display:'Poppins', 'Bricolage Grotesque', sans-serif;
  --font-body:   'Inter', 'Instrument Sans', sans-serif;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 4px 14px rgba(12,18,48,.06);
  --shadow: 0 18px 40px -18px rgba(12,18,48,.35);
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0; font-family:var(--font-body); background:var(--bg); color:var(--ink);
  line-height:1.6; -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4{ font-family:var(--font-display); line-height:1.2; margin:0 0 .5em; font-weight:700; }
a{ color:inherit; text-decoration:none; }
img{ max-width:100%; display:block; }
:focus-visible{ outline:3px solid var(--purple-tint); outline-offset:2px; border-radius:4px; }

.ehc-wrap{ max-width:1160px; margin:0 auto; padding:0 24px; }
.ehc-muted{ color:var(--ink-soft); }
.ehc-center{ text-align:center; }

/* ---------- Buttons ---------- */
.ehc-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:13px 26px; border-radius:999px; font-weight:600; font-size:.95rem;
  border:1px solid transparent; cursor:pointer; font-family:var(--font-body);
  transition:transform .15s, box-shadow .15s, opacity .15s, background .15s; line-height:1;
}
.ehc-btn-primary{ background:var(--gradient); color:#fff; box-shadow:0 8px 20px rgba(123,47,247,.25); }
.ehc-btn-primary:hover{ transform:translateY(-1px); box-shadow:0 12px 26px rgba(123,47,247,.32); }
.ehc-btn-outline{ border-color:var(--line); color:var(--ink); background:#fff; }
.ehc-btn-outline:hover{ border-color:var(--purple); color:var(--purple); }
.ehc-btn-light{ background:rgba(255,255,255,.14); color:#fff; border-color:rgba(255,255,255,.35); }
.ehc-btn-ghost{ background:none; border:none; color:var(--purple); font-weight:600; padding:8px 4px; }
.ehc-btn-sm{ padding:8px 16px; font-size:.85rem; }
.ehc-btn-block{ width:100%; }
.ehc-btn[disabled]{ opacity:.5; cursor:not-allowed; }
.ehc-btn-google{
  width:100%; display:flex; align-items:center; justify-content:center; gap:10px;
  background:#fff; color:#3c4043; border:1px solid #dadce0; border-radius:8px;
  padding:.72rem 1rem; font-weight:600; font-size:.95rem; cursor:pointer;
}
.ehc-btn-google:hover{ background:#f8f9fa; box-shadow:0 1px 3px rgba(60,64,67,.3); }
.ehc-btn-google svg{ width:18px; height:18px; flex:none; }
.ehc-divider{ display:flex; align-items:center; gap:12px; margin:1.3rem 0; color:var(--ink-soft); font-size:.82rem; }
.ehc-divider::before,.ehc-divider::after{ content:""; flex:1; height:1px; background:var(--line); }

/* ---------- Header / nav ---------- */
.ehc-header{ position:sticky; top:0; z-index:50; background:rgba(251,250,255,.92); backdrop-filter:blur(10px); border-bottom:1px solid var(--line); }
.ehc-header .ehc-wrap{ display:flex; align-items:center; justify-content:space-between; height:76px; }
.ehc-brand{ display:flex; align-items:center; gap:10px; font-family:var(--font-display); font-weight:700; font-size:1.1rem; }
.ehc-brand img{ height:32px; width:auto; }
.ehc-nav{ display:flex; align-items:center; gap:26px; }
.ehc-nav a.ehc-navlink{ font-weight:500; color:var(--ink); font-size:.94rem; }
.ehc-nav a.ehc-navlink:hover{ color:var(--purple); }
.ehc-nav-toggle{ display:none; background:none; border:0; font-size:1.6rem; color:var(--navy); cursor:pointer; }
@media (max-width:800px){
  .ehc-nav{ position:fixed; inset:76px 0 0 0; background:#fff; flex-direction:column; align-items:flex-start;
            padding:24px; gap:4px; transform:translateX(100%); transition:.2s; overflow-y:auto; }
  .ehc-nav.open{ transform:translateX(0); }
  .ehc-nav a.ehc-navlink{ width:100%; padding:12px 0; border-bottom:1px solid var(--line); }
  .ehc-nav-toggle{ display:block; }
}

/* ---------- Hero ---------- */
.ehc-hero{ background:var(--gradient); color:#fff; padding:80px 0 90px; position:relative; overflow:hidden; }
.ehc-hero::after{ content:""; position:absolute; inset:0; background:radial-gradient(60% 60% at 80% 10%, rgba(255,255,255,.12), transparent 60%); }
.ehc-hero .ehc-wrap{ position:relative; }
.ehc-eyebrow{ display:inline-block; padding:6px 14px; border-radius:999px; background:rgba(255,255,255,.14); border:1px solid rgba(255,255,255,.3); font-size:.78rem; font-weight:700; letter-spacing:.04em; text-transform:uppercase; margin-bottom:18px; }
.ehc-eyebrow-dark{ color:var(--purple); font-weight:700; font-size:.8rem; letter-spacing:.05em; text-transform:uppercase; display:block; margin-bottom:8px; }
.ehc-hero h1{ font-size:clamp(2rem,4vw,3.2rem); max-width:760px; }
.ehc-hero p.ehc-lead{ font-size:1.1rem; max-width:600px; color:rgba(255,255,255,.85); margin-bottom:30px; }
.ehc-hero-actions{ display:flex; gap:14px; flex-wrap:wrap; }

/* ---------- Sections ---------- */
.ehc-section{ padding:80px 0; }
.ehc-section-head{ max-width:640px; margin:0 auto 44px; text-align:center; }
.ehc-alt{ background:#fff; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }

/* ---------- Grid & cards ---------- */
.ehc-grid{ display:grid; gap:22px; }
.ehc-grid-2{ grid-template-columns:repeat(2,1fr); }
.ehc-grid-3{ grid-template-columns:repeat(3,1fr); }
.ehc-grid-4{ grid-template-columns:repeat(4,1fr); }
@media (max-width:900px){ .ehc-grid-3,.ehc-grid-4{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:640px){ .ehc-grid-2,.ehc-grid-3,.ehc-grid-4{ grid-template-columns:1fr; } }

.ehc-card{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:26px; transition:transform .15s, box-shadow .15s; }
.ehc-card-hover:hover{ transform:translateY(-3px); box-shadow:var(--shadow-sm); }
.ehc-icon{ width:46px; height:46px; border-radius:12px; background:var(--gradient); color:#fff; display:flex; align-items:center; justify-content:center; margin-bottom:16px; flex:none; }
.ehc-icon svg{ width:22px; height:22px; }

/* ---------- Forms ---------- */
.ehc-form-group{ margin-bottom:18px; }
.ehc-form-group label{ display:block; font-weight:600; font-size:.88rem; margin-bottom:6px; }
.ehc-form-group small{ font-weight:400; color:var(--ink-soft); }
.ehc-input, .ehc-select, .ehc-textarea{
  width:100%; padding:12px 14px; border-radius:10px; border:1px solid var(--line);
  font-size:.95rem; font-family:inherit; background:#fff; color:var(--ink);
}
.ehc-input:focus, .ehc-select:focus, .ehc-textarea:focus{ outline:none; border-color:var(--purple); box-shadow:0 0 0 3px rgba(123,47,247,.12); }
.ehc-textarea{ resize:vertical; min-height:90px; }
.ehc-two-col{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
@media (max-width:560px){ .ehc-two-col{ grid-template-columns:1fr; } }

/* ---------- Auth pages ---------- */
.ehc-auth-body{ min-height:100vh; display:grid; place-items:center; padding:32px 16px; background:linear-gradient(160deg, var(--bg) 55%, var(--purple-pale)); }
.ehc-auth-card{ width:100%; max-width:440px; background:#fff; border:1px solid var(--line); border-radius:var(--radius-lg); padding:2.4rem; box-shadow:var(--shadow); border-top:6px solid var(--purple); }
.ehc-auth-card .ehc-brand{ margin-bottom:1.2rem; }
.ehc-auth-sub{ color:var(--ink-soft); font-size:.95rem; margin:.3rem 0 1.4rem; }
.ehc-auth-alt{ margin-top:1.2rem; font-size:.92rem; color:var(--ink-soft); text-align:center; }
.ehc-auth-alt a{ color:var(--purple); font-weight:700; }

/* ---------- Alerts ---------- */
.ehc-alert{ padding:13px 16px; border-radius:10px; margin-bottom:18px; font-size:.9rem; }
.ehc-alert-success{ background:var(--ok-bg); color:var(--ok); border:1px solid #b9ebd0; }
.ehc-alert-error{ background:var(--danger-bg); color:var(--danger); border:1px solid #f6c6c4; }
.ehc-alert-warn{ background:var(--warn-bg); color:var(--warn); border:1px solid #f2dfa3; }

/* ---------- Badges ---------- */
.ehc-badge{ padding:3px 11px; border-radius:999px; font-size:.74rem; font-weight:700; display:inline-block; }
.ehc-badge-ok{ background:var(--ok-bg); color:var(--ok); }
.ehc-badge-warn{ background:var(--warn-bg); color:var(--warn); }
.ehc-badge-danger{ background:var(--danger-bg); color:var(--danger); }
.ehc-badge-info{ background:var(--info-bg); color:#3B3FD6; }

/* ---------- App shell (dashboard layouts) ---------- */
.ehc-app{ display:flex; min-height:100vh; }
.ehc-sidebar{ width:230px; background:var(--navy); color:#fff; padding:26px 18px; flex-shrink:0; }
.ehc-sidebar .ehc-brand{ color:#fff; margin-bottom:30px; }
.ehc-sidebar a{ display:flex; align-items:center; gap:10px; padding:11px 12px; border-radius:9px; font-size:.9rem; color:rgba(255,255,255,.72); margin-bottom:3px; }
.ehc-sidebar a:hover, .ehc-sidebar a.active{ background:rgba(255,255,255,.1); color:#fff; }
.ehc-main{ flex:1; padding:32px; background:var(--bg); min-width:0; }
.ehc-topbar{ display:flex; justify-content:space-between; align-items:center; margin-bottom:26px; flex-wrap:wrap; gap:12px; }
.ehc-sidebar-toggle{ display:none; background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.3); color:#fff; border-radius:8px; padding:8px 12px; font-size:1.2rem; cursor:pointer; line-height:1; }
@media (max-width:800px){
  .ehc-app{ flex-direction:column; }
  .ehc-sidebar{ width:100%; display:flex; align-items:center; justify-content:space-between; padding:14px 18px; position:relative; z-index:40; }
  .ehc-sidebar .ehc-brand{ margin-bottom:0; }
  .ehc-sidebar-toggle{ display:block; }
  .ehc-sidebar-links{
    display:flex; flex-direction:column; position:fixed; inset:64px 0 0 0; background:var(--navy);
    padding:18px; overflow-y:auto; transform:translateX(100%); transition:.2s; z-index:39;
  }
  .ehc-sidebar-links.open{ transform:translateX(0); }
  .ehc-sidebar-links a{ padding:14px 12px; font-size:1rem; border-bottom:1px solid rgba(255,255,255,.1); border-radius:0; }
  .ehc-main{ padding:20px 16px; }
}
@media (max-width:420px){
  .ehc-main{ padding:16px 12px; }
  .ehc-brand{ font-size:1rem; }
}

/* ---------- Responsive layout helpers (used in place of hardcoded inline grid columns) ---------- */
.ehc-chapter-tabs{ grid-template-columns:repeat(5,1fr); }
@media (max-width:700px){ .ehc-chapter-tabs{ grid-template-columns:repeat(3,1fr); } }
@media (max-width:460px){ .ehc-chapter-tabs{ grid-template-columns:repeat(2,1fr); } }

.ehc-doc-with-sidebar{ grid-template-columns:2fr 1fr; }
@media (max-width:800px){ .ehc-doc-with-sidebar{ grid-template-columns:1fr; } }

/* ---------- Tables ---------- */
.ehc-table{ width:100%; border-collapse:collapse; background:#fff; border-radius:var(--radius); overflow:hidden; border:1px solid var(--line); }
.ehc-table th, .ehc-table td{ padding:12px 16px; text-align:left; font-size:.87rem; border-bottom:1px solid var(--line); }
.ehc-table th{ background:var(--bg); font-weight:700; }
.ehc-table tr:last-child td{ border-bottom:none; }

/* ---------- Stat tiles ---------- */
.ehc-stat{ background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:20px; }
.ehc-stat .ehc-k{ font-size:.8rem; color:var(--ink-soft); text-transform:uppercase; letter-spacing:.06em; }
.ehc-stat .ehc-v{ font-family:var(--font-display); font-size:1.8rem; margin-top:4px; }

/* ---------- Footer ---------- */
.ehc-footer{ background:var(--navy); color:rgba(255,255,255,.7); padding:56px 0 28px; }
.ehc-footer h4{ color:#fff; font-size:.92rem; margin-bottom:10px; }
.ehc-footer-grid{ display:grid; grid-template-columns:2fr 1fr 1fr 1fr; gap:32px; margin-bottom:40px; }
.ehc-footer-grid a{ display:block; padding:5px 0; font-size:.88rem; color:rgba(255,255,255,.65); }
.ehc-footer-grid a:hover{ color:#fff; }
.ehc-footer-bottom{ border-top:1px solid rgba(255,255,255,.12); padding-top:20px; font-size:.8rem; display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; }
@media (max-width:760px){ .ehc-footer-grid{ grid-template-columns:1fr 1fr; } }
@media (max-width:460px){ .ehc-footer-grid{ grid-template-columns:1fr; } }
@media (max-width:420px){ .ehc-auth-card{ padding:1.6rem; } }

/* ---------- Utility spacing ---------- */
.ehc-mt-0{ margin-top:0; } .ehc-mb-0{ margin-bottom:0; }
.ehc-gap-sm{ gap:10px; } .ehc-flex{ display:flex; } .ehc-items-center{ align-items:center; } .ehc-justify-between{ justify-content:space-between; }
