/* ============================================================
   GovProtocol / GDPRLedger — layout.css
   Page shell · Nav · App sidebar · Containers
   ============================================================ */

/* ── Containers ── */

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 var(--s7);
}

.container-narrow {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 var(--s7);
}

.container-wide {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 var(--s7);
}

@media (max-width: 640px) {
  .container,
  .container-narrow,
  .container-wide {
    padding: 0 var(--s5);
  }
}

/* ── Marketing nav ── */

.site-nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: rgba(250, 250, 248, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 var(--s7);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.nav-logo-mark {
  width: 28px;
  height: 28px;
  background: var(--green);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s7);
}

.nav-links a {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--t-fast);
}

.nav-links a:hover { color: var(--ink); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--s3);
}

@media (max-width: 768px) {
  .nav-links { display: none; }
}

/* ── App shell (authenticated) ── */

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 56px 1fr;
  min-height: 100vh;
  grid-template-areas:
    "app-topbar app-topbar"
    "app-sidebar app-main";
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "app-topbar"
      "app-main";
  }
  .app-sidebar { display: none; }
}

/* ── App top bar ── */

.app-topbar {
  grid-area: app-topbar;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--s7);
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
}

.app-topbar-left {
  display: flex;
  align-items: center;
  gap: var(--s5);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.app-brand-mark {
  width: 26px;
  height: 26px;
  background: var(--green);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
}

.app-topbar-right {
  display: flex;
  align-items: center;
  gap: var(--s4);
}

.app-user-menu {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  padding: var(--s1) var(--s2);
  border-radius: var(--r-sm);
  transition: background var(--t-fast);
}

.app-user-menu:hover { background: var(--mid); }

.app-user-avatar {
  width: 28px;
  height: 28px;
  background: var(--green-lt);
  border: 1px solid rgba(26, 122, 74, .2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  text-transform: uppercase;
}

/* ── App sidebar ── */

.app-sidebar {
  grid-area: app-sidebar;
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
}

.sidebar-section {
  padding: var(--s5) var(--s5) var(--s4);
}

.sidebar-section + .sidebar-section {
  border-top: 1px solid var(--border);
}

.sidebar-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: var(--s3);
  display: block;
}

/* Module tabs (single tab at launch, multi when multiple modules) */
.module-tabs {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}

.module-tab {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s2) var(--s3);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: all var(--t-fast);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.module-tab:hover  { background: var(--mid); color: var(--ink); }
.module-tab.active {
  background: var(--green-lt);
  color: var(--green);
  font-weight: 600;
}

.module-tab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* Phase list in sidebar */
.phase-list {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}

.phase-item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s2) var(--s3);
  border-radius: var(--r-sm);
  font-size: 13px;
  text-decoration: none;
  transition: all var(--t-fast);
}

.phase-item:hover:not(.locked) { background: var(--mid); }

.phase-item.done    { color: var(--muted); }
.phase-item.active  { background: var(--green-lt); color: var(--green); font-weight: 600; }
.phase-item.locked  { color: var(--dim); cursor: not-allowed; opacity: .6; }

.phase-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

.phase-item.done   .phase-icon { background: var(--green);    color: white; }
.phase-item.active .phase-icon { background: var(--green-md); color: white; }
.phase-item.locked .phase-icon { background: var(--border);   color: var(--dim); }

.phase-item-text { flex: 1; min-width: 0; }
.phase-item-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phase-item-tasks {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--dim);
  margin-top: 1px;
}

.phase-item.active .phase-item-tasks { color: var(--green); opacity: .8; }

/* Sidebar bottom — access + export */
.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: var(--s4) var(--s5);
}

.access-period {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s4);
}

.access-period-label {
  font-size: 12px;
  color: var(--dim);
  font-family: var(--font-mono);
}

.access-period-days {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--green);
}

.access-period-days.expiring-soon { color: var(--amber); }
.access-period-days.expired       { color: var(--red); }

/* Powered by badge */
.powered-by {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s1);
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--dim);
  letter-spacing: .06em;
  margin-top: var(--s3);
  text-decoration: none;
}

.powered-by:hover { color: var(--muted); }

/* ── App main content area ── */

.app-main {
  grid-area: app-main;
  padding: var(--s8) var(--s10);
  max-width: 900px;
}

@media (max-width: 1200px) {
  .app-main { padding: var(--s7); }
}

