/* ==========================================================================
   ClientLock — Milestone & Payment Protection Portal
   Design System & Styling
   ========================================================================== */

:root {
  --bg: #07070f;
  --bg-elev: #0e0e1a;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-hover: rgba(255, 255, 255, 0.07);
  --line: rgba(167, 139, 250, 0.16);
  --line-strong: rgba(167, 139, 250, 0.32);
  --text: #f6f5ff;
  --text-muted: #9e9cb6;
  --text-dim: #717088;
  
  --acc: #8b5cf6;
  --acc-glow: rgba(139, 92, 246, 0.35);
  --cyan: #22d3ee;
  --mint: #5eead4;
  --mint-bg: rgba(94, 234, 212, 0.12);
  --amber: #fbbf24;
  --rose: #f43f5e;
  
  --grad: linear-gradient(120deg, #8b5cf6, #22d3ee 60%, #5eead4);
  --grad-btn: linear-gradient(120deg, #7c3aed, #06b6d4);
  --grad-glow: radial-gradient(circle, rgba(124, 58, 237, 0.18), transparent 70%);
  
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

html[data-theme='light'] {
  --bg: #f8f7fd;
  --bg-elev: #ffffff;
  --panel: rgba(76, 60, 160, 0.035);
  --panel-hover: rgba(76, 60, 160, 0.06);
  --line: rgba(76, 60, 160, 0.12);
  --line-strong: rgba(76, 60, 160, 0.24);
  --text: #12111d;
  --text-muted: #56546c;
  --text-dim: #787690;
  --mint-bg: rgba(13, 147, 115, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Ambient glow */
.ambient-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.ambient-glow span {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
}
.ambient-glow span:nth-child(1) {
  width: 500px;
  height: 500px;
  top: -100px;
  left: -100px;
  background: #7c3aed;
}
.ambient-glow span:nth-child(2) {
  width: 480px;
  height: 480px;
  bottom: -80px;
  right: -80px;
  background: #0e7490;
}

/* Header / Nav */
.cl-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 7, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 1.5rem;
}
html[data-theme='light'] .cl-header {
  background: rgba(248, 247, 253, 0.9);
}
.cl-header-in {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.cl-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.cl-brand-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--mint-bg);
  color: var(--mint);
  border: 1px solid rgba(94, 234, 212, 0.3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}
.cl-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Mode Switcher Tabs */
.cl-mode-pill {
  display: inline-flex;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 3px;
  border-radius: var(--radius-pill);
}
.cl-mode-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font: 600 0.82rem var(--font-main);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
}
.cl-mode-btn.active {
  background: var(--grad-btn);
  color: #fff;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
}

/* Layout Containers */
.cl-container {
  position: relative;
  z-index: 1;
  max-width: 1140px;
  margin: 2.5rem auto 4rem;
  padding: 0 1.25rem;
}

/* Hero Section */
.cl-hero {
  text-align: center;
  margin-bottom: 2.5rem;
}
.cl-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.8rem;
}
.cl-eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 8px var(--mint);
}
.cl-hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}
.cl-grad-txt {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.cl-hero p {
  color: var(--text-muted);
  font-size: 1.08rem;
  max-width: 620px;
  margin: 0 auto;
}

/* Workspace Grid (2 Columns) */
.cl-workspace-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 920px) {
  .cl-workspace-grid {
    grid-template-columns: 1fr;
  }
}

/* Card Shell */
.cl-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.cl-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.4rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.cl-card-head h3 {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cl-card-head span.badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.1);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(34, 211, 238, 0.25);
}

/* Form Styles */
.cl-form-group {
  margin-bottom: 1.2rem;
}
.cl-form-group label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.cl-input, .cl-select, .cl-textarea {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font: 500 0.94rem var(--font-main);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.cl-input:focus, .cl-select:focus, .cl-textarea:focus {
  border-color: var(--acc);
  box-shadow: 0 0 0 3px var(--acc-glow);
}
.cl-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

/* Milestone Builder List */
.cl-milestone-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  margin-bottom: 0.85rem;
  position: relative;
  transition: border-color 0.2s;
}
.cl-milestone-item:hover {
  border-color: var(--line-strong);
}
.cl-milestone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}
.cl-milestone-num {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--mint);
  text-transform: uppercase;
}
.cl-remove-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}
.cl-remove-btn:hover {
  color: var(--rose);
}

