/* --- Login Page Component (Nested) --- */
.login-page-wrapper {
  animation: fadeIn 0.6s ease-out;
  margin: 4rem auto;
  max-width: 420px;
  padding: 0 1.5rem;
  text-align: center;
  padding: 0 10px !important;

  @media (max-width: 480px) {
    margin: 0 auto;
    padding: 0;
  }

  .auth-header {
    margin-bottom: 0;

    .logo {
      display: inline-block;
      font-size: 2rem;
      margin-bottom: 1.5rem;
      margin-left: 0;
    }

    h1 {
      color: #ffffff;
      font-size: 2.8rem;
      font-weight: 800;
      letter-spacing: -0.5px;
      margin-top: 0.5rem;

      @media (max-width: 480px) {
        font-size: 2rem;
      }
    }
  }

  .auth-toggle-pill {
    background: #252531;
    border-radius: 50px;
    display: flex;
    justify-content: flex-start !important;
    margin-bottom: 2.5rem;
    padding: 6px;
    width: 100%;
    position: relative;
    overflow: hidden;
    gap: 0 !important;

    @media (max-width: 480px) {
      margin-bottom: 1.5rem !important;
      padding: 6px !important;
    }

    .toggle-btn {
      background: transparent !important;
      border: none;
      border-radius: 50px;
      color: #94a3b8;
      cursor: pointer;
      flex: 1;
      font-size: 1rem;
      font-weight: 600;
      padding: 12px;
      transition: color 0.3s ease;
      position: relative;
      z-index: 2;
      white-space: nowrap;

      @media (max-width: 480px) {
        padding: 10px 5px !important;
        font-size: 0.95rem !important;
      }

      &.active {
        color: var(--bg-dark);
      }
    }

    .sliding-pill {
      position: absolute;
      background: var(--accent);
      border-radius: 50px;
      transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
      z-index: 1;
      pointer-events: none;
    }
  }

  .auth-main-section {
    width: 100%;

    .auth-card-new.hidden {
      display: none;
    }
  }

  /* Form Elements */
  .form-group-new {
    margin-bottom: 1.5rem;
    position: relative;
    text-align: left;

    label {
      background: #191923;
      border-radius: 5px;
      color: #fff;
      display: block;
      font-size: 0.85rem;
      font-weight: 400;
      left: 15px;
      margin-bottom: 0.5rem;
      padding: 0 7px;
      position: absolute;
      top: -11px;
    }

    input {
      background: #1e1e2d;
      border: 1px solid #334155;
      border-radius: 8px;
      color: #ffffff;
      font-size: 1rem;
      padding: 14px 16px;
      transition: var(--transition);
      width: 100%;

      &:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 2px rgba(225, 254, 19, 0.1);
        outline: none;
      }
    }
  }

  .forgot-link {
    color: var(--accent);
    display: block;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    position: absolute;
    right: 0;
    text-decoration: none;
    top: 54px;
    transition: var(--transition);
  }

  .btn-primary-new {
    align-items: center;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(225, 254, 19, 0.15);
    color: var(--bg-dark);
    cursor: pointer;
    display: inline-flex;
    font-size: 1.1rem;
    font-weight: 700;
    justify-content: center;
    padding: 16px;
    width: 100%;

    &:hover {
      background: #f4ff4f;
      box-shadow: 0 6px 25px rgba(225, 254, 19, 0.25);
      transform: translateY(-2px);
    }
  }

  .divider {
    align-items: center;
    color: #64748b;
    display: flex;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 2.5rem 0;
    text-align: center;

    &::before,
    &::after {
      border-bottom: var(--thinLine);
      content: "";
      flex: 1;
    }

    span {
      padding: 0 15px;
    }
  }

  .social-auth {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
  }

  /* Hide Apple Login on Android */
  .is-android & .apple-btn {
    display: none !important;
  }

  .btn-social {
    cursor: pointer;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #1e293b;
    display: flex;
    font-size: 1rem;
    font-weight: 600;
    gap: 12px;
    justify-content: center;
    max-width: 300px;
    padding: 14px;
    width: 100%;

    &:hover {
      background: #f8fafc;
    }

    &.btn-apple {
      padding: 0;
      height: 40px;
      margin: 0;
      width: 100%;
    }
  }

  #google-signin-btn {
    display: flex;
    justify-content: center;
    max-width: 300px;
    width: 100%;

    &>div {
      margin: 0 auto !important;
      max-width: 100% !important;
      width: 100% !important;
    }
  }

  /* Token Redirect Specifics */
  &.token-redirect {

    .info-overlay-trigger,
    .auth-header,
    .auth-toggle-pill,
    .auth-main-section,
    .divider,
    .social-auth {
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.5s ease;
    }

    .token-loader {
      z-index: 9999;
      align-items: center;
      background: #1e1e2d;
      display: flex;
      flex-direction: column;
      gap: 1.5rem;
      inset: 0;
      justify-content: center;
      position: fixed;
      transition:
        opacity 0.5s ease,
        visibility 0.5s ease;
    }

    &.ready {
      .token-loader {
        opacity: 0;
        visibility: hidden;
      }

      .info-overlay-trigger,
      .auth-header,
      .auth-toggle-pill,
      .auth-main-section,
      .divider,
      .social-auth {
        opacity: 1;
        pointer-events: all;
      }
    }
  }
}

/* Loader Essentials (outside wrapper if fixed) */
.token-loader .spinner {
  border-radius: 50%;
  animation: spin-loader 1s linear infinite;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #e1fe13;
  height: 60px;
  width: 60px;
}

.token-loader p {
  color: #94a3b8;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}