@media (max-width: 768px) {
  .app-main { padding: var(--s5); }
}

/* ── Page header (within app-main) ── */

.page-header {
  margin-bottom: var(--s8);
}

.page-header h1 {
  font-size: clamp(24px, 3vw, 36px);
  margin-bottom: var(--s2);
}

.page-header p {
  font-size: 1rem;
  max-width: 56ch;
}

/* ── Breadcrumb ── */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: 13px;
  color: var(--dim);
  font-family: var(--font-mono);
  margin-bottom: var(--s5);
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--dim);
  text-decoration: none;
  transition: color var(--t-fast);
}

.breadcrumb a:hover { color: var(--green); }

.breadcrumb-sep {
  color: var(--border);
  font-size: 12px;
}

.breadcrumb-current { color: var(--muted); }

/* ── Marketing sections ── */

.marketing-section {
  padding: var(--s12) 0;
}

.marketing-section.mid {
  background: var(--mid);
}

.marketing-section.dark {
  background: var(--ink);
  color: white;
}

/* ── Footer ── */

.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,.55);
  padding: var(--s8) 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s5);
  flex-wrap: wrap;
  gap: var(--s4);
}

.footer-logo {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.footer-links {
  display: flex;
  gap: var(--s6);
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 13px;
  color: rgba(255,255,255,.5);
  text-decoration: none;
  transition: color var(--t-fast);
}

.footer-links a:hover { color: rgba(255,255,255,.85); }

.footer-disclaimer {
  font-size: 12px;
  line-height: 1.7;
  color: rgba(255,255,255,.35);
  max-width: 900px;
}

/* ── Auth layout ── */

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 768px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }
  .auth-panel-brand { display: none; }
}

.auth-panel-brand {
  background: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--s12) var(--s10);
  position: relative;
  overflow: hidden;
}

.auth-panel-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 50% at 30% 50%, rgba(46,168,100,.12) 0%, transparent 60%);
  pointer-events: none;
}

.auth-brand-content {
  position: relative;
}

.auth-brand-logo {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--green-md);
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin-bottom: var(--s8);
}

.auth-brand-logo-mark {
  width: 32px;
  height: 32px;
  background: var(--green);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
}

.auth-brand-heading {
  font-family: var(--font-serif);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 700;
  color: white;
  line-height: 1.2;
  margin-bottom: var(--s5);
}

.auth-brand-sub {
  font-size: 15px;
  color: rgba(255,255,255,.65);
  line-height: 1.75;
  max-width: 380px;
}

.auth-brand-features {
  margin-top: var(--s8);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.auth-brand-feature {
  display: flex;
  align-items: center;
  gap: var(--s3);
  font-size: 13px;
  color: rgba(255,255,255,.65);
}

.auth-brand-feature-tick {
  width: 18px;
  height: 18px;
  background: rgba(46,168,100,.2);
  border: 1px solid rgba(46,168,100,.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--green-md);
  flex-shrink: 0;
}

.auth-panel-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--s12) var(--s10);
  background: var(--paper);
}

@media (max-width: 960px) {
  .auth-panel-form { padding: var(--s8) var(--s7); }
}

.auth-form-inner {
  max-width: 420px;
  width: 100%;
}

.auth-form-header {
  margin-bottom: var(--s8);
}

.auth-form-header h1 {
  font-size: 28px;
  margin-bottom: var(--s2);
}

.auth-form-header p {
  font-size: 14px;
  color: var(--muted);
  max-width: none;
}

/* ── Step indicator (assessment, checkout) ── */

.step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: var(--s8);
}

.step-indicator-item {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: 12px;
  font-family: var(--font-mono);
}

.step-indicator-item + .step-indicator-item::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--border);
  margin: 0 var(--s2);
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all var(--t);
}

.step-indicator-item.done   .step-num { background: var(--green);    color: white; }
.step-indicator-item.active .step-num { background: var(--green-md); color: white; }
.step-indicator-item.future .step-num { background: var(--mid);      color: var(--dim); border: 1px solid var(--border); }

.step-indicator-item.done   .step-label { color: var(--muted); }
.step-indicator-item.active .step-label { color: var(--ink); font-weight: 600; }
.step-indicator-item.future .step-label { color: var(--dim); }

@media (max-width: 480px) {
  .step-label { display: none; }
}
