@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;300;400;500;600;700;800;900&display=swap');

/* 🔹 General Page Styling */
body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  margin: 0;
  background: url("../Assets/Pictures/Asset 1.png") no-repeat center center fixed;
  background-size: cover;
  overflow-x: hidden;
  font-family: "Poppins", sans-serif;
  font-weight: 300;
  color: white;
  animation: fadeIn 1s ease-in-out;
}

/* 🔹 Dropdown Styling */
.selectDepartment {
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  padding: 12px;
  background-color: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  width: 60%;
  max-width: 300px;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.selectDepartment:focus {
  outline: none;
  border-color: white;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

.selectDepartment:hover {
  transform: scale(1.05);
}

.selectDepartment option {
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px;
}

/* 🔹 Home Button */
#homeButton {
  position: absolute;
  bottom: 20px;
  left: 20px;
}

#homeButton button {
  width: 220px;
  height: 50px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #ffffff, #cccccc);
  color: black;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

#homeButton button:hover {
  background: white;
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.3);
}

/* 🔹 Register Container with Glassmorphism */
.register-container {
  height: 800px;
  width: 400px;
  border-radius: 15px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  background: rgba(82, 81, 81, 0.288);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.3);

  animation: slideIn 0.5s ease-in-out;
}



/* 🔹 Headings */
h1, h2, h3 {
  text-align: center;
  font-weight: 700;
  margin-bottom: 15px;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* 🔹 Form Styling */
#registerForm {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#registerCode::-webkit-inner-spin-button,
#registerCode::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#registerCode {
    -moz-appearance: textfield;
}

/* 🔹 Input Fields */
input {
  height: 37px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 0 15px;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 16px;
  font-weight: 400;
  outline: none;
  transition: all 0.3s ease;
}

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

input:focus {
  background-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.8);
  transform: scale(1.05);
}

/* 🔹 Buttons */
button {
  height: 55px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #ff4e50, #982a2a);
  color: white;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

button:hover {
  background: linear-gradient(135deg, #e44d26, #721e1e);
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.3);
}

/* 🔹 Popup Modal */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup-content {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  text-align: center;
  animation: fadeIn 0.5s ease-in-out;
}

.popup-content button {
  background-color: #000000;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.3s ease;
}

.popup-content button:hover {
  background-color: #e60000;
  transform: scale(1.1);
}

/* 🔹 Keyframe Animations */
@keyframes fadeIn {
  from {
      opacity: 0;
      transform: translateY(-20px);
  }
  to {
      opacity: 1;
      transform: translateY(0);
  }
}

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

/* 🔹 Mobile Responsiveness */
@media (max-width: 768px) {
  body {
    padding: 10px;
    height: auto;
    min-height: 100vh;
    background-size: cover;
  }

  .register-container {
    width: 90%;
    height: auto;
    padding: 20px;
    margin: 20px 0;
  }

  input, .selectDepartment {
    width: 80%;
  }

  h1, h2, h3 {
    font-size: 1.4em;
  }

  button, #homeButton button {
    width: 90%;
  }

  #homeButton {
    position: relative;
    left: 0;
    bottom: 0;
    margin-top: 20px;
  }

  .popup-content {
    width: 90%;
  }
}

.register-mobile-close { display: none; }

/* Mobile registration matches the full-screen login experience. */
@media (max-width: 768px) {
  *, *::before, *::after { box-sizing: border-box; }

  body {
    display: block; width: 100%; min-width: 0; height: auto;
    min-height: 100vh; min-height: 100dvh; padding: 0;
    overflow-x: hidden; overflow-y: auto; background: #fff;
    color: #191919; animation: none;
  }

  .register-container {
    position: relative; display: block; width: 100%; height: auto;
    min-height: 100vh; min-height: 100dvh; margin: 0;
    padding: max(86px, calc(env(safe-area-inset-top) + 70px)) 22px calc(34px + env(safe-area-inset-bottom));
    overflow: visible; border: 0; border-radius: 0; background: #fff;
    box-shadow: none; animation: none;
  }

  .register-container > h1 {
    position: absolute; top: max(20px, env(safe-area-inset-top)); left: 22px;
    margin: 0; color: #202020; font-size: 15px; font-weight: 700;
    line-height: 42px; text-align: left; text-shadow: none;
  }

  .register-container > h2 {
    width: min(100%, 440px); margin: 0 auto; color: #191919;
    font-size: 30px; font-weight: 700; line-height: 1.25;
    text-align: left; text-shadow: none;
  }

  .register-container > h2::after {
    content: "Enter your information to create your store account.";
    display: block; margin-top: 8px; color: #6b6b6b;
    font-size: 14px; font-weight: 400; line-height: 1.5;
  }

  .register-mobile-close {
    position: absolute; top: max(12px, env(safe-area-inset-top)); right: 16px; z-index: 20;
    display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border: 1px solid #dedede; border-radius: 50%;
    background: #f6f6f6; color: #222; text-decoration: none;
  }

  .register-mobile-close svg {
    display: block; width: 22px; height: 22px; fill: none;
    stroke: currentColor; stroke-width: 1.8; stroke-linecap: round;
  }

  .register-mobile-close:hover, .register-mobile-close:focus-visible {
    background: #ededed; color: #920b11;
    outline: 3px solid rgba(161, 13, 20, 0.16); outline-offset: 2px;
  }

  #registerForm { width: min(100%, 440px); margin: 30px auto 0; gap: 18px; }
  #registerForm .input-group { display: flex; flex-direction: column; gap: 7px; width: 100%; }
  #registerForm label { color: #303030; font-size: 13px; font-weight: 600; }

  #registerForm input, #registerForm .selectDepartment {
    width: 100%; max-width: none; height: 52px; margin: 0; padding: 0 15px;
    border: 1px solid #d6d6d6; border-radius: 7px; background: #f7f7f7;
    color: #1d1d1d; font-size: 16px; font-weight: 400;
    box-shadow: none; backdrop-filter: none; transform: none;
  }

  #registerForm input::placeholder { color: #797979; }
  #registerForm input:focus, #registerForm .selectDepartment:focus {
    border-color: #a10d14; background: #fff;
    box-shadow: 0 0 0 3px rgba(161, 13, 20, 0.12);
    outline: none; transform: none;
  }
  #registerForm .selectDepartment:hover { transform: none; }
  #registerForm .selectDepartment option { background: #fff; color: #1d1d1d; }

  #registerForm .register-btn {
    width: 100%; min-height: 52px; margin-top: 6px; border-radius: 7px;
    background: #a10d14; box-shadow: none; font-size: 16px; font-weight: 700;
  }
  #registerForm .register-btn:hover, #registerForm .register-btn:focus-visible {
    background: #820a10; box-shadow: none;
    outline: 3px solid rgba(161, 13, 20, 0.18); outline-offset: 2px; transform: none;
  }

  #homeButton { display: none; }

  .popup {
    inset: 0; width: 100%; height: 100%; padding: 20px;
    background: rgba(15, 15, 15, 0.55); transform: none;
  }
  .popup-content {
    width: min(100%, 360px); padding: 22px; border-radius: 8px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.2); animation: none;
  }
  .popup-content p { margin: 0; color: #282828 !important; line-height: 1.5; }
  .popup-content #closePopup {
    width: 100%; height: 46px; margin-top: 18px; border-radius: 7px;
    background: #a10d14; box-shadow: none; font-size: 15px;
  }
  .popup-content #closePopup:hover, .popup-content #closePopup:focus-visible {
    background: #820a10; transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body, .register-container, .popup-content { animation: none; }
}
