/* ============================================================
   Animated background
   ============================================================ */

.bg {
    position: fixed; inset: 0;
    z-index: -2;
    background:
      radial-gradient(1200px 800px at 15% 10%, rgba(99,102,241,0.10), transparent 60%),
      radial-gradient(900px 700px at 85% 90%, rgba(13,148,136,0.09), transparent 60%),
      radial-gradient(700px 500px at 50% 50%, rgba(236,72,153,0.05), transparent 60%),
      var(--bg-0);
  }
  .bg::before {
    content: "";
    position: absolute; inset: 0;
    background-image:
      linear-gradient(var(--line) 1px, transparent 1px),
      linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    transform: translateZ(0);
  }
  .orb {
    position: fixed;
    width: 480px; height: 480px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.18;
    pointer-events: none;
    z-index: -1;
    transition: transform 0.4s ease-out;
  }
  .orb.a { background: #6366f1; top: -120px; left: -120px; }
  .orb.b { background: #14b8a6; bottom: -160px; right: -120px; }
  .orb.c { background: #ec4899; top: 40%; left: 50%; opacity: 0.10; }


/* ============================================================
   Layout helpers
   ============================================================ */

.screen {
    min-height: 100vh;
    display: none;
    flex-direction: column;
    padding: 32px clamp(20px, 5vw, 64px);
    perspective: 1400px;
  }
  .screen.active { display: flex; }


/* ============================================================
   Header / Brand
   ============================================================ */

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    user-select: none;
  }
  .brand-mark {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    position: relative;
    box-shadow: 0 8px 30px rgba(13,148,136,0.35);
  }
  .brand-mark::after{
    content:"U";
    position:absolute; inset:0;
    display:flex; align-items:center; justify-content:center;
    font-weight: 800; color:#ffffff; font-size: 22px;
    letter-spacing: -0.5px;
  }
  .brand-name {
    font-size: 18px;
    letter-spacing: 0.5px;
    font-weight: 600;
  }
  .brand-name .dim { color: var(--text-dim); font-weight: 400; }


/* ============================================================
   Auth screen
   ============================================================ */

.auth-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 0 20px;
  }
  .auth-eyebrow {
    color: var(--text-mute);
    text-transform: uppercase;
    letter-spacing: 4px;
    font-size: 12px;
    margin-bottom: 18px;
  }
  .auth-title {
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1.05;
    margin: 0 0 16px;
    font-weight: 700;
    background: linear-gradient(120deg, #0f172a 25%, #0d9488 60%, #6366f1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  .auth-sub {
    color: var(--text-dim);
    max-width: 620px;
    margin: 0 auto 44px;
    font-size: 16px;
  }


/* ============================================================
   Top bar (after login)
   ============================================================ */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 36px;
    gap: 20px;
    flex-wrap: wrap;
  }
  .role-pill {
    display: inline-flex; align-items: center; gap: 8px;
    background: #ffffff;
    border: 1px solid rgba(15,23,42,0.08);
    color: var(--text-dim);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
  }
  .role-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
  .topbar-right { display: flex; align-items: center; gap: 12px; }


/* ============================================================
   Main module grid (post-login)
   ============================================================ */

.main-hero {
    margin-bottom: 30px;
  }
  .main-hero h1 {
    font-size: clamp(28px, 4vw, 42px);
    margin: 0 0 8px;
    font-weight: 700;
  }
  .main-hero p { color: var(--text-dim); margin: 0; font-size: 15px; }


/* ============================================================
   Module page
   ============================================================ */

.module-page {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center;
    padding: 40px 20px;
  }
  .module-page .badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(15,23,42,0.12);
    color: var(--text-dim);
    background: #ffffff;
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 20px;
  }
  .module-page h2 {
    font-size: clamp(32px, 5vw, 48px);
    margin: 0 0 12px;
    background: linear-gradient(120deg, #0f172a, #0d9488);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  .module-page .stub {
    color: var(--text-dim);
    max-width: 540px;
    line-height: 1.6;
    font-size: 16px;
    margin: 0 0 28px;
  }
  .module-page .pulse {
    width: 88px; height: 88px; border-radius: 50%;
    background: radial-gradient(circle, rgba(13,148,136,0.4), rgba(13,148,136,0) 70%);
    margin: 0 auto 24px;
    animation: pulse 2.4s ease-in-out infinite;
  }


/* ============================================================
   Footer hint
   ============================================================ */

.hint {
    text-align: center;
    color: var(--text-mute);
    font-size: 12px;
    margin-top: 40px;
    letter-spacing: 0.5px;
  }
  .hint code {
    background: rgba(15,23,42,0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11.5px;
    color: var(--text-dim);
  }
