:root {
  --bg: #06101f;
  --bg-soft: #0a1728;
  --surface: rgba(12, 25, 43, .82);
  --surface-solid: #0c192b;
  --surface-2: #101f33;
  --text: #f5f8fc;
  --muted: #9aa9bd;
  --line: rgba(158, 184, 218, .16);
  --blue: #3288ff;
  --blue-2: #65b8ff;
  --cyan: #75e6ff;
  --green: #5ce2ae;
  --danger: #ff8a9a;
  --shadow: 0 30px 90px rgba(0, 0, 0, .35);
}

html[data-theme="light"] {
  --bg: #f4f8fd;
  --bg-soft: #eaf2fb;
  --surface: rgba(255, 255, 255, .94);
  --surface-solid: #fff;
  --surface-2: #f5f9fe;
  --text: #10213a;
  --muted: #566a82;
  --line: rgba(39, 82, 132, .18);
  --blue: #2563eb;
  --blue-2: #1976cf;
  --cyan: #0797b8;
  --green: #16835b;
  --danger: #c7354e;
  --shadow: 0 26px 70px rgba(38, 75, 119, .13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
  font-family: "Vazirmatn", Tahoma, sans-serif;
  overflow-x: hidden;
  transition: background .25s ease, color .25s ease;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.ambient { position: fixed; border-radius: 50%; filter: blur(100px); pointer-events: none; z-index: -1; opacity: .28; }
.ambient-one { width: 440px; height: 440px; background: #0e76ff; top: -180px; right: 12%; }
.ambient-two { width: 380px; height: 380px; background: #0bbad0; top: 540px; left: -210px; opacity: .15; }
.section-shell, .site-header { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

.site-header {
  height: 88px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
  position: relative;
  z-index: 20;
}
.brand { justify-self: start; direction: ltr; }
.logo-glow { display: block; position: relative; width: 238px; height: 76px; overflow: visible; }
.logo { width: 238px; height: 76px; object-fit: contain; position: absolute; inset: 0; animation: logoPulse 2.7s ease-in-out infinite; }
.logo-light { display: none; }
html[data-theme="light"] .logo-dark { display: none; }
html[data-theme="light"] .logo-light { display: block; }
.logo-glow::after {
  content: "✦";
  position: absolute;
  top: 5px;
  right: 54px;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  text-shadow: 0 0 8px #fff, 0 0 18px #64d8ff;
  animation: logoSpark 2.7s ease-in-out infinite;
}
.logo-glow::before {
  content: "•";
  position: absolute;
  left: 21px;
  bottom: 15px;
  z-index: 2;
  color: #9be7ff;
  text-shadow: 0 0 7px #fff, 0 0 16px #3ba8ff;
  animation: logoSpark 2.7s .7s ease-in-out infinite;
}
@keyframes logoPulse { 0%,100% { filter:drop-shadow(0 0 5px rgba(63,169,255,.2)); } 50% { filter:brightness(1.14) drop-shadow(0 0 13px rgba(63,169,255,.72)); } }
@keyframes logoSpark { 0%,35%,68%,100% { opacity:0; transform:scale(.3) rotate(0); } 48% { opacity:1; transform:scale(1.25) rotate(45deg); } 56% { opacity:.65; transform:scale(.75) rotate(90deg); } }
.site-header nav { display: flex; gap: 30px; color: var(--muted); font-size: 14px; }
.site-header nav a { transition: color .2s; }
.site-header nav a:hover { color: var(--text); }
.header-actions { justify-self: end; display: flex; align-items: center; gap: 10px; }
.theme-toggle { width: 42px; height: 42px; border-radius: 13px; border: 1px solid var(--line); color: var(--text); background: var(--surface); cursor: pointer; }
.theme-icon { font-size: 20px; }
.header-login { border: 1px solid var(--line); border-radius: 13px; padding: 11px 18px; font-size: 13px; font-weight: 700; background: var(--surface); }

.hero { min-height: 680px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(430px, .85fr); gap: 70px; align-items: center; padding: 58px 0 84px; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; color: var(--blue-2); font-size: 12px; font-weight: 800; letter-spacing: .03em; }
.eyebrow i, .secure-pill i { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 13px var(--cyan); }
.hero h1 { margin: 20px 0 20px; font-size: clamp(45px, 5.2vw, 72px); line-height: 1.22; letter-spacing: -.055em; font-weight: 900; }
.hero h1 span { background: linear-gradient(100deg, var(--blue-2), var(--cyan)); background-clip: text; -webkit-background-clip: text; color: transparent; }
.hero-copy > p { color: var(--muted); font-size: 17px; line-height: 2; max-width: 650px; margin: 0; }
.hero-actions { display: flex; gap: 12px; margin: 31px 0 28px; }
.button { min-height: 50px; padding: 0 22px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 22px; font-weight: 800; font-size: 14px; }
.button-primary, .submit-button { color: white; background: linear-gradient(125deg, #1376f3, #3ca8ff); box-shadow: 0 13px 32px rgba(37, 139, 255, .27); }
.button-ghost { border: 1px solid var(--line); background: var(--surface); }
.trust-row { display: flex; flex-wrap: wrap; gap: 16px 24px; color: var(--muted); font-size: 11px; }
.trust-row b { color: var(--green); margin-left: 5px; }

.access-card { position: relative; border-radius: 25px; border: 1px solid var(--line); background: var(--surface); backdrop-filter: blur(22px); box-shadow: var(--shadow); padding: 26px; overflow: hidden; }
.access-version { position:absolute; inset-inline-start:20px; top:18px; z-index:2; direction:ltr; display:inline-flex; align-items:center; min-height:25px; padding:0 9px; border:1px solid var(--line); border-radius:999px; color:var(--muted); background:var(--surface-2); font:700 9px/1 ui-sans-serif,system-ui,sans-serif; letter-spacing:.05em; }
.access-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); opacity: .7; }
.access-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.access-head h2 { margin: 3px 0 0; font-size: 24px; }
.mini-label { font-size: 9px; color: var(--muted); letter-spacing: .17em; }
.secure-pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: 99px; padding: 7px 10px; font-size: 10px; }
.secure-pill i { width: 5px; height: 5px; background: var(--green); box-shadow: 0 0 10px var(--green); }
.active-session { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 12px; background: rgba(92, 226, 174, .08); border: 1px solid rgba(92, 226, 174, .18); color: var(--muted); font-size: 11px; margin-bottom: 14px; }
.active-session a { color: var(--green); font-weight: 800; white-space: nowrap; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); padding: 4px; border-radius: 13px; margin-bottom: 22px; }
.tab { border: 0; background: transparent; color: var(--muted); padding: 10px; border-radius: 10px; cursor: pointer; font-weight: 700; }
.tab.active { color: var(--text); background: var(--surface-solid); box-shadow: 0 4px 15px rgba(0,0,0,.12); }
.access-form { display: none; }
.access-form.active { display: block; animation: fadeUp .22s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(7px); } }
.form-intro { margin-bottom: 18px; }
.form-intro h3 { margin: 0 0 5px; font-size: 18px; }
.form-intro p, .form-note, .teammate-access p { color: var(--muted); font-size: 11px; line-height: 1.7; margin: 0; }
.access-form label { display: block; margin-bottom: 13px; }
.access-form label > span:first-child { display: block; font-size: 11px; font-weight: 700; margin-bottom: 7px; }
.access-form input { width: 100%; height: 46px; border: 1px solid var(--line); border-radius: 12px; padding: 0 13px; outline: 0; background: var(--surface-2); color: var(--text); font-size: 12px; transition: border .2s, box-shadow .2s; }
.access-form input::placeholder { color: var(--muted); opacity: .65; }
.access-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(50, 136, 255, .12); }
.password-field { display: block; position: relative; }
.password-field input { padding-left: 57px; }
.reveal { position: absolute; left: 7px; top: 7px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--blue-2); cursor: pointer; font-size: 10px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.teammate-access { border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; margin: 2px 0 13px; background: var(--surface-2); }
.teammate-access summary { cursor: pointer; font-size: 11px; font-weight: 700; }
.teammate-access summary small { color: var(--muted); margin-right: 5px; }
.teammate-access p { margin: 9px 0; }
.submit-button { width: 100%; height: 48px; border: 0; border-radius: 13px; color: #fff; font-size: 13px; font-weight: 800; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 20px; }
.submit-button:disabled { opacity: .65; cursor: wait; }
.submit-button.loading span { animation: nudge .7s ease infinite alternate; }
@keyframes nudge { to { transform: translateX(-6px); } }
.form-status { min-height: 23px; font-size: 11px; padding: 2px 0; }
.form-status.error { color: var(--danger); }
.form-status.success { color: var(--green); }
.form-status.info { color: var(--blue-2); }
.form-note { text-align: center; margin-top: 10px; }
.project-picker { margin: 0 0 13px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.project-picker[hidden] { display: none; }
.project-picker > span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 10px; }
#loginProjectChoices { display: grid; gap: 7px; max-height: 190px; overflow: auto; }
.project-choice { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-solid); color: var(--text); cursor: pointer; text-align: right; transition: border .2s, transform .2s; }
.project-choice:hover { border-color: var(--blue); transform: translateY(-1px); }
.project-choice b { font-size: 11px; }
.project-choice small { color: var(--blue-2); font-size: 9px; direction: ltr; }

.feature-section { padding: 80px 0; }
.section-heading { max-width: 710px; margin: 0 auto 44px; text-align: center; }
.section-heading h2, .guide h2 { font-size: clamp(30px, 4vw, 44px); margin: 13px 0; letter-spacing: -.035em; line-height: 1.35; }
.section-heading p, .guide-copy > p { color: var(--muted); line-height: 1.9; font-size: 14px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.feature-card { position: relative; min-height: 250px; padding: 26px; border: 1px solid var(--line); background: var(--surface); border-radius: 20px; overflow: hidden; transition: transform .25s, border .25s; }
.feature-card:hover { transform: translateY(-5px); border-color: rgba(83, 174, 255, .4); }
.feature-card.featured { background: linear-gradient(150deg, rgba(23, 111, 225, .2), var(--surface)); }
.feature-no { position: absolute; left: 22px; top: 21px; font: 700 10px monospace; color: var(--muted); }
.feature-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: rgba(50, 136, 255, .12); border: 1px solid rgba(73, 158, 255, .2); color: var(--blue-2); font-weight: 900; }
.feature-card h3 { margin: 22px 0 9px; font-size: 17px; }
.feature-card p { color: var(--muted); font-size: 12px; line-height: 1.9; margin: 0; }
.role-tag { display: inline-block; color: var(--blue-2); font-size: 9px; margin-top: 14px; border: 1px solid rgba(73, 158, 255, .2); border-radius: 99px; padding: 5px 8px; }

.workflow { padding: 90px 0; }
.section-heading.compact { margin-bottom: 33px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 22px; background: var(--surface); overflow: hidden; }
.steps article { display: flex; gap: 18px; padding: 30px; border-left: 1px solid var(--line); }
.steps article:last-child { border-left: 0; }
.steps strong { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; color: var(--blue-2); border-radius: 11px; background: rgba(50,136,255,.11); }
.steps h3 { margin: 3px 0 6px; font-size: 15px; }
.steps p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.8; }

