/* DocuHub — DocuHub-style design system */
:root{
  /* --primary is overridden inline from the admin "Branding" colour */
  --primary:#22a75b;
  --primary-hover:#16904a;
  --primary-soft:color-mix(in srgb,var(--primary) 12%,#fff);
  --primary-softer:color-mix(in srgb,var(--primary) 6%,#fff);
  --text:#0f172a;
  --text-muted:#64748b;
  --text-light:#94a3b8;
  --bg:#ffffff;
  --bg-soft:#f8fafc;
  --border:#e5e7eb;
  --border-soft:#f1f5f9;
  --dark-bg:#0f172a;
  --dark-bg-2:#1e293b;
  --star:#fbbf24;
  --radius:14px;
  --radius-sm:10px;
  --shadow-sm:0 1px 2px rgba(15,23,42,.05);
  --shadow:0 4px 20px rgba(15,23,42,.06);
  --shadow-lg:0 20px 40px -12px rgba(15,23,42,.1);
  --container:1200px;
  --font:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
}
[data-theme="dark"]{
  --text:#f1f5f9;
  --text-muted:#94a3b8;
  --text-light:#64748b;
  --bg:#0f172a;
  --bg-soft:#1e293b;
  --border:#334155;
  --border-soft:#1e293b;
  --primary-soft:color-mix(in srgb,var(--primary) 15%,transparent);
  --primary-softer:color-mix(in srgb,var(--primary) 8%,transparent);
}

*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:var(--font);
  color:var(--text);
  background:var(--bg);
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
a{color:inherit;text-decoration:none}
img,svg{display:block;max-width:100%}
button{font:inherit;cursor:pointer;border:0;background:none;color:inherit}
.icon{width:20px;height:20px;flex-shrink:0}
.container{max-width:var(--container);margin:0 auto;padding:0 24px}

/* ============ HEADER ============ */
.site-header{
  position:sticky;top:0;z-index:50;
  background:var(--bg);
  border-bottom:1px solid var(--border-soft);
  backdrop-filter:blur(10px);
}
.header-inner{display:flex;align-items:center;justify-content:space-between;height:72px;gap:24px}
.brand{display:flex;align-items:center;gap:10px;font-weight:700;font-size:20px}
.brand-logo{
  width:36px;height:36px;border-radius:9px;
  background:var(--primary);
  color:#fff;display:flex;align-items:center;justify-content:center;
  font-weight:800;font-size:20px;
  box-shadow:0 4px 12px color-mix(in srgb,var(--primary) 35%,transparent);
}
.nav-main{display:flex;align-items:center;gap:32px;flex:1;justify-content:center}
.nav-main a,.nav-item{
  font-size:14px;font-weight:500;color:var(--text);
  display:inline-flex;align-items:center;gap:4px;
  padding:8px 0;transition:color .15s;position:relative;
}
.nav-main a:hover,.nav-item:hover{color:var(--primary)}
.nav-item .chev{width:14px;height:14px;opacity:.6}
.dropdown{position:relative}
.dropdown-menu{
  position:absolute;top:100%;left:50%;transform:translateX(-50%);
  min-width:220px;background:var(--bg);
  border:1px solid var(--border);border-radius:12px;
  box-shadow:var(--shadow-lg);
  padding:8px;display:none;
  margin-top:8px;
}
.dropdown:hover .dropdown-menu{display:block}
.dropdown-menu a{
  display:block;padding:10px 14px;font-size:14px;
  border-radius:8px;color:var(--text);font-weight:500;
}
.dropdown-menu a:hover{background:var(--primary-softer);color:var(--primary)}
.header-actions{display:flex;align-items:center;gap:10px}
.theme-toggle{
  width:38px;height:38px;border-radius:10px;
  display:flex;align-items:center;justify-content:center;
  color:var(--text-muted);transition:background .15s;
}
.theme-toggle:hover{background:var(--bg-soft)}
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  padding:10px 20px;border-radius:10px;
  font-size:14px;font-weight:600;
  transition:all .15s;white-space:nowrap;cursor:pointer;
}
.btn-outline{border:1.5px solid var(--border);color:var(--text);background:var(--bg)}
.btn-outline:hover{border-color:var(--primary);color:var(--primary)}
.btn-primary{background:var(--primary);color:#fff;border:1.5px solid var(--primary)}
.btn-primary:hover{background:var(--primary-hover);border-color:var(--primary-hover)}
.btn-lg{padding:14px 28px;font-size:15px}
.btn-block{width:100%}
.menu-toggle{display:none}

/* ============ HERO ============ */
.hero{
  padding:60px 0 100px;
  background:linear-gradient(180deg,var(--primary-softer) 0%,var(--bg) 100%);
  position:relative;overflow:hidden;
}
.hero-grid{display:grid;grid-template-columns:1fr 1fr;gap:60px;align-items:center}
.hero-badge{
  display:inline-flex;align-items:center;gap:6px;
  padding:6px 14px;border-radius:999px;
  background:var(--primary-soft);color:var(--primary);
  font-size:13px;font-weight:600;margin-bottom:24px;
}
.hero h1{
  font-size:clamp(36px,5vw,60px);
  font-weight:800;line-height:1.1;margin:0 0 20px;letter-spacing:-.02em;
}
.hero h1 .accent{color:var(--primary)}
.hero-subtitle{font-size:17px;color:var(--text-muted);margin:0 0 28px;max-width:480px}
.hero-badges{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:32px}
.hero-badge-item{
  display:inline-flex;align-items:center;gap:8px;
  padding:8px 14px;border-radius:999px;
  background:var(--bg);border:1px solid var(--border);
  font-size:13px;font-weight:600;
  box-shadow:var(--shadow-sm);
}
.hero-badge-item .icon{width:16px;height:16px;color:var(--primary)}
.trust{display:flex;align-items:center;gap:14px}
.avatars{display:flex}
.avatars .avatar{
  width:34px;height:34px;border-radius:50%;
  background:linear-gradient(135deg,#fbbf24,#f97316);
  border:2.5px solid var(--bg);margin-left:-8px;
  display:flex;align-items:center;justify-content:center;
  color:#fff;font-weight:700;font-size:12px;
}
.avatars .avatar:first-child{margin-left:0}
.avatars .avatar:nth-child(2){background:linear-gradient(135deg,#60a5fa,#3b82f6)}
.avatars .avatar:nth-child(3){background:linear-gradient(135deg,#a78bfa,#7c3aed)}
.avatars .avatar:nth-child(4){background:linear-gradient(135deg,#34d399,#059669)}
.trust-text{font-size:13px;color:var(--text-muted);font-weight:500}
.trust-text .stars{color:var(--star);letter-spacing:1px;display:block;margin-top:2px}

/* Upload card */
.upload-card{
  background:var(--bg);border-radius:20px;
  padding:40px;border:2px dashed var(--border);
  box-shadow:var(--shadow-lg);
  text-align:center;position:relative;
}
.upload-illustration{
  width:180px;height:180px;margin:0 auto 20px;
  position:relative;
}
.upload-illustration svg{width:100%;height:100%}
.upload-title{font-size:18px;font-weight:600;margin:0 0 4px;color:var(--text)}
.upload-or{font-size:14px;color:var(--text-muted);margin:12px 0}
.upload-note{font-size:12px;color:var(--text-light);margin-top:16px}
.upload-input{display:none}

/* ============ TOOLS SECTION ============ */
.section{padding:80px 0}
.section-head{text-align:center;margin-bottom:48px}
.section-title{font-size:36px;font-weight:800;margin:0 0 12px;letter-spacing:-.02em}
.section-title .accent{color:var(--primary)}
.section-subtitle{color:var(--text-muted);font-size:16px;max-width:560px;margin:0 auto}
.tools-grid{
  display:grid;grid-template-columns:repeat(4,1fr);gap:20px;
}
.tool-card{
  background:var(--bg);border:1px solid var(--border);
  border-radius:var(--radius);padding:24px;
  transition:all .2s;display:flex;flex-direction:column;
  min-height:180px;position:relative;
}
.tool-card:hover{
  transform:translateY(-4px);
  box-shadow:var(--shadow-lg);
  border-color:transparent;
}
.tool-icon{
  width:48px;height:48px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  margin-bottom:16px;
}
.tool-icon .icon{width:24px;height:24px}
.tool-card h3{font-size:16px;font-weight:700;margin:0 0 6px}
.tool-card p{font-size:13px;color:var(--text-muted);margin:0;line-height:1.5;flex:1}
.tool-arrow{
  margin-top:14px;align-self:flex-start;
  width:28px;height:28px;display:flex;align-items:center;justify-content:center;
  transition:transform .2s;
}
.tool-arrow .icon{width:18px;height:18px}
.tool-card:hover .tool-arrow{transform:translateX(4px)}
.explore-wrap{text-align:center;margin-top:40px}
.btn-explore{
  background:var(--bg);border:1.5px solid var(--primary);color:var(--primary);
  padding:12px 24px;border-radius:10px;font-weight:600;
  display:inline-flex;align-items:center;gap:8px;
}
.btn-explore:hover{background:var(--primary);color:#fff}

/* ============ FEATURES STRIP ============ */
.features{
  background:var(--primary-softer);
  padding:44px 0;
}
.features-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:32px}
.feature{display:flex;align-items:flex-start;gap:14px}
.feature-icon{
  width:44px;height:44px;border-radius:10px;
  background:var(--primary-soft);color:var(--primary);
  display:flex;align-items:center;justify-content:center;flex-shrink:0;
}
.feature-icon .icon{width:22px;height:22px}
.feature h4{margin:0 0 4px;font-size:15px;font-weight:700}
.feature p{margin:0;font-size:13px;color:var(--text-muted);line-height:1.5}

/* ============ STATS BAR ============ */
.stats-wrap{padding:24px 0 80px}
.stats{
  background:var(--dark-bg);
  border-radius:16px;
  padding:32px 40px;
  display:grid;grid-template-columns:repeat(4,1fr);gap:24px;
}
.stat{display:flex;align-items:center;gap:16px}
.stat-icon{
  width:48px;height:48px;border-radius:12px;
  background:rgba(255,255,255,.06);
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;
}
.stat-icon .icon{width:24px;height:24px}
.stat-value{font-size:24px;font-weight:800;color:#fff;line-height:1.1}
.stat-label{font-size:13px;color:#94a3b8;margin-top:2px}

/* ============ FOOTER ============ */
.site-footer{
  background:var(--bg-soft);
  border-top:1px solid var(--border-soft);
  padding:60px 0 24px;
}
.footer-grid{
  display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:48px;
  margin-bottom:40px;
}
.footer-brand p{color:var(--text-muted);font-size:14px;margin:16px 0 20px;max-width:340px}
.socials{display:flex;gap:10px}
.social{
  width:36px;height:36px;border-radius:10px;
  background:var(--bg);border:1px solid var(--border);
  display:flex;align-items:center;justify-content:center;
  color:var(--text-muted);transition:all .15s;
}
.social:hover{background:var(--primary);color:#fff;border-color:var(--primary)}
.footer-col h5{font-size:14px;font-weight:700;margin:0 0 16px;color:var(--text)}
.footer-col ul{list-style:none;padding:0;margin:0}
.footer-col li{margin-bottom:10px}
.footer-col a{color:var(--text-muted);font-size:14px;transition:color .15s}
.footer-col a:hover{color:var(--primary)}
.footer-bottom{
  padding-top:24px;border-top:1px solid var(--border-soft);
  display:flex;justify-content:space-between;align-items:center;
  font-size:13px;color:var(--text-muted);flex-wrap:wrap;gap:12px;
}

/* ============ FLASH ============ */
.flashes{position:fixed;top:20px;right:20px;z-index:100;display:flex;flex-direction:column;gap:8px}
.back-to-top,.scroll-to-bottom{
  position:fixed;right:24px;z-index:90;
  width:44px;height:44px;border-radius:10px;
  display:flex;align-items:center;justify-content:center;
  color:#fff;background:var(--primary);box-shadow:var(--shadow-lg);
  opacity:0;visibility:hidden;transform:translateY(8px);
  transition:opacity .15s,visibility .15s,transform .15s,background .15s;
}
.back-to-top{bottom:76px}
.scroll-to-bottom{bottom:24px}
.back-to-top.is-visible,.scroll-to-bottom.is-visible{opacity:1;visibility:visible;transform:translateY(0)}
.back-to-top:hover,.scroll-to-bottom:hover{background:var(--primary-hover)}
.back-to-top:focus-visible,.scroll-to-bottom:focus-visible{outline:3px solid var(--primary-soft);outline-offset:3px}
.back-to-top .icon,.scroll-to-bottom .icon{width:20px;height:20px}
@media (max-width:600px){.back-to-top,.scroll-to-bottom{right:16px}.back-to-top{bottom:68px}.scroll-to-bottom{bottom:16px}}
@media (prefers-reduced-motion:reduce){.back-to-top,.scroll-to-bottom{transition:none}}
.flash{
  padding:12px 18px;border-radius:10px;
  background:var(--bg);border:1px solid var(--border);
  box-shadow:var(--shadow-lg);font-size:14px;min-width:260px;
}
.flash-success{border-left:4px solid #22c55e}
.flash-error{border-left:4px solid #ef4444}
.flash-info{border-left:4px solid var(--primary)}

/* ============ AUTH / MODAL ============ */
.auth-card{
  max-width:420px;margin:80px auto;padding:36px;
  background:var(--bg);border:1px solid var(--border);
  border-radius:16px;box-shadow:var(--shadow);
}
.auth-card h1{font-size:24px;margin:0 0 8px}
.auth-card p.sub{color:var(--text-muted);font-size:14px;margin:0 0 24px}
.form-group{margin-bottom:16px}
.form-group label{display:block;font-size:13px;font-weight:600;margin-bottom:6px}
.form-control{
  width:100%;padding:11px 14px;font-size:14px;
  border:1.5px solid var(--border);border-radius:10px;
  background:var(--bg);color:var(--text);transition:border-color .15s;
}
.form-control:focus{outline:none;border-color:var(--primary)}
textarea.form-control{min-height:140px;font-family:inherit;resize:vertical}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}

/* ============ PAGE (legal) ============ */
.page-hero{
  padding:60px 0 40px;
  background:linear-gradient(180deg,var(--primary-softer),transparent);
  text-align:center;
}
.page-hero h1{font-size:42px;margin:0 0 8px;font-weight:800}
.page-body{
  max-width:820px;margin:0 auto;padding:40px 24px 80px;
  font-size:16px;line-height:1.8;color:var(--text);
}
.page-body h2{font-size:24px;margin-top:36px;margin-bottom:12px;font-weight:700}
.page-body h3{font-size:19px;margin-top:24px;font-weight:700}
.page-body a{color:var(--primary);text-decoration:underline}

/* ============ TOOL PAGE ============ */
.tool-hero{padding:60px 0;background:linear-gradient(180deg,var(--primary-softer),transparent);text-align:center}
.tool-hero .tool-icon-big{
  width:80px;height:80px;border-radius:20px;
  margin:0 auto 20px;display:flex;align-items:center;justify-content:center;
}
.tool-hero .tool-icon-big .icon{width:36px;height:36px;color:#fff}
.tool-hero h1{font-size:40px;margin:0 0 12px;font-weight:800}
.tool-hero p{font-size:17px;color:var(--text-muted);max-width:600px;margin:0 auto}
.tool-body{max-width:720px;margin:-40px auto 80px;padding:0 24px;position:relative}

/* ============ ADMIN ============ */
.admin-wrap{display:grid;grid-template-columns:260px 1fr;min-height:100vh}
.admin-sidebar{
  background:var(--dark-bg);color:#e2e8f0;padding:24px 0;
  position:sticky;top:0;height:100vh;overflow-y:auto;
}
.admin-sidebar .brand{color:#fff;padding:0 24px 20px;border-bottom:1px solid rgba(255,255,255,.06)}
.admin-nav{padding:16px 0}
.admin-nav a{
  display:flex;align-items:center;gap:10px;
  padding:11px 24px;font-size:14px;color:#cbd5e1;font-weight:500;
  transition:all .15s;border-left:3px solid transparent;
}
.admin-nav a:hover{background:rgba(255,255,255,.04);color:#fff}
.admin-nav a.active{background:color-mix(in srgb,var(--primary) 16%,transparent);color:#fff;border-left-color:var(--primary)}
.admin-nav a .icon{width:18px;height:18px}
.admin-main{padding:28px 36px;background:var(--bg-soft);min-height:100vh}
.admin-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}
.admin-header h1{margin:0;font-size:24px;font-weight:700}
.admin-card{
  background:var(--bg);border:1px solid var(--border);
  border-radius:14px;padding:24px;margin-bottom:20px;
}
.admin-card h2{margin:0 0 4px;font-size:17px;font-weight:700}
.admin-card .desc{color:var(--text-muted);font-size:13px;margin:0 0 20px}
.table{width:100%;border-collapse:collapse;font-size:14px}
.table th,.table td{padding:11px 12px;text-align:left;border-bottom:1px solid var(--border-soft)}
.table th{font-weight:600;color:var(--text-muted);font-size:12px;text-transform:uppercase;letter-spacing:.5px}
.table tr:last-child td{border-bottom:0}
.btn-sm{padding:6px 12px;font-size:13px}
.btn-danger{background:#ef4444;color:#fff;border:1.5px solid #ef4444}
.btn-danger:hover{background:#dc2626}
.tag{display:inline-block;padding:3px 8px;border-radius:6px;font-size:11px;font-weight:600;background:var(--bg-soft);color:var(--text-muted)}
.tag-on{background:#dcfce7;color:#166534}
.tag-off{background:#fee2e2;color:#991b1b}
.color-swatch{display:inline-block;width:20px;height:20px;border-radius:5px;border:1px solid var(--border);vertical-align:middle}

/* ============ RESPONSIVE ============ */
@media (max-width:900px){
  .hero-grid{grid-template-columns:1fr;gap:40px}
  .tools-grid{grid-template-columns:repeat(2,1fr)}
  .features-grid{grid-template-columns:repeat(2,1fr);gap:24px}
  .stats{grid-template-columns:repeat(2,1fr)}
  .footer-grid{grid-template-columns:1fr 1fr;gap:32px}
  .nav-main{display:none}
  .menu-toggle{display:inline-flex}
  .admin-wrap{grid-template-columns:1fr}
  .admin-sidebar{position:relative;height:auto}
}
@media (max-width:560px){
  .tools-grid{grid-template-columns:1fr 1fr}
  .stats{grid-template-columns:1fr 1fr;padding:24px}
  .footer-grid{grid-template-columns:1fr}
  .section{padding:56px 0}
  .hero{padding:40px 0 60px}
  .upload-card{padding:24px}
  .form-row{grid-template-columns:1fr}
}
