/* ======================================================
   common.css — CorpFlow shared styles
   All pages link this file. Do NOT put page-specific
   CSS here.
====================================================== */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ── Design tokens ── */
:root {
  --blue:        #0078d4;
  --blue-dark:   #004f8c;
  --blue-hover:  #106ebe;
  --teal:        #00b294;
  --dark:        #252423;
  --deeper:      #201f1e;
  --indigo:      #2D1B69;
  --light:       #f3f2f1;
  --bg:          #f3f2f1;
  --white:       #ffffff;
  --muted:       #605e5c;
  --border:      #edebe9;
  --red:         #a4262c;
  --green:       #107c10;
  --orange:      #d47b00;
  --ff:          'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --r-sm:        6px;
  --r-md:        12px;
  --r-lg:        20px;
  --r-xl:        28px;
  --sh-sm:       0 1px 4px rgba(0,0,0,0.06);
  --sh-md:       0 4px 20px rgba(0,0,0,0.10);
  --sh-lg:       0 12px 40px rgba(0,0,0,0.15);
  --sh-xl:       0 24px 80px rgba(0,0,0,0.24);
  --ease:        0.22s cubic-bezier(0.4,0,0.2,1);
}

/* ── Base ── */
body {
  font-family: var(--ff);
  background: var(--white);
  color: var(--deeper);
  line-height: 1.6;
  overflow-x: hidden;
}

a      { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; outline: none; font-family: var(--ff); }
svg    { display: block; }

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible        { opacity: 1; transform: none; }
.reveal-d1.visible     { transition-delay: 0.10s; }
.reveal-d2.visible     { transition-delay: 0.20s; }
.reveal-d3.visible     { transition-delay: 0.30s; }

/* ======================================================
   HEADER
====================================================== */
.header {
  position: sticky; top: 0; z-index: 900;
  height: 64px;
  background: var(--dark);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex; align-items: center;
  padding: 0 32px; gap: 24px;
}

.logo-link {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.logo-link .wordmark {
  font-size: 20px; font-weight: 700;
  color: var(--white); letter-spacing: -0.3px;
}

.nav {
  display: flex; align-items: center; gap: 4px;
  margin: 0 auto;
}
.nav a {
  padding: 8px 16px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500;
  color: rgba(255,255,255,0.7);
  transition: color var(--ease), background var(--ease);
}
.nav a:hover,
.nav a.active { color: var(--white); background: rgba(255,255,255,0.08); }

.btn-login {
  padding: 9px 22px; border-radius: 100px;
  background: var(--blue); color: var(--white);
  font-size: 14px; font-weight: 600;
  transition: background var(--ease), transform var(--ease), box-shadow var(--ease);
  flex-shrink: 0;
}
.btn-login:hover {
  background: var(--blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,120,212,0.4);
}

/* ── Hamburger ── */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  padding: 6px; background: none; margin-left: auto;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--white); border-radius: 2px;
  transition: all var(--ease);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile nav ── */
.mobile-nav {
  display: none; position: fixed;
  top: 64px; left: 0; right: 0; z-index: 890;
  background: var(--dark);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding: 16px 24px 24px;
  flex-direction: column; gap: 4px;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  padding: 12px 16px; border-radius: var(--r-sm);
  color: rgba(255,255,255,0.8); font-size: 16px; font-weight: 500;
  transition: background var(--ease), color var(--ease);
}
.mobile-nav a:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.mobile-nav .btn-login { margin-top: 8px; text-align: center; }

/* ======================================================
   FOOTER
====================================================== */
.footer { background: var(--dark); padding: 56px 32px 32px; border-top: 1px solid rgba(255,255,255,0.07); }
.footer-inner { max-width: 1160px; margin: 0 auto; }
.footer-top {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr;
  gap: 48px; padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.07); margin-bottom: 32px;
}
.footer-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-logo .wordmark { font-size: 20px; font-weight: 700; color: var(--white); letter-spacing: -0.3px; }
.footer-tag { font-size: 13px; color: rgba(255,255,255,0.35); line-height: 1.6; }

.footer-col-title { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.4); margin-bottom: 16px; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-links a { font-size: 14px; color: rgba(255,255,255,0.55); transition: color var(--ease); }
.footer-links a:hover { color: var(--white); }

.footer-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-copy { font-size: 13px; color: rgba(255,255,255,0.25); }
.footer-legal { display: flex; gap: 20px; }
.footer-legal a { font-size: 13px; color: rgba(255,255,255,0.35); transition: color var(--ease); }
.footer-legal a:hover { color: rgba(255,255,255,0.7); }

/* ======================================================
   LOGIN MODAL
====================================================== */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(8px);
  align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.open { display: flex; }