.guide { margin-top: 30px; margin-bottom: 110px; padding: 44px; border: 1px solid var(--line); border-radius: 26px; background: linear-gradient(145deg, rgba(32, 122, 238, .13), var(--surface)); display: grid; grid-template-columns: 1fr 1fr; gap: 70px; align-items: center; }
.guide h2 { font-size: 34px; }
.permission-table { border: 1px solid var(--line); background: var(--surface-solid); border-radius: 15px; overflow: hidden; }
.permission-row { display: grid; grid-template-columns: 1fr 70px 70px; align-items: center; min-height: 49px; padding: 0 16px; border-bottom: 1px solid var(--line); font-size: 11px; }
.permission-row:last-child { border: 0; }
.permission-row.heading { color: var(--muted); font-size: 9px; }
.permission-row b { text-align: center; }
.permission-row .yes { color: var(--green); }
.permission-row .no { color: var(--danger); opacity: .75; }

footer { min-height: 80px; border-top: 1px solid var(--line); width: min(1180px, calc(100% - 40px)); margin: auto; color: var(--muted); font-size: 11px; display: flex; justify-content: space-between; align-items: center; }
footer span:first-child { color: var(--text); font-weight: 800; }

/* Light mode is intentionally quiet: white surfaces, pale blue context and
   dark typography. These rules sit here (rather than in JS) so both login and
   create-project flows keep identical interaction behaviour. */