/* Buttons */
.btn-primary-cl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--grad-btn);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.8rem 1.6rem;
  font: 700 0.96rem var(--font-main);
  cursor: pointer;
  box-shadow: 0 8px 24px -6px rgba(124, 58, 237, 0.6);
  transition: all 0.2s ease;
}
.btn-primary-cl:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -6px rgba(34, 211, 238, 0.5);
}

.btn-secondary-cl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 0.7rem 1.3rem;
  font: 600 0.9rem var(--font-main);
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-secondary-cl:hover {
  border-color: var(--cyan);
  background: var(--panel-hover);
  transform: translateY(-1px);
}

.btn-whatsapp-cl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #25d366;
  color: #07070f;
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.75rem 1.4rem;
  font: 700 0.92rem var(--font-main);
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-whatsapp-cl:hover {
  background: #1ebd59;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -6px rgba(37, 211, 102, 0.5);
}

/* Client Portal Live Preview */
.cl-client-portal {
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top right, rgba(139, 92, 246, 0.08), transparent 60%), var(--bg-elev);
}
.cl-portal-banner {
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.15), rgba(34, 211, 238, 0.12));
  border-bottom: 1px solid var(--line);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cl-portal-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--mint);
  font-weight: 700;
}
.cl-portal-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 8px var(--mint);
}

.cl-client-milestone {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  margin-bottom: 1rem;
  background: var(--panel);
  position: relative;
  transition: all 0.2s ease;
}
.cl-client-milestone.paid {
  border-color: rgba(94, 234, 212, 0.4);
  background: rgba(94, 234, 212, 0.04);
}
.cl-ms-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  text-transform: uppercase;
}
.cl-ms-tag.unpaid {
  background: rgba(251, 191, 36, 0.15);
  color: var(--amber);
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.cl-ms-tag.paid {
  background: var(--mint-bg);
  color: var(--mint);
  border: 1px solid rgba(94, 234, 212, 0.3);
}

.cl-deliverable-box {
  margin-top: 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.86rem;
}
.cl-deliverable-locked {
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
}
.cl-deliverable-unlocked {
  color: var(--mint);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

/* Scope Checklist Box */
.cl-scope-box {
  margin-top: 1.4rem;
  padding: 1.2rem;
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--line);
}
.cl-scope-box h4 {
  font-size: 0.94rem;
  margin-bottom: 0.6rem;
}
.cl-scope-list {
  list-style: none;
  display: grid;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.cl-scope-list li::before {
  content: "✓ ";
  color: var(--mint);
  font-weight: 800;
}

/* Financial Total Bar */
.cl-total-bar {
  margin-top: 1.4rem;
  padding: 1rem 1.4rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(34, 211, 238, 0.08));
  border: 1px solid var(--line-strong);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cl-total-bar strong {
  font-size: 1.35rem;
  font-family: var(--font-mono);
  color: var(--text);
}

/* Modal */
.cl-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(4, 5, 14, 0.82);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
}
.cl-modal-card {
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  padding: 2.2rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.85);
  position: relative;
}
.cl-modal-close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

/* Pro SaaS Pricing Badge */
.cl-pro-badge {
  background: linear-gradient(120deg, #f59e0b, #ef4444);
  color: #fff;
  font: 800 0.65rem/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 3px 7px;
  border-radius: 4px;
}

/* SEO Content & FAQ Section */
.cl-seo-section {
  max-width: 900px;
  margin: 4rem auto 2rem;
  padding: 2.5rem 1.5rem 1rem;
  border-top: 1px solid var(--line);
}
.cl-seo-section h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 2.5rem 0 1rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.cl-seo-section p {
  color: var(--text-muted);
  line-height: 1.7;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}
.cl-seo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
  margin: 2rem 0;
}
.cl-seo-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.4rem;
}
.cl-seo-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--cyan);
}
.cl-seo-card p {
  font-size: 0.88rem;
  margin-bottom: 0;
}
.cl-faq-list dt {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin: 1.4rem 0 0.4rem;
}
.cl-faq-list dd {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-left: 0;
  margin-bottom: 1.2rem;
  padding-left: 1rem;
  border-left: 2px solid var(--line);
}