.login-box {
  background: #1e1d1c; border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-xl); padding: 40px; width: 100%; max-width: 460px;
  position: relative; box-shadow: 0 40px 100px rgba(0,0,0,0.6);
}

.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.5);
  font-size: 18px; display: flex; align-items: center; justify-content: center;
  transition: all var(--ease);
}
.modal-close:hover { background: rgba(255,255,255,0.12); color: var(--white); }

.modal-logo-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.modal-logo-row span { font-size: 16px; font-weight: 700; color: var(--white); }

.modal-title    { font-size: 26px; font-weight: 800; color: var(--white); letter-spacing: -0.5px; margin-bottom: 4px; }
.modal-subtitle { font-size: 14px; color: rgba(255,255,255,0.4); margin-bottom: 28px; }

.modal-lbl { display: block; font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.5); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 8px; }
.modal-inp {
  width: 100%; padding: 14px 16px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-md); font-size: 15px; color: var(--white);
  font-family: var(--ff); transition: border-color var(--ease), background var(--ease); outline: none;
}
.modal-inp::placeholder { color: rgba(255,255,255,0.25); }
.modal-inp:focus  { border-color: var(--blue); background: rgba(0,120,212,0.06); }
.modal-inp.err    { border-color: #ef4444; background: rgba(239,68,68,0.06); }

.modal-err { margin-top: 8px; font-size: 12px; color: #f87171; min-height: 18px; }
.modal-err a { color: #60b4f5; text-decoration: underline; }

.modal-btn {
  width: 100%; padding: 15px; margin-top: 20px;
  background: var(--blue); color: var(--white);
  font-size: 15px; font-weight: 700; border-radius: var(--r-md);
  box-shadow: 0 4px 20px rgba(0,120,212,0.3);
  transition: all var(--ease); letter-spacing: -0.2px;
}
.modal-btn:hover { background: var(--blue-hover); transform: translateY(-1px); box-shadow: 0 6px 28px rgba(0,120,212,0.5); }
.modal-note { text-align: center; font-size: 12px; color: rgba(255,255,255,0.2); margin-top: 20px; }

/* Workspace options panel */
#panel-options { display: none; }
#panel-options.active { display: block; }
.ws-org-name {
  text-align: center; font-size: 13px; color: rgba(255,255,255,0.5);
  margin-bottom: 20px; font-style: italic;
}
.ws-org-name strong { color: #60b4f5; font-style: normal; }
.ws-btn-group { display: flex; flex-direction: column; gap: 10px; }
.ws-btn {
  width: 100%; padding: 14px 20px;
  border-radius: var(--r-md); font-size: 14px; font-weight: 700;
  text-align: center; cursor: pointer; transition: all var(--ease);
  letter-spacing: -0.2px;
}
.ws-btn-primary {
  background: var(--blue); color: var(--white);
  box-shadow: 0 4px 20px rgba(0,120,212,0.3);
}
.ws-btn-primary:hover { background: var(--blue-hover); transform: translateY(-1px); box-shadow: 0 6px 28px rgba(0,120,212,0.5); }
.ws-btn-ghost {
  background: transparent; color: rgba(255,255,255,0.75);
  border: 1px solid rgba(255,255,255,0.15);
}
.ws-btn-ghost:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.3); color: var(--white); }
.ws-back {
  text-align: center; font-size: 12px; color: rgba(255,255,255,0.25);
  margin-top: 16px; cursor: pointer; transition: color var(--ease);
}
.ws-back:hover { color: rgba(255,255,255,0.6); }

/* ======================================================
   LEGAL MODALS
====================================================== */
.legal-overlay { display: none; position: fixed; inset: 0; z-index: 9500; background: rgba(0,0,0,0.7); backdrop-filter: blur(6px); align-items: center; justify-content: center; padding: 24px; }
.legal-overlay.open { display: flex; }
.legal-box { background: var(--white); border-radius: var(--r-xl); padding: 40px; width: 100%; max-width: 580px; max-height: 80vh; overflow-y: auto; position: relative; box-shadow: var(--sh-xl); }
.legal-box h2 { font-size: 24px; font-weight: 800; color: var(--deeper); margin-bottom: 20px; padding-right: 40px; letter-spacing: -0.5px; }
.legal-box p  { font-size: 15px; color: var(--muted); line-height: 1.75; margin-bottom: 14px; }
.legal-close  { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; background: var(--light); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--muted); cursor: pointer; border: none; transition: all var(--ease); }
.legal-close:hover { background: var(--border); color: var(--deeper); }

/* ======================================================
   RESPONSIVE — shared components only
====================================================== */
@media (max-width: 768px) {
  .header .nav { display: none; }
  .header .btn-login { display: none; }
  .hamburger { display: flex; }
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .login-box { padding: 28px 24px; }
}