html[data-theme="light"] body {
  background:
    radial-gradient(circle at 76% 3%, rgba(147,197,253,.35), transparent 31rem),
    radial-gradient(circle at 2% 60%, rgba(165,243,252,.20), transparent 28rem),
    var(--bg);
}
html[data-theme="light"] .ambient-one { opacity:.14; background:#60a5fa; }
html[data-theme="light"] .ambient-two { opacity:.10; background:#22d3ee; }
html[data-theme="light"] .site-header nav { color:#52677f; font-weight:600; }
html[data-theme="light"] .theme-toggle,
html[data-theme="light"] .header-login,
html[data-theme="light"] .button-ghost { background:#fff; box-shadow:0 3px 12px rgba(39,74,116,.06); }
html[data-theme="light"] .access-card { border-color:#d0dfef; box-shadow:0 24px 65px rgba(38,75,119,.12); }
html[data-theme="light"] .active-session { color:#3f665a; background:#effaf6; border-color:#c8e9dc; }
html[data-theme="light"] .tabs { background:#edf3fa; }
html[data-theme="light"] .tab.active { box-shadow:0 5px 16px rgba(35,67,105,.10); }
html[data-theme="light"] .access-form input,
html[data-theme="light"] .teammate-access,
html[data-theme="light"] .project-picker { background:#f7faff; border-color:#ccdded; }
html[data-theme="light"] .access-form input:focus { background:#fff; border-color:#4b8ee4; box-shadow:0 0 0 3px rgba(37,99,235,.14); }
html[data-theme="light"] .access-form input::placeholder { color:#8294a9; opacity:1; }
html[data-theme="light"] .feature-card { background:#fff; border-color:#d5e2ef; box-shadow:0 8px 25px rgba(37,67,102,.055); }
html[data-theme="light"] .feature-card.featured { background:linear-gradient(145deg,#edf6ff,#fff); border-color:#bad5ef; }
html[data-theme="light"] .feature-card:hover { border-color:#8dbbe8; box-shadow:0 14px 34px rgba(37,75,118,.10); }
html[data-theme="light"] .feature-icon,
html[data-theme="light"] .steps strong { color:#1c6dbc; background:#e8f3ff; border-color:#c5ddf4; }
html[data-theme="light"] .role-tag { color:#236daf; background:#f5faff; border-color:#c6def4; }
html[data-theme="light"] .steps { background:#fff; border-color:#d5e2ef; box-shadow:0 8px 25px rgba(37,67,102,.05); }
html[data-theme="light"] .guide { background:linear-gradient(145deg,#eaf4ff,#fff); border-color:#cbdff1; box-shadow:0 12px 34px rgba(37,67,102,.07); }
html[data-theme="light"] .permission-table { border-color:#d4e1ee; box-shadow:0 5px 17px rgba(37,67,102,.05); }

@media (max-width: 980px) {
  .site-header { grid-template-columns: 1fr auto; }
  .site-header nav { display: none; }
  .hero { grid-template-columns: 1fr; gap: 48px; padding-top: 45px; }
  .hero-copy { text-align: center; }
  .hero-copy > p { margin-inline: auto; }
  .eyebrow, .hero-actions, .trust-row { justify-content: center; }
  .access-card { width: min(560px, 100%); margin: auto; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .guide { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 640px) {
  .section-shell, .site-header, footer { width: min(100% - 24px, 1180px); }
  .site-header { height: 72px; }
  .logo-glow, .logo { width: 186px; height: 60px; }
  .header-login { display: none; }
  .hero { padding-top: 32px; }
  .hero h1 { font-size: 39px; }
  .hero-copy > p { font-size: 14px; }
  .trust-row { display: grid; }
  .access-card { padding: 19px; border-radius: 20px; }
  .field-grid, .feature-grid, .steps { grid-template-columns: 1fr; }
  .feature-card { min-height: 215px; }
  .steps article { border-left: 0; border-bottom: 1px solid var(--line); }
  .steps article:last-child { border-bottom: 0; }
  .guide { padding: 25px 18px; margin-bottom: 65px; }
  .guide h2 { font-size: 28px; }
  .permission-row { grid-template-columns: 1fr 55px 55px; padding: 0 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Light-mode contrast and surface-depth pass — v2.0.0-3 */
html[data-theme="light"] .button-primary,
html[data-theme="light"] .submit-button {
  color: #fff;
  background: linear-gradient(125deg, #1d4ed8, #075985);
  border: 1px solid #1647a8;
  box-shadow: 0 11px 25px rgba(29, 78, 216, .24);
  text-shadow: 0 1px 1px rgba(0, 0, 0, .14);
}

html[data-theme="light"] .active-session a {
  color: #176247;
  font-weight: 800;
}

html[data-theme="light"] .reveal {
  color: #155f9d;
  background: #e7f2ff;
  border: 1px solid #bed6ee;
}

html[data-theme="light"] .role-tag {
  color: #175b96;
  background: #eaf4ff;
  border-color: #b7d4ee;
  font-weight: 800;
}

html[data-theme="light"] .access-card {
  border-color: #b9cce0;
  box-shadow: 0 25px 64px rgba(30, 61, 98, .17), 0 4px 12px rgba(30, 61, 98, .07);
}

html[data-theme="light"] .feature-card {
  border-color: #c3d4e5;
  box-shadow: 0 12px 30px rgba(30, 61, 98, .10), 0 2px 5px rgba(30, 61, 98, .05);
}

html[data-theme="light"] .feature-card:hover {
  border-color: #7ea9d2;
  box-shadow: 0 18px 40px rgba(30, 61, 98, .15), 0 4px 9px rgba(30, 61, 98, .06);
}

html[data-theme="light"] .steps,
html[data-theme="light"] .guide,
html[data-theme="light"] .permission-table {
  border-color: #c1d2e3;
  box-shadow: 0 14px 34px rgba(30, 61, 98, .11), 0 2px 6px rgba(30, 61, 98, .05);
}

html[data-theme="light"] .site-header nav a {
  color: #334e68;
}
