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

:root {
  --primary-bg: #171821;
  --card-bg: #1f202b;
  --surface: #2a2b38;
  --surface-border: rgba(255, 255, 255, 0.08);
  --surface-accent: rgba(99, 102, 241, 0.2);
  --primary: #8b5cf6;
  --primary-muted: #a5adcb;
  --primary-strong: #f5f7fb;
  --success: #22c55e;
  --danger: #ef4444;
  --text-muted: rgba(229, 231, 235, 0.8);
  --radius-lg: 18px;
  --radius-sm: 10px;
}

*,
*::before,
*::after {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}
/* Chrome, Safari, Edge, Opera */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type="number"] {
  -moz-appearance: textfield;
}

/* Optional: for better consistency */
input[type="number"] {
  appearance: textfield;
}

body,
input {
  font-family: "Poppins", sans-serif;
  background-color: var(--primary-bg);
  color: var(--primary-strong);
}

main {
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  background-color: var(--primary-bg);
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.box {
  position: relative;
  width: 100%;
  max-width: 1020px;
  height: 640px;
  background-color: var(--card-bg);
  border: 1px solid var(--surface-border);
  border-radius: 3.3rem;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.45);
}

.inner-box {
  position: absolute;
  width: calc(100% - 4.1rem);
  height: calc(100% - 4.1rem);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.forms-wrap {
  position: absolute;
  height: 100%;
  width: 45%;
  top: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  transition: 0.8s ease-in-out;
}

form {
  max-width: 260px;
  width: 100%;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  transition: opacity 0.02s 0.4s;
}

form.sign-up-form {
  opacity: 0;
  pointer-events: none;
}

form.admin-form {
  opacity: 0;
  pointer-events: none;
}

.logo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo img {
  width: 100px;
  margin-right: 0.3rem;
}

.logo h4 {
  font-size: 1.1rem;
  margin-top: -9px;
  letter-spacing: -0.5px;
  color: var(--primary-strong);
}

.heading h2 {
  font-size: 2.1rem;
  font-weight: 600;
  color: var(--primary-strong);
}

.heading h6 {
  color: var(--primary-muted);
  font-weight: 400;
  font-size: 0.75rem;
  display: inline;
}

.toggle {
  color: var(--primary-strong);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  transition: 0.3s;
}

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

.input-wrap {
  position: relative;
  height: 37px;
  margin-bottom: 2rem;
}

/* Adjust input-wrap height when it contains OTP container */
.input-wrap:has(.otp-container) {
  height: auto;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-field {
  position: absolute;
  width: 100%;
  height: 100%;
  background: none;
  border: none;
  outline: none;
  border-bottom: 1px solid var(--surface-border);
  padding: 0;
  font-size: 0.95rem;
  color: var(--primary-strong);
  transition: 0.4s;
}

label {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: 0.4s;
}

.input-field.active {
  border-bottom-color: var(--primary);
}

.input-field.active + label {
  font-size: 0.75rem;
  top: -2px;
  color: var(--primary);
}

.sign-btn {
  display: inline-block;
  width: 100%;
  height: 43px;
  background-color: var(--primary);
  color: var(--primary-strong);
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-bottom: 2rem;
  transition: 0.3s;
  font-weight: 500;
}

.sign-btn:hover {
  background-color: rgba(139, 92, 246, 0.85);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3);
}

.text {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.text a {
  color: var(--text-muted);
  transition: 0.3s;
}

.text a:hover {
  color: var(--primary);
}

main.sign-up-mode form.sign-in-form {
  opacity: 0;
  pointer-events: none;
}

main.sign-up-mode form.sign-up-form {
  opacity: 1;
  pointer-events: all;
}

main.sign-up-mode .forms-wrap {
  left: 55%;
}

main.sign-up-mode .carousel {
  left: 0%;
}

main.admin-mode form.sign-in-form {
  opacity: 0;
  pointer-events: none;
}

main.admin-mode form.admin-form {
  opacity: 1;
  pointer-events: all;
}

main.admin-mode .forms-wrap {
  left: 55%;
}

main.admin-mode .carousel {
  left: 0%;
}

.admin-link {
  color: var(--primary-strong);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: 0.3s;
}

.admin-link:hover {
  color: var(--primary);
}

.carousel {
  position: absolute;
  height: 100%;
  width: 55%;
  left: 45%;
  top: 0;
  background-color: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 2rem;
  display: grid;
  grid-template-rows: auto 1fr;
  padding-bottom: 2rem;
  overflow: hidden;
  transition: 0.8s ease-in-out;
}

.images-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.image {
  width: 100%;
  grid-column: 1/2;
  grid-row: 1/2;
  opacity: 0;
  transition: opacity 0.3s, transform 0.5s;
}

.img-1 {
  transform: translate(0, -50px);
}

.img-2 {
  transform: scale(0.4, 0.5);
}

.img-3 {
  transform: scale(0.3) rotate(-20deg);
}

.image.show {
  opacity: 1;
  transform: none;
}

.text-slider {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.text-wrap {
  max-height: 2.2rem;
  overflow: hidden;
  margin-bottom: 2.5rem;
}

.text-group {
  display: flex;
  flex-direction: column;
  text-align: center;
  transform: translateY(0);
  transition: 0.5s;
}

.text-group h2 {
  line-height: 2.2rem;
  font-weight: 600;
  font-size: 1.6rem;
  color: var(--primary-strong);
}

.bullets {
  display: flex;
  align-items: center;
  justify-content: center;
}

.bullets span {
  display: block;
  width: 0.5rem;
  height: 0.5rem;
  background-color: var(--text-muted);
  margin: 0 0.25rem;
  border-radius: 50%;
  cursor: pointer;
  transition: 0.3s;
}

.bullets span.active {
  width: 1.1rem;
  background-color: var(--primary);
  border-radius: 1rem;
}

@media (max-width: 850px) {
  .box {
    height: auto;
    max-width: 550px;
    overflow: hidden;
  }

  .inner-box {
    position: static;
    transform: none;
    width: revert;
    height: revert;
    padding: 2rem;
  }

  .forms-wrap {
    position: revert;
    width: 100%;
    height: auto;
  }

  form {
    max-width: revert;
    padding: 1.5rem 2.5rem 2rem;
    transition: transform 0.8s ease-in-out, opacity 0.45s linear;
  }

  .heading {
    margin: 1rem 0;
  }

  form.sign-up-form {
    transform: translateX(100%);
  }

  main.sign-up-mode form.sign-in-form {
    transform: translateX(-100%);
  }

  main.sign-up-mode form.sign-up-form {
    transform: translateX(0%);
  }

  .carousel {
    position: revert;
    height: auto;
    width: 100%;
    padding: 3rem 2rem;
    display: flex;
  }

  .images-wrapper {
    display: none;
  }

  .text-slider {
    width: 100%;
  }
}

@media (max-width: 530px) {
  main {
    padding: 1rem;
  }

  .box {
    border-radius: 2rem;
  }

  .inner-box {
    padding: 1rem;
  }

  .carousel {
    padding: 1.5rem 1rem;
    border-radius: 1.6rem;
  }

  .text-wrap {
    margin-bottom: 1rem;
  }

  .text-group h2 {
    font-size: 1.2rem;
  }

  form {
    padding: 1rem 2rem 1.5rem;
  }
}
.otp-container {
    display: flex;
    gap: 12px; /* Increased spacing */
    align-items: center; /* Align button with input fields */
    justify-content: flex-start; /* Align to start like Employee ID field */
    flex-wrap: nowrap; /* Keep button on the side, never wrap */
    width: 100%;
    padding: 0;
    min-width: 0; /* Allow container to shrink if needed */
  }

  .otp-input {
    width: 48px;
    height: 37px;
    text-align: center;
    font-size: 22px;
    font-weight: bold;
    border: none;
    border-bottom: 1px solid var(--surface-border);
    background: transparent;
    color: var(--primary-strong);
    outline: none;
    transition: border-color 0.3s;
    padding: 0;
    flex-shrink: 0; /* Prevent inputs from shrinking */
  }

  .otp-input:focus {
    border-bottom: 1px solid var(--primary);
  }

  /* Style for the eye icon button */
  .pin-visibility-btn {
    width: 40px;
    height: 37px;
    padding: 0;
    border-radius: var(--radius-sm);
    border: 1px solid var(--surface-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    margin-left: 0;
    flex-shrink: 0; /* Prevent button from shrinking */
  }

  .pin-visibility-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--primary);
  }

  .pin-visibility-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    pointer-events: none;
    color: var(--primary-strong);
  }

  .pin-visibility-btn .icon-eye-open,
  .pin-visibility-btn .icon-eye-off {
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  .pin-visibility-btn .icon-eye-off {
    opacity: 0;
    stroke-linecap: round;
  }

  .pin-visibility-btn.is-active {
    background: rgba(139, 92, 246, 0.18);
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.35);
  }

  .pin-visibility-btn.is-active .icon-eye-open {
    opacity: 0.35;
  }

  .pin-visibility-btn.is-active .icon-eye-off {
    opacity: 1;
  }

  /* Responsive Design */
  @media (max-width: 850px) {
    .otp-container {
      gap: 12px;
    }

    .otp-input {
      width: 48px;
      height: 37px;
      font-size: 22px;
    }

    .pin-visibility-btn {
      width: 40px;
      height: 37px;
    }

    .pin-visibility-btn svg {
      width: 20px;
      height: 20px;
    }
  }

  @media (max-width: 600px) {
    .otp-container {
      gap: 12px;
    }

    .otp-input {
      width: 45px;
      height: 37px;
      font-size: 20px;
    }

    .pin-visibility-btn {
      width: 38px;
      height: 37px;
    }

    .pin-visibility-btn svg {
      width: 18px;
      height: 18px;
    }
  }

  @media (max-width: 530px) {
    .otp-container {
      gap: 10px;
    }

    .otp-input {
      width: 42px;
      height: 37px;
      font-size: 20px;
    }

    .pin-visibility-btn {
      width: 36px;
      height: 37px;
    }

    .pin-visibility-btn svg {
      width: 18px;
      height: 18px;
    }
  }

  @media (max-width: 400px) {
    .otp-container {
      gap: 8px;
    }

    .otp-input {
      width: 38px;
      height: 37px;
      font-size: 18px;
    }

    .pin-visibility-btn {
      width: 34px;
      height: 37px;
    }

    .pin-visibility-btn svg {
      width: 16px;
      height: 16px;
    }
  }