:root {
      --bg-deep: #1a0a2e;
      --bg-mid: #22103a;
      --bg-card: #2d1a4a;
      --purple-vivid: #7c3aed;
      --purple-light: #a855f7;
      --purple-bright: #c084fc;
      --orange: #f59e0b;
      --orange-bright: #fbbf24;
      --text-light: #f5f3ff;
      --text-muted: #c4b5fd;
      --border-soft: rgba(124, 58, 237, 0.35);
      --border-bright: rgba(168, 85, 247, 0.55);
      --bg-gradient: linear-gradient(135deg, #7c3aed 0%, #a855f7 45%, #c084fc 100%);
      --error-color: #ff6b6b;
      --success-color: #22c55e;
    }

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

    body {
      font-family: 'Cairo', sans-serif;
      background:
        radial-gradient(1200px 700px at 85% -10%, rgba(168, 85, 247, 0.2), transparent 60%),
        radial-gradient(1000px 600px at 0% 100%, rgba(245, 158, 11, 0.12), transparent 65%),
        linear-gradient(135deg, var(--bg-deep) 0%, var(--bg-mid) 45%, #2b0e46 100%);
      margin: 0;
      padding: 20px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      min-height: 100vh;
      color: var(--text-light);
    }

    #particles-bg {
      position: fixed;
      inset: 0;
      z-index: 0;
      pointer-events: none;
    }

    .logo-container {
      text-align: center;
      margin-bottom: 20px;
    }
    
    .logo {
      width: 120px;
      height: 120px;
      border-radius: 50%;
      object-fit: cover;
      border: 3px solid var(--purple-bright);
      box-shadow: 0 4px 15px rgba(0,0,0,0.3);
      transition: transform 0.3s;
    }
    
    .logo:hover {
      transform: scale(1.05);
    }
    
    .home-btn {
      position: fixed;
      top: 18px;
      right: 18px;
      background: linear-gradient(135deg, #7c3aed 0%, #a855f7 55%, #f59e0b 130%);
      color: white;
      border: 1px solid rgba(255, 255, 255, 0.3);
      padding: 12px 20px;
      border-radius: 999px;
      font-size: 1rem;
      font-weight: 800;
      letter-spacing: 0.2px;
      cursor: pointer;
      transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
      box-shadow: 0 14px 34px rgba(0,0,0,0.35), 0 0 34px rgba(124, 58, 237, 0.45);
      z-index: 1000;
      display: flex;
      align-items: center;
      gap: 10px;
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      overflow: hidden;
    }

    .home-btn::before {
      content: "";
      position: absolute;
      top: -30%;
      right: -120%;
      width: 60%;
      height: 170%;
      background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.35) 50%, transparent 100%);
      transform: rotate(18deg);
      transition: right 0.5s ease;
      pointer-events: none;
    }

    .home-btn:hover {
      transform: translateY(-3px) scale(1.03);
      filter: saturate(1.1);
      box-shadow: 0 18px 38px rgba(0,0,0,0.38), 0 0 42px rgba(124, 58, 237, 0.55);
    }

    .home-btn:hover::before {
      right: 130%;
    }

    .home-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 31px;
      height: 31px;
      border-radius: 50%;
      background: rgba(255,255,255,0.24);
      border: 1px solid rgba(255,255,255,0.35);
      font-size: 0.95em;
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.28);
      flex-shrink: 0;
    }

    .home-icon i {
      color: #ffffff;
      font-size: 0.95rem;
      text-shadow: 0 1px 6px rgba(0,0,0,0.35);
    }

    .home-btn-label {
      position: relative;
      top: 1px;
    }

    .container {
      background: linear-gradient(145deg, rgba(45, 26, 74, 0.88), rgba(34, 16, 58, 0.82));
      border-radius: 20px;
      padding: 40px;
      width: 100%;
      max-width: 500px;
      box-shadow: 0 18px 44px rgba(0,0,0,0.45), 0 0 30px rgba(124,58,237,0.18);
      backdrop-filter: blur(12px);
      border: 1.5px solid var(--border-bright);
      text-align: center;
      margin: 20px auto;
      position: relative;
      z-index: 1;
    }

    h1 {
      color: var(--orange-bright);
      margin-bottom: 30px;
      font-size: 2.2em;
      text-shadow: 0 3px 16px rgba(245, 158, 11, 0.25);
    }

    .form-group {
      margin-bottom: 20px;
      text-align: right;
      position: relative;
    }

    label {
      display: block;
      margin-bottom: 8px;
      color: var(--text-light);
      font-size: 1.1em;
      font-weight: 600;
    }

    input {
      width: 100%;
      padding: 12px 45px 12px 15px;
      border-radius: 10px;
      border: 1.5px solid rgba(168, 85, 247, 0.45);
      background: rgba(255,255,255,0.08);
      color: #fff;
      font-size: 1em;
      transition: all 0.3s;
    }

    input::placeholder {
      color: rgba(255,255,255,0.65);
    }

    input:focus {
      outline: none;
      border-color: var(--orange);
      box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.22);
    }

    /* إخفاء عين المتصفح الافتراضية */
    input[type="password"]::-ms-reveal,
    input[type="password"]::-ms-clear,
    input[type="password"]::-webkit-credentials-auto-fill-button,
    input[type="password"]::-webkit-contacts-auto-fill-button,
    input[type="password"]::-webkit-strong-password-field,
    input[type="password"]::-webkit-textfield-decoration-container {
      display: none !important;
      visibility: hidden !important;
      pointer-events: none !important;
      width: 0 !important;
      height: 0 !important;
      opacity: 0 !important;
    }

    /* إخفاء عين المتصفح في فايرفوكس */
    input[type="password"] {
      -moz-appearance: none;
      appearance: none;
    }

    .submit-btn {
      background: var(--bg-gradient);
      color: white;
      border: none;
      padding: 15px 30px;
      border-radius: 30px;
      font-size: 1.2em;
      font-weight: bold;
      cursor: pointer;
      margin-top: 20px;
      width: 100%;
      transition: all 0.3s;
      position: relative;
      overflow: hidden;
    }

    .submit-btn:hover {
      transform: translateY(-3px);
      box-shadow: 0 6px 15px rgba(0,0,0,0.3);
    }

    .submit-btn:after {
      content: "";
      position: absolute;
      top: 50%;
      left: 50%;
      width: 5px;
      height: 5px;
      background: rgba(255, 255, 255, 0.5);
      opacity: 0;
      border-radius: 100%;
      transform: scale(1, 1) translate(-50%);
      transform-origin: 50% 50%;
    }

    .submit-btn:focus:not(:active)::after {
      animation: ripple 1s ease-out;
    }

    @keyframes ripple {
      0% {
        transform: scale(0, 0);
        opacity: 1;
      }
      20% {
        transform: scale(25, 25);
        opacity: 1;
      }
      100% {
        opacity: 0;
        transform: scale(40, 40);
      }
    }

    .google-btn {
      margin-top: 15px;
      width: 100%;
      padding: 12px 20px;
      border-radius: 30px;
      border: 1px solid rgba(168, 85, 247, 0.4);
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      cursor: pointer;
      font-size: 1em;
      font-weight: 600;
      background: rgba(255,255,255,0.14);
      color: #fff;
      box-shadow: 0 6px 18px rgba(0,0,0,0.22);
      transition: transform 0.2s, box-shadow 0.2s;
    }

    .google-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 5px 12px rgba(0,0,0,0.35);
    }

    .google-btn img {
      width: 20px;
      height: 20px;
    }

    .links {
      margin-top: 25px;
      color: var(--text-light);
      font-size: 1em;
    }

    .links a {
      color: var(--orange);
      text-decoration: none;
      font-weight: 600;
      transition: all 0.3s;
    }

    .links a:hover {
      text-decoration: underline;
      color: #ffc107;
    }

    .error-message {
      color: var(--error-color);
      font-size: 0.9em;
      margin-top: 5px;
      text-align: right;
      display: none;
    }

    .success-message {
      color: var(--success-color);
      font-size: 1em;
      margin-top: 15px;
      text-align: center;
      font-weight: 600;
      display: none;
    }

    .connection-error {
      background-color: rgba(255, 82, 82, 0.1);
      border: 1px solid var(--error-color);
      border-radius: 10px;
      padding: 15px;
      margin-bottom: 20px;
      text-align: center;
      display: none;
    }

    .password-requirements {
      color: #aaa;
      font-size: 0.9em;
      margin-top: 10px;
      text-align: right;
      background: rgba(255,255,255,0.08);
      border: 1px solid rgba(168, 85, 247, 0.28);
      padding: 10px;
      border-radius: 8px;
    }

    .requirement {
      display: flex;
      align-items: center;
      margin-bottom: 5px;
    }

    .requirement.valid {
      color: var(--success-color);
    }

    .requirement.invalid {
      color: #aaa;
    }

    .requirement-icon {
      margin-left: 8px;
      font-size: 1em;
    }

    input.invalid {
      border-color: var(--error-color);
      background-color: rgba(255, 107, 107, 0.08);
    }

    input.valid {
      border-color: var(--success-color);
      background-color: rgba(34, 197, 94, 0.08);
    }

    .loading {
      display: none;
      width: 25px;
      height: 25px;
      border: 3px solid rgba(255,255,255,0.25);
      border-radius: 50%;
      border-top-color: white;
      animation: spin 1s ease-in-out infinite;
      margin: 0 auto;
    }

    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    .password-toggle {
      position: absolute;
      left: 10px;
      top: 45px;
      background: none;
      border: none;
      cursor: pointer;
      z-index: 10;
      padding: 0;
      margin: 0;
      width: 30px;
      height: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 20px;
      color: rgba(255,255,255,0.8);
    }

    .password-toggle:hover {
      color: var(--orange);
      background: rgba(255,255,255,0.1);
      border-radius: 50%;
    }

    @media (max-width: 768px) {
      .container {
        padding: 30px;
      }
      
      h1 {
        font-size: 1.8em;
      }
      
      .logo {
        width: 100px;
        height: 100px;
      }
      
      
      .home-btn {
        top: 10px;
        right: 10px;
        padding: 9px 14px;
        font-size: 0.9em;
      }
      
      .password-toggle {
        top: 38px;
      }
    }

    @media (max-width: 480px) {
      .home-btn {
        padding: 8px 12px;
        font-size: 0.82em;
      }

      .home-icon {
        width: 26px;
        height: 26px;
      }
    }
