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

    :root {
      --bg:       #0e1117;
      --surface:  #181d27;
      --border:   #2a3040;
      --accent:   #4f7cff;
      --accent2:  #38bdf8;
      --text:     #e8ecf4;
      --muted:    #8892a4;
      --error:    #f87171;
      --success:  #34d399;
    }

    body {
      background: var(--bg);
      color: var(--text);
      font-family: 'DM Sans', sans-serif;
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
    }

    /* Ambient background */
    body::before {
      content: '';
      position: fixed;
      inset: 0;
      background:
        radial-gradient(ellipse 70% 60% at 20% 10%, rgba(79,124,255,0.12) 0%, transparent 60%),
        radial-gradient(ellipse 50% 50% at 80% 90%, rgba(56,189,248,0.08) 0%, transparent 60%);
      pointer-events: none;
    }

    .login-wrap {
      width: 100%;
      max-width: 440px;
      padding: 24px;
      position: relative;
      z-index: 1;
      animation: fadeUp 0.6s ease both;
    }

    @keyframes fadeUp {
      from { opacity: 0; transform: translateY(24px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    .brand {
      text-align: center;
      margin-bottom: 40px;
    }
    .brand-logo {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 8px;
    }
    .brand-logo .icon {
      width: 40px; height: 40px;
      background: linear-gradient(135deg, var(--accent), var(--accent2));
      border-radius: 10px;
      display: flex; align-items: center; justify-content: center;
      font-size: 20px;
    }
    .brand-name {
      font-family: 'DM Serif Display', serif;
      font-size: 28px;
      letter-spacing: -0.5px;
      background: linear-gradient(135deg, #fff 30%, var(--accent2));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }
    .brand-sub {
      font-size: 13px;
      color: var(--muted);
      letter-spacing: 0.5px;
    }

    .card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 36px;
      box-shadow: 0 24px 64px rgba(0,0,0,0.4);
    }

    .card-title {
      font-size: 20px;
      font-weight: 600;
      margin-bottom: 24px;
      color: var(--text);
    }

    /* Role tabs */
    .role-tabs {
      display: flex;
      background: var(--bg);
      border-radius: 10px;
      padding: 4px;
      margin-bottom: 28px;
      gap: 4px;
    }
    .role-tab {
      flex: 1;
      padding: 10px;
      border: none;
      background: transparent;
      color: var(--muted);
      font-family: 'DM Sans', sans-serif;
      font-size: 14px;
      font-weight: 500;
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.2s;
    }
    .role-tab.active {
      background: var(--accent);
      color: #fff;
      box-shadow: 0 4px 16px rgba(79,124,255,0.35);
    }

    .form-group { margin-bottom: 20px; }
    label {
      display: block;
      font-size: 13px;
      font-weight: 500;
      color: var(--muted);
      margin-bottom: 8px;
      letter-spacing: 0.3px;
    }
    input {
      width: 100%;
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 12px 16px;
      color: var(--text);
      font-family: 'DM Sans', sans-serif;
      font-size: 15px;
      outline: none;
      transition: border-color 0.2s, box-shadow 0.2s;
    }
    input:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(79,124,255,0.15);
    }
    input::placeholder { color: var(--border); }

    .btn-login {
      width: 100%;
      padding: 14px;
      background: linear-gradient(135deg, var(--accent), #6b8fff);
      border: none;
      border-radius: 10px;
      color: #fff;
      font-family: 'DM Sans', sans-serif;
      font-size: 15px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      margin-top: 8px;
      position: relative;
      overflow: hidden;
    }
    .btn-login:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(79,124,255,0.4); }
    .btn-login:active { transform: translateY(0); }
    .btn-login:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

    .fp-row{
      display:flex;
      justify-content:flex-end;
      margin-top:-10px;
      margin-bottom:8px;
    }
    .link-btn{
      background:none;
      border:none;
      color: var(--accent2);
      font-family:'DM Sans', sans-serif;
      font-size: 13px;
      cursor:pointer;
      padding: 6px 0;
    }
    .link-btn:hover{ text-decoration: underline; }

    .overlay{
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.75);
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
      z-index: 1200;
    }
    .modal{
      width: min(560px, 100%);
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 22px;
      box-shadow: 0 24px 64px rgba(0,0,0,0.45);
    }
    .mhead{
      display:flex;
      align-items:flex-start;
      justify-content:space-between;
      gap: 10px;
      margin-bottom: 14px;
    }
    .mtitle{
      font-size: 18px;
      font-weight: 700;
      margin-bottom: 4px;
    }
    .msub{
      font-size: 13px;
      color: var(--muted);
    }
    .xbtn{
      width: 36px;
      height: 36px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: transparent;
      color: var(--muted);
      font-size: 18px;
      cursor: pointer;
    }
    .xbtn:hover{ border-color: var(--accent); color: var(--accent); }
    .mgrid{
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 14px;
    }
    .dv{
      height: 1px;
      background: var(--border);
      margin: 16px 0;
    }
    @media (max-width: 560px){
      .mgrid{ grid-template-columns: 1fr; }
    }

    .alert {
      position: fixed;
      top: 24px;
      right: 24px;
      width: min(460px, calc(100vw - 48px));
      padding: 12px 16px;
      border-radius: 10px;
      font-size: 14px;
      z-index: 1000;
      box-shadow: 0 18px 40px rgba(0,0,0,0.35);
      backdrop-filter: blur(10px);
      opacity: 0;
      transform: translateY(-8px);
      pointer-events: none;
      transition:
        opacity 0.18s ease,
        transform 0.18s ease;
    }
    .alert.error   { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.3); color: var(--error); }
    .alert.success { background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.3); color: var(--success); }
    .alert.show    { opacity: 1; transform: translateY(0); pointer-events: auto; }

    .spinner {
      display: none;
      width: 18px; height: 18px;
      border: 2px solid rgba(255,255,255,0.3);
      border-top-color: #fff;
      border-radius: 50%;
      animation: spin 0.6s linear infinite;
      margin: 0 auto;
    }
    @keyframes spin { to { transform: rotate(360deg); } }
  
