:root {
      --primary: #0066cc;
      --secondary: #00aaff;
      --accent: #ffdd57;
      --dark: #003049;
      --light: #f8f9fa;
      --success: #28a745;
      --danger: #dc3545;
      --muted: #6c757d;
    }

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

    body {
      font-family: 'Nunito', sans-serif;
      background: linear-gradient(135deg, var(--primary), var(--secondary));
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
      position: relative;
      overflow: hidden;
    }

    /* Animated background */
    body::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="25" cy="75" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="75" cy="25" r="1" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grain)"/></svg>');
    }

    /* Floating particles */
    .particles {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      overflow: hidden;
      z-index: 1;
    }

    .particle {
      position: absolute;
      background: rgba(255, 255, 255, 0.1);
      border-radius: 50%;
      animation: float 8s ease-in-out infinite;
    }

    @keyframes float {
      0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0.3; }
      50% { transform: translateY(-30px) rotate(180deg); opacity: 0.8; }
    }
    /* Option globale */
.auth-container { overflow: visible; }

    /* Main container */
    .auth-container {
      background: rgba(255, 255, 255, 0.95);
      backdrop-filter: blur(20px);
      border-radius: 25px;
      padding: 3rem;
      box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
      width: 100%;
      max-width: 450px;
      position: relative;
      z-index: 10;
      animation: slideInUp 1s ease-out;
      max-height: 90vh;
      overflow-y: auto;
    }
        /* plus haut que la carte & la navbar */
    .univ-suggest.is-portal {
      position: fixed;   /* déjà mis, on garde */
      left: 0; top: 0;
      width: auto;
      z-index: 3000;     /* <-- ajoute ça */
    }


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

    /* Header */
    .auth-header {
      text-align: center;
      margin-bottom: 2.5rem;
    }

    .auth-logo {
      width: 80px;
      height: 80px;
      background: linear-gradient(45deg, var(--primary), var(--secondary));
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto 1.5rem;
      font-size: 2rem;
      color: white;
      animation: pulse 2s infinite;
    }

    @keyframes pulse {
      0%, 100% { transform: scale(1); }
      50% { transform: scale(1.05); }
    }

    .auth-title {
      font-size: 2rem;
      font-weight: 800;
      color: var(--dark);
      margin-bottom: 0.5rem;
    }

    .auth-subtitle {
      color: var(--muted);
      font-size: 1rem;
    }

    /* Tabs */
    .auth-tabs {
      display: flex;
      background: rgba(0, 102, 204, 0.1);
      border-radius: 15px;
      padding: 0.5rem;
      margin-bottom: 2rem;
    }

    .auth-tab {
      flex: 1;
      background: none;
      border: none;
      padding: 0.8rem;
      border-radius: 10px;
      font-weight: 600;
      color: var(--muted);
      transition: all 0.3s ease;
      cursor: pointer;
    }

    .auth-tab.active {
      background: white;
      color: var(--primary);
      box-shadow: 0 4px 15px rgba(0, 102, 204, 0.2);
    }

    /* Form styling */
    .form-group {
      margin-bottom: 1.5rem;
      position: relative;
    }

    .form-control {
      border: 2px solid #e9ecef;
      border-radius: 15px;
      padding: 1rem 1rem 1rem 3.5rem;
      font-size: 1rem;
      transition: all 0.3s ease;
      background: rgba(255, 255, 255, 0.8);
    }

    .form-control:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
      background: white;
    }

    .form-select {
      border: 2px solid #e9ecef;
      border-radius: 15px;
      padding: 1rem 1rem 1rem 3.5rem;
      font-size: 1rem;
      transition: all 0.3s ease;
      background: rgba(255, 255, 255, 0.8);
      appearance: none;
      background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
      background-repeat: no-repeat;
      background-position: right 1rem center;
      background-size: 16px 12px;
    }

    .form-select:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
      background: white;
    }

    .form-icon {
      position: absolute;
      left: 1rem;
      top: 50%;
      transform: translateY(-50%);
      color: var(--muted);
      font-size: 1.1rem;
      z-index: 5;
    }

    .password-toggle {
      position: absolute;
      right: 1rem;
      top: 50%;
      transform: translateY(-50%);
      background: none;
      border: none;
      color: var(--muted);
      cursor: pointer;
      transition: all 0.3s ease;
    }

    .password-toggle:hover {
      color: var(--primary);
    }

    /* Buttons */
    .btn-auth {
      background: linear-gradient(45deg, var(--primary), var(--secondary));
      color: white;
      border: none;
      border-radius: 15px;
      padding: 1rem;
      font-weight: 600;
      font-size: 1.1rem;
      width: 100%;
      transition: all 0.3s ease;
      position: relative;
      overflow: hidden;
    }

    .btn-auth::before {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 100%;
      height: 100%;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
      transition: left 0.5s ease;
    }

    .btn-auth:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 25px rgba(0, 102, 204, 0.3);
      color: white;
    }

    .btn-auth:hover::before {
      left: 100%;
    }

    .btn-auth:disabled {
      opacity: 0.7;
      transform: none;
      box-shadow: none;
    }

    /* Additional options */
    .auth-options {
      display: flex;
      justify-content: between;
      align-items: center;
      margin: 1.5rem 0;
      font-size: 0.9rem;
    }

    .form-check-input:checked {
      background-color: var(--primary);
      border-color: var(--primary);
    }

    .forgot-password {
      color: var(--primary);
      text-decoration: none;
      font-weight: 600;
      transition: all 0.3s ease;
    }

    .forgot-password:hover {
      color: var(--secondary);
    }

    /* Divider */
    .auth-divider {
      text-align: center;
      margin: 2rem 0;
      position: relative;
    }

    .auth-divider::before {
      content: '';
      position: absolute;
      top: 50%;
      left: 0;
      right: 0;
      height: 1px;
      background: #dee2e6;
    }

    .auth-divider span {
      background: rgba(255, 255, 255, 0.95);
      padding: 0 1rem;
      color: var(--muted);
      font-size: 0.9rem;
    }

    /* Social buttons */
    .social-buttons {
      display: flex;
      gap: 1rem;
      margin-bottom: 2rem;
    }

    .btn-social {
      flex: 1;
      padding: 0.8rem;
      border: 2px solid #dee2e6;
      border-radius: 12px;
      background: white;
      color: var(--muted);
      text-decoration: none;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
      font-weight: 600;
      transition: all 0.3s ease;
    }

    .btn-social:hover {
      border-color: var(--primary);
      color: var(--primary);
      transform: translateY(-2px);
    }

    /* Footer */
    .auth-footer {
      text-align: center;
      margin-top: 2rem;
      padding-top: 2rem;
      border-top: 1px solid #dee2e6;
    }

    .auth-footer p {
      color: var(--muted);
      font-size: 0.9rem;
      margin: 0;
    }

    .auth-footer a {
      color: var(--primary);
      text-decoration: none;
      font-weight: 600;
    }

    .auth-footer a:hover {
      color: var(--secondary);
    }

    /* Back button */
    .back-button {
      position: absolute;
      top: 20px;
      left: 20px;
      background: rgba(255, 255, 255, 0.2);
      backdrop-filter: blur(10px);
      border: none;
      border-radius: 50%;
      width: 50px;
      height: 50px;
      color: white;
      font-size: 1.2rem;
      cursor: pointer;
      transition: all 0.3s ease;
      z-index: 100;
    }

    .back-button:hover {
      background: rgba(255, 255, 255, 0.3);
      transform: translateX(-3px);
    }

    /* Alert messages */
    .alert-custom {
      border-radius: 12px;
      border: none;
      padding: 1rem;
      margin-bottom: 1.5rem;
      display: none;
    }

    .alert-success-custom {
      background: rgba(40, 167, 69, 0.1);
      color: var(--success);
      border-left: 4px solid var(--success);
    }

    .alert-danger-custom {
      background: rgba(220, 53, 69, 0.1);
      color: var(--danger);
      border-left: 4px solid var(--danger);
    }

    /* Loading state */
    .loading-overlay {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(255, 255, 255, 0.9);
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 25px;
      z-index: 1000;
      display: none;
    }

    .spinner {
      width: 50px;
      height: 50px;
      border: 4px solid rgba(0, 102, 204, 0.2);
      border-top: 4px solid var(--primary);
      border-radius: 50%;
      animation: spin 1s linear infinite;
    }

    @keyframes spin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }

    /* Mobile responsiveness */
    @media (max-width: 768px) {
      body {
        align-items: flex-start;
        padding: 10px;
      }
      
      .auth-container {
        padding: 2rem 1.5rem;
        margin: 1rem auto;
        border-radius: 20px;
        max-height: 95vh;
        min-height: auto;
      }

      .auth-title {
        font-size: 1.8rem;
      }

      .social-buttons {
        flex-direction: column;
      }

      .back-button {
        top: 15px;
        left: 15px;
        width: 45px;
        height: 45px;
      }

      .form-group {
        margin-bottom: 1.2rem;
      }

      .auth-header {
        margin-bottom: 2rem;
      }
    }
    /* Liste suggestions université */
.univ-suggest {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 20;
  margin-top: .25rem;
  padding: .25rem 0;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(0,0,0,.08);
  max-height: 240px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  list-style: none;
  display: none;
}

.univ-suggest[aria-hidden="false"] {
  display: block;
}

.univ-suggest li {
  padding: .6rem .9rem;
  cursor: pointer;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.univ-suggest li[aria-selected="true"],
.univ-suggest li:hover {
  background: #f5f9ff;
  color: #0a58ca;
}

/* Mode portal : détaché du flux pour ne pas être masqué par la carte */
.univ-suggest.is-portal {
  position: fixed;
  left: 0;
  top: 0;
  width: auto;
  z-index: 3000; /* Toujours au-dessus */
}